Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8734

Re: How to send variable data through alert mail without BPM

$
0
0

Hi Swapna

 

Follow this steps

 

1. Create one container variable one for order number say ZORDNUM. Use transaction ALRTCATDEF.

2. Generate the short text and long text using that container variable in alert category.

example:

 

Displaying Payload content in alert message [Compatibility Mode] - Microsoft Word.jpg

 

 

3. Write an udf in message mapping and generate the alert message.

 

Sample map:

 

Enterprise Services Builder (FRPARIFIBXDPI_PID_00)_9.jpg

 

Use order number as input to the alert UDF and name the argument as ordernum

 

 

 

Sample UDF code:

 

java.util.Map map;

 

 

try {

 

  

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>ZORDNUM</ELEMENT>"+

            "<TAB_INDEX>0</TAB_INDEX>"+

            "<ELEMLENGTH>20</ELEMLENGTH>"+

            "<TYPE>C</TYPE>"+

            "<VALUE>"+ordernum+"</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  adrdess ");

 

}

catch(Exception e)

{

  throw new RuntimeException("Exception while checking for Distribution channel : "+e);

 

 

}

 

Let me know if you have any doubts.


Viewing all articles
Browse latest Browse all 8734

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>