cancel
Showing results for 
Search instead for 
Did you mean: 

Alert status definitions

Former Member
0 Kudos

Hi,

I'm writing some java code to read alerts using the JCO and BAPI_SYSTEM_MT_GETALERTDATA and BAPI_SYSTEM_ALERT_GETDETAILS. I can sucessfully read the alerts & their details, but I don't know how to sort or classify them because I don't know how to interpret several fields returned by these calls. Specifically I get the following attribute/value pairs for an alert:

VALUE 3

SEVERITY 50

STATUS 40

SEVERITY is defined in the alert definition I believe. But I can't find the definitions for the VALUE or STATUS. The BAPIALDATA definition I have states that the VALUE should be Red, Yellow, Green, etc. Obviously there is a mapping of these colors to numbers. The same applies to STATUS, where 40 may mean "ACTIVE".

Does anyone know where I can find the mapping from the numbers I get to the colors, etc. for VALUE & STATUS?

Thanks in advance for any help!

Jeff

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Nagarjuna,

The basic steps are getting a client & logging on, getting the Monitor Trees, finding the one you want, then getting the alerts. Here are some code samples that I use:

//To get the trees:

JCO.Function getList = getFunction("BAPI_SYSTEM_MON_GETLIST");

JCO.ParameterList input = getList.getImportParameterList();

input.setValue(user, "EXTERNAL_USER_NAME");

cli.execute(getList);

JCO.Table monitors = getList.getTableParameterList().getTable("MONITOR_NAMES");

//To get the desired tree:

JCO.Function getTree = getFunction("BAPI_SYSTEM_MON_GETTREE");

if (getTree != null) {

JCO.ParameterList input = getTree.getImportParameterList();

IMetaData metaData = repository.getStructureDefinition("BAPIMNNAME");

JCO.Structure struct = new JCO.Structure(metaData);

struct.setValue("SAP CCMS Monitor Templates","MS_NAME");

struct.setValue(table, "MONI_NAME");

input.setValue(struct, "MONITOR_NAME");

input.setValue(user, "EXTERNAL_USER_NAME");

cli.execute(getTree);

JCO.Table nodes = getTree.getTableParameterList().getTable("TREE_NODES");

}

//Then use the treeNodes table to get alerts:

JCO.Function getAlertData = getFunction("BAPI_SYSTEM_MT_GETALERTDATA");

JCO.Table alertTable = null;

if (getAlertData != null) {

JCO.ParameterList input = getAlertData.getImportParameterList();

JCO.ParameterList parmList = getAlertData.getTableParameterList();

JCO.Table rootNode = getAlertData.getTableParameterList().getTable("ROOT_NODES");

rootNode.appendRow();

rootNode.setValue(nodes.getString("MTSYSID"),"MTSYSID");

rootNode.setValue(nodes.getString("MTCLASS"),"MTCLASS");

rootNode.setValue(nodes.getString("MTNUMRANGE"), MTNUMRANGE");

rootNode.setValue(nodes.getString("MTMCNAME"), "MTMCNAME");

rootNode.setValue(nodes.getString("MTUID"), "MTUID");

rootNode.setValue(nodes.getString("MTINDEX"),"MTINDEX");

rootNode.setValue(nodes.getString("EXTINDEX"), "EXTINDEX");

JCO.Table treeNodes = getAlertData.getTableParameterList().getTable("TREE_NODES");

treeNodes = nodes; //This is the nodes from earlier

parmList.setValue(treeNodes, "TREE_NODES");

parmList.setValue(rootNode, "ROOT_NODES");

getAlertData.setTableParameterList(parmList);

input.setValue(user, "EXTERNAL_USER_NAME");

input.setValue("X", "GET_ALERT_HISTORY");

cli.execute(getAlertData);

alertTable = getAlertData.getTableParameterList().getTable("ALERT_DATA");

Hope this helps,

Jeff

Former Member
0 Kudos

Hi Jeff,

Thanks for your Help.

Regards,

Nagarjuna

Former Member
0 Kudos

hello all,

i'm testing your code for:

get list of monitoring systems, calling bapi BAPI_SYSTEM_MON_GETLIST

with input param EXTERNAL_USER_NAME = <myusernameOfJCOConnection>

my RETURN structure is:

<i>MSG_NOT_LOGGED_ON <b>XM 028 The external system management tool did not log on to the CCMS XMI interface</b>. The method call was therefore termi-nated.</i>

and my bapi emulator return a table with 0 rows.

my myusernameOfJCOConnection is SAP_ALL and SAP_NEW and

i'm successfully connected to sap client & i'm able to call bapi BAPI_COMPANYCODE_GETLIST

how i can check if in ccms system my username is enabled?

thanks to all!

ELiana

Former Member
0 Kudos

solved:

// connect to sap client

JCO.Function function = null;

try

{

function = this.createFunction("BAPI_XMI_LOGON"); } catch (Exception e)

{

e.printStackTrace();

}

JCO.ParameterList input = function.getImportParameterList();

input.setValue(<mycompanyname>, "EXTCOMPANY");

input.setValue(<myproductname>,"EXTPRODUCT");

input.setValue("XAL", "INTERFACE");

input.setValue("1.0", "VERSION");

mConnection.execute(function);

JCO.Structure returnStructure = function.getExportParameterList().getStructure("RETURN");

System.out.println("BAPI_SYSTEM_MON_GETLISTBAPI_XMI_LOGON RETURN : " + returnStructure.getString("MESSAGE"));

// Unique XMI session identification

JCO.Field f = function.getExportParameterList().getField("SESSIONID");

this.sessionId = f.getString() ;

System.out.println("sessionId for CCMS queries : " + this.sessionId);

Former Member
0 Kudos

Hi Eliana,

I executed BAPI_XMI_LOGON. I printed the session ID which is a 24+1 letter ID. and MESSAGE field contains nothing.

And there is no error or exception.

am I supposed to use this value some where while making calls to BAPI_SYSTEM_MON_GETTREE?

I am using JCo 3.0

In my code I am executing BAPI_XMI_LOGON function module followed by I execute BAPI_SYSTEM_MON_GETTREE with appropriate values. But it is giving following exception ,

Not logged on in interface XAL (function BAPI_SYSTEM_MON_GET_TREE)

Thanks in advance. Your help is greately appreciated.

Former Member
0 Kudos

Hi Jeffrey,

Log on to the SAP R/3 front end, go to transaction code <b>BAPI</b>, search for the BAPI_SYSTEM_ALERT_GETDETAILS there, naviagte to the functional module, open the export parameters list, click the green button meant for long text description at the far end of the paramaters for the documentation of the parameters like VALUE etc.

Best regards,

Guru.

PS: Reward points for replies.

Former Member
0 Kudos

This was helpful even though I couldn't navigate exactly as you described. I did find a note that stated:

Alert: alert value (1 = green, 2 = yellow, ....)

But I didn't find any definitions for the values for the STATUS field. By getting an alert history I've found that it appears that the following STATUS values mean:

ACTIVE 40

DONE 200

AUTO_COMPLETED 205

But nowhere do I find these values defined via the SAPGUI. It may be that some of the help functions are not enabled on the system I have access to.

I mostly need to know if STATUS ACTIVE=40 at this point. I'm assuming that VALUE 2=Yellow & 3=Red.

Former Member
0 Kudos

Hi Jeff,

Can you share the code piece with me that uses the BAPI_SYSTEM_MT_GETALERTDATA bapi.

I am finding it very difficult to get the data out of this BAPI.

My mail ID: maha.nagarjuna@gmail.com

Thanks & regards,

Nagarjuna.