on 09-29-2015 10:40 AM
Hi All,
How can i generate / trigger the custom alert message to send it alert rule created in ID when solman as consumer in CBMA?
This is a basically a kind of validation warning message from my message mapping program which i need to send it to Solman. As the interface message will not fail, the error message will not be automatically captured using Component Based Alerts to solman.
I have a requirement where i need to send a alert message from my mapping program UDF to the alert rule created in NWA with out failing the message mapping program.
so please provide a way to call the alert API to send the message to capture these warning/info message.
ex: Message payload of message ID 12344545 is having a wrong batch record value.
Please provide your input this.
Note:
I am aware of creating Component Based Alerts rule in NWA and solman as a consumer to send alerts in case of mapping error or failures.
Thanks,
Vijay
Hi
For calling the ALERT function module as you can see in this link
Triggering XI Alerts from a User Defined Function
Imports java.io.;com.sap.aii.mapping.lookup.;
Alerts can be sent by a UDF by calling RFC responsible for sending ALERTS
//sample code for RFC loopup
java.util.Map map;
try {
String msgid;
map = container.getTransformationParameters();
msgid = (String) map.get(StreamTransformationConstants.MESSAGE_ID);
Channel channel = LookupService.getChannel("DE1CLNTXXX","CC_RFC_R_PI");
RfcAccessor accessor = LookupService.getRfcAccessor(channel);
String rfcXML= "<ns0:SALERT_CREATE xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\">"+
"<IP_ALIAS/>"+
"<IP_APPLICATION_GUID/>"+
"<IP_CAT>ALERT_TEST_UDF</IP_CAT>"+
"<IP_XML_CONTAINER/>"+
"<IT_CONTAINER>"+
"<item>"+
"<ELEMENT>ZCUSTOMER</ELEMENT>"+
"<TAB_INDEX>0</TAB_INDEX>"+
"<ELEMLENGTH>20</ELEMLENGTH>"+
"<TYPE>C</TYPE>"+
"<VALUE>"+pnum+"</VALUE>"+
"</item>"+
"<item>"+
"<ELEMENT>ZMSGID</ELEMENT>"+
"<TAB_INDEX>1</TAB_INDEX>"+
"<ELEMLENGTH>70</ELEMLENGTH>"+
"<TYPE>C</TYPE>"+
"<VALUE>"+msgid+"</VALUE>"+
"</item>"+
"</IT_CONTAINER>"+
"</ns0:SALERT_CREATE>";
InputStream inputStream =new ByteArrayInputStream(rfcXML.getBytes());
XmlPayload payload = LookupService.getXmlPayload(inputStream);
Payload rfcOutPayload = accessor.call(payload);
throw new StreamTransformationException ( " Message Mapping Failed because of invalid Customer number");
}
catch(Exception e)
{
throw new RuntimeException("Exception while checking for Distribution channel : "+e);
}
//************************************************
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.