Skip to Content
0
Former Member
Apr 18, 2007 at 06:12 PM

PERL and CCMS Alerts

57 Views

OK I have been playing with Perl and SAP::RFC trying to get the XAL External Interface Management system working. I have successfully returned information from a different Perl script but the BAPI was not part of the XAL. I created the following script to get the open alerts from RZ20 under R/3Service > Background > sys_sid_00\...\Background\ > AbortedJobs:

***********************************************************************************

#!/usr/bin/perl

use SAP::Rfc;

use Data::Dumper;

$rfc = new SAP::Rfc(

ASHOST => 'host',

USER => 'user',

PASSWD => 'pass',

LANG => 'EN',

CLIENT => '200',

SYSNR => '01',

TRACE => '1' );

print " START: ".scalar localtime() ."\n";

#Starting my XMI logon with BAPI_XMI_LOGON for XAL

my $logon = $rfc->discover("BAPI_XMI_LOGON");

$logon->EXTCOMPANY('');

$logon->EXTPRODUCT('');

$logon->INTERFACE('XAL');

$logon->VERSION('1.0');

$rfc->callrfc( $logon );

print "XMI Interface opened\n\n";

#Running my Alert Monitor BAPI

my $it = $rfc->discover("BAPI_SYSTEM_MTE_GETALERTS");

$it->TID([{ MTSYSID => "SID", MTMCNAME => "host_SID_00", MTNUMRANGE => "032", MTUID => "0000000003", MTCLASS => "102", MTINDEX => "0000000414", EXTINDEX => "0000000011"}]);

$it->EXTERNAL_USER_NAME("pksobiec");

$rfc->callrfc($it);

#Closing my XMI logon with BAPI_XMI_LOGOFF for XAL

my $logoff = $rfc->discover("BAPI_XMI_LOGOFF");

$logoff->INTERFACE('XAL');

$rfc->callrfc( $logoff );

print "\nXMI XAL interface closed\n";

$rfc->close();

***********************************************************************************

When Running the script I do not recieve any errors but I still get nothing returned. I know that there are open alerts the AbortedJobs section of the CCMS because I can see them when I log in. Now when I pass it the TID information I got from RZ20 by typing "TID" in the command field I get this:

***********************************************************************************

From RZ20 :

AbortedJobs [Standard] SID <host>_SID_00 032 0000000003 102 0000000414 0000000011

***********************************************************************************

I am not sure that I am using the correct TID or if the problem is in the script. Can someone please take a look and let me know if I am doing this correctly.

Best Regards and Thanks in advance for your help,

Paul Ksobiech