I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2010-01-22 00:26:08.929633-08 by hesc in response to 12226
Re: Submitting data to SAP
Hi,
here is an example to reset and unlock of one existing user id.
... # exists user id in SAP? $UserId = "TESTUSER"; $Iface = $Rfc->discover( "BAPI_USER_GET_DETAIL" ); $Iface->USERNAME( $UserId ); $Rfc->callrfc( $Iface ); foreach my $TblReturn( $Iface->tab('RETURN')->hashRows() ) { my $Type = $TblReturn->{'TYPE'}; my $Message = $TblReturn->{'MESSAGE'}; if( $Type eq "E" ) { ... print error message ... exit(); } } # reset password $PasswordNew = "..."; $Iface = $Rfc->discover( "BAPI_USER_CHANGE" ); $Iface->USERNAME( $UserId ); my $Password = $Iface->parm('PASSWORD')->structure(); $Password->BAPIPWD($PasswordNew); $Iface->PASSWORD($Password->value); my $PasswordX = $Iface->parm('PASSWORDX')->structure(); my $PasswordXX = "X"; $PasswordX->BAPIPWD($PasswordXX); $Iface->PASSWORDX($PasswordX->value); my $Id = $Iface->parm('LOGONDATA')->structure(); $Id->BCODE(pack("H*","0000000000000000")); $Iface->LOGONDATA($Id->value); $Rfc->callrfc( $Iface ); foreach my $TblReturn( $Iface->tab('RETURN')->hashRows() ) { my $Type = $TblReturn->{'TYPE'}; my $Message = $TblReturn->{'MESSAGE'}; if( $Type eq "E" ) { ... print error message ... exit(); } } # unlock user $Iface = $Rfc->discover( "BAPI_USER_UNLOCK" ); $Iface->USERNAME( $UserId ); $Rfc->callrfc( $Iface ); foreach my $TblReturn( $Iface->tab('RETURN')->hashRows() ) { my $Type = $TblReturn->{'TYPE'}; my $Message = $TblReturn->{'MESSAGE'}; if( $Type eq "E" ) { ... print error message ... exit(); } } ...
Best regards,
Helmut
Direct Responses: Write a response