CPAN::Forum
SAP-Rfc - Re: inst_execute_report problem
| Posted on Sun Jul 8 04:08:20 2007 by rb in response to 5643 (See the whole thread of 2) |
| Re: inst_execute_report problem |
|
My apologies. I tried to pull out some debugging code and left non-functioning code. Here is a better sample.
#!/usr/bin/perl
use lib '../blib/lib';
use lib '../blib/arch';
use SAP::Rfc;
use Data::Dumper;
my $rfc = new SAP::Rfc(
ASHOST => 'host',
USER => 'userID',
PASSWD => 'password',
LANG => 'EN',
CLIENT => '400',
SYSNR => '00',
TRACE => '0'
);
my $it = $rfc->discover("INST_EXECUTE_REPORT");
# my $s = $rfc->structure(RESULT_TAB);
$it->PROGRAM('SAPMSM66');
$rfc->callrfc($it);
print Dumper( $it );
$template = "a1 a128 a40 a32 a8";
for my $row ( $it->RESULT_TAB ) {
$s-> $row->structure('INSTRESTXT') ;
my $hashrow = { map { $_ => $s->$_() } ( $s->fields ) };
print Dumper( $hashrow );
print "ROW: ".Dumper($row)."\n";
( $instresult, $instrestxt, $instresprg, $jobname, $jobcount ) =
unpack( $template, $row );
$server = substr( $instrestxt, 2, 15 );
$No = substr( $instrestxt, 23, 2 );
$Type = substr( $instrestxt, 26, 3 );
$PID = substr( $instrestxt, 31, 7 );
$Status = substr( $instrestxt, 41, 7 );
$Reason = substr( $instrestxt, 49, 6 );
$Se = substr( $instrestxt, 55, 2 );
$Start = substr( $instrestxt, 58, 5 );
$Err = substr( $instrestxt, 64, 9 );
$Time = substr( $instrestxt, 77, 7 );
$Client = substr( $instrestxt, 84, 3 );
$User = substr( $instrestxt, 88, 12 );
$Report = substr( $instrestxt, 101, 8 );
$Action = substr( $instrestxt, 110, 15 );
print "\n";
printf
"%15s %2s %3s %7s %7s %4s %2s %3s %7s %7s %3s %12s %8s %15s\n",
$server, $No, $Type, $PID, $Status, $Reason, $Se, $Start, $Err,
$Time, $Client, $User, $Report, $Action;
} # for my $row
Best regards,
RB
|
| Write a response |
(3)
]