SAP-Rfc - inst_execute_report problem

Posted on Thu Jul 5 20:06:25 2007 by rb
inst_execute_report problem
Hi, I'm trying to retrieve the output of SM66 (SAPMSM66) using function module INST_EXECUTE_REPORT. So far I've been unsuccessful. My code looks like:
use lib '../blib/lib'; use lib '../blib/arch'; use SAP::Rfc; use Data::Dumper; my $rfc = new SAP::Rfc( ASHOST => 'system', USER => 'user', PASSWD => 'password', LANG => 'EN', CLIENT => 'client', SYSNR => '00', TRACE => '0' ); my $it = $rfc->discover("INST_EXECUTE_REPORT"); $it->PROGRAM('SAPMSM66'); $rfc->callrfc($it); $template = "a1 a128 a40 a32 a8"; for my $row ( $it->RESULT_TAB ) { ( $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 ); if ( $server !~ /---------------/ && $server !~ /Sort: Ser/ ) { 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
Has anyone been able to access data using inst_execute_report? Any suggestions appreciated. Best regards, Russ
Direct Responses: 5661 | Write a response