cancel
Showing results for 
Search instead for 
Did you mean: 

Hi Guys

Former Member
0 Kudos

I would like to raise an alert notification in message mapping (Graphical) depends on a filed value.

I am trying to achive by writing UDF and with in UDF iam trying to call the SALERT_CREATE function mudule to raise an alert. please check below my UDF code, while compile i am getting some errors.

try{

Channel channel = LookupService.getChannel("DS100", "SAP_Alert_RFC_RECEIVER" );

RfcAccessor accessor = LookupService.getRfcAccessor(channel);

}catch(Exception e)

{

System.out.println(e);

}

String rfcxml ="<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns0:SALERT_CREATE xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\"><IP_APPLICATION_GUID/> <IP_CAT>ERRORS_IE</IP_CAT> <IT_CONTAINER><item><ELEMENT>DOCNUMBER</ELEMENT> <TAB_INDEX>0</TAB_INDEX> <ELEMLENGTH>250</ELEMLENGTH> <TYPE>C</TYPE> <VALUE>******</VALUE> </item> </IT_CONTAINER></ns0:SALERT_CREATE>";

try{

InputStream inputStream =new ByteArrayInputStream(rfcxml.getBytes());

XmlPayload payload = LookupService.getXmlPayload(inputStream);


Payload rfcOutPayload = null;

rfcOutPayload = accessor.call(payload);


}catch(Exception e)

{

System.out.println(e);

}

Runtime Errors:

Source text of object Message Mapping: MM_New_Mapping | http://xiTest.com/xi/XI has syntax errors:

Can't we use RFCLOOKUP standard function directly in mapping instead of writing UDF, if so please let me know what are the prerequisites?

I don't want to use mail Adapter and Java mapping (As this is existing scenario i can't change entire scenario).

Can you please help some one will more appriciate.

Thanks...

Siva

Accepted Solutions (0)

Answers (2)

Answers (2)

prateek
Active Contributor
0 Kudos

Siva, instead of "Hi Guys", could you provide a meaningful subject?

Former Member
0 Kudos

Hello Siva!

You should be able to import the RFC and call it using the RFC lookup. Please check both blog entries below for calling the RFC and configuring the RFCLookup:

http://scn.sap.com/people/jin.shin/blog/2008/02/15/sap-pi-71-mapping-enhancements-series-graphical-s...

http://scn.sap.com/community/pi-and-soa-middleware/blog/2006/07/25/triggering-xi-alerts-from-a-user-...

Best wishes,

Lucas Santos