cancel
Showing results for 
Search instead for 
Did you mean: 

PERL and CCMS Alerts

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Piers,

First let me say thank you for all your work on this Perl Module. It is great!! Thank you also for your help on this it did resolve the issue. That was the problem, as soon as I took out the [] it worked fine.

I have one last question if you or anyone for that matter can help me. How do you decrypt the returned message. I have been digging through help.sap.com and the web and con not find anything that describes what is returned. I receive this (now that you corrected my error):

SID SAP_CCMS_host_SID_00 0001278548000000015620070319031954

I find that the date is 20070319 but how do I decipher all the numbers around it to anything meaningful.

I guess what I am asking is, is there any GOOD documentation on how to use the XAL, XBP, XMB, or XOM interfaces. now that I have connected I would love to know how to determine what it is telling me.

Any help would be greatly appreciated. and Thanks again!!

Paul

Former Member
0 Kudos

You really need to dig into the definition of the BAPIAID structure.

This is more of an application question at this stage.

Answers (2)

Answers (2)

Former Member
0 Kudos

Piers,

Thank you again for your assistance. I will take a look at the structure and see what I can dig up. I truly appreciate your assistance.

Kind Regards,

Paul

Former Member
0 Kudos

Hi -

Parameter TID is a structure not a table, so you do not need the array-ref around it. Try this instead:

[code]

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

[/code]

Cheers.