cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Alerts in BPM

Former Member
0 Kudos

Hi,

I am working on a scenario where in i need to raise alerts to business end users from mapping errors. The mapping errors occurs due to missing data in Idoc segments. I have tried using the control step in exception branch and posting a call to the Alert Category defined in ALRTCATDEF in the ABAP stack.

In the alert category, i have defined the container variables and used the following configurations in the long text -

Message ID : &SXMS_MSG_GUID&

Sender Service : &SXMS_FROM_SERVICE&

Sender Interface : &SXMS_FROM_INTERFACE&

Sender NameSpace : &SXMS_FROM_NAMESPACE&

Receiver Service : &SXMS_TO_SERVICE&

Receiver Interface : &SXMS_TO_INTERFACE&

Receiver Namespace : &SXMS_TO_NAMESPACE&

Adapter Error : &SXMS_TO_ADAPTER_ERRTXT&

Error Category : &SXMS_ERROR_CAT&

Error Code : &SXMS_ERROR_CODE&

However on mapping error, i get the alert message in the inbox with all the above fields blank. Even i am not getting the possible subsequent activities in the alert mail.

The client requires the details to be filled in case of mapping errors.

For your information, the above information is well filled in case of any adapter error or Network issues (ICM failure etc..).

I doubt that the data is unable to be filled in due to mapping being executed on the Java stack.

Please suggest.

Thanks,

Amit

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member200962
Active Contributor
0 Kudos
However on mapping error, i get the alert message in the inbox with all the above fields blank. Even i am not getting the 
possible subsequent activities in the alert mail

What about the status of Dynamic Text checkbox in your Alert Category....if it is checked then you wont get any value in the variables....also i assume that you have included a Control Step to Thrwo alert and the Transformation step is inside a BLOCK (having Exception Branch)

I doubt that the data is unable to be filled in due to mapping being executed on the Java stack

Mapping is executed on JAVA stack (unless ABAP)

Regards,

Abhishek.

Former Member
0 Kudos

Hi Abhishek,

I am executing the mapping in a transformation step and has set a call to the exception branch in system error link within the properties of the transformation step.

In the exception branch, i am using a control step where in i use the throw alert action and a reference to the predefined alert category. In the alert category, i have unchecked the dynamic text and set up the short and long text with parameters from container variables, as mentioned in the question above.

Can you explain me why the variables are not populated in this case?

Thhanks,

Amit

former_member181962
Active Contributor
0 Kudos

Hi Amit,

I faced the same issue in one of my projects.

You canot get dynamic messages(Using container variables) with the long text option in your alert category.

You can do the following.

1) In the Exception branch, have a transformation step with source message as the source message in your actual mapping and target message as an abstartct interface(Name it as Alert_Variables(NOt mandataory to name it the same way) ) with one node and one child (of type string).

2) Have a mapping between your source message and your target Alert_Variables.

3) Write a UDF to get the concatenated text with all the variables you need and map to the target field.

//write your code here
String constant;
java.util.Map map;
map = container.getTransformationParameters();

constant = "Message GUID:"+(String) map.get(StreamTransformationConstants.MESSAGE_ID)+"\n"
+"Sender Party:"+(String) map.get(StreamTransformationConstants.SENDER_PARTY)+"\n"
+"Sender Service:"+(String) map.get(StreamTransformationConstants.SENDER_SERVICE)+"\n"
+"Sender Namespace:"+(String) map.get(StreamTransformationConstants.SENDER_NAMESPACE)+"\n"
+"Sender Interface:"+(String) map.get(StreamTransformationConstants.INTERFACE)+"\n"
+"\n"
+"Receiver Party:"+(String) map.get(StreamTransformationConstants.RECEIVER_PARTY)+"\n"
+"Receiver Service:"+(String) map.get(StreamTransformationConstants.RECEIVER_SERVICE)+"\n"
+"Receiver Namespace:"+(String) map.get(StreamTransformationConstants.RECEIVER_NAMESPACE)+"\n"
+"Receiver Interface:"+(String) map.get(StreamTransformationConstants.RECEIVER_NAME)+"\n"
+"\n"; 
return constant;

4) After the transformation step in your exception branch, you can have a container step to assign the value of the target node's child element(That was returned by the transformation step).

5) Have the control step to raise the alert category. The alert text should include only the container variable that holds the concatenated value of all the information.

6) Check the Dynamic text checkbox in your ALert category defined in your abap stack.

Regards,

Ravi Kanth Talagana

Former Member
0 Kudos

Hi Ravi,

Thanks for your reply. I am close to the solution, however, i came up with another issue now.

The fields are populated with the values on the alert mails but at the same time, the complete message is not displayed.

Current Alert Message -

Message GUID:A2F253B0217311DFCBEF0015600EA31C

Sender Party:null

Sender Service:SAPRDV

Sender Namespace:urn:sap-com:document:sap:idoc:messages

Sender Interface:INVOIC.INVOIC02.ZINVOIC02

Receiver Party:null

Receiver Service:CSBK_Invoice02

Receiver Namespac

The receiver Namespace and Receiver Interface are missing. This is probably due to the message length validation for Alert Text property in the Control Step of BPM. Is there any way to increase the length so as to cover the entire message ?

Thanks,

Amit

former_member181962
Active Contributor
0 Kudos

Hi,

I don't think that is due to length limitation.

I get messages loner than that you got.

Try again with some other test case.

OR, just have a 2-5 second wait step after the mapping in the exception branch and see if the message comes through properly.

Regards,

Ravi Kanth Talagana

sunil_singh13
Active Contributor
0 Kudos

Hi Amit,

This is very abnormal behaviour I can't pin point the reason as ideally if it works for other kind of exception then it should also work for Mapping exceptions.

As a workaround you can use a send step with transformation step preceeding it for mapping in the exception branch to snd the exception through mail adapter, also in this case all the parameters to be sent in case of error are know you can hardcode them.

thanks,

Sunil Singh

former_member181985
Active Contributor
0 Kudos

May I ask you why you are using BPM. Is your scenario too complex.

You can use normal alerts for such requirement.

Former Member
0 Kudos

Hi ,

Scenario is too complicated with call to multiple interfaces depending upon various conditions and field values of IDoc Segments. Even the calls are synchronous and we usually need to update another database based on the responses of the synchronous calls. So BPM is the must in these scenarios.

Amit

former_member181985
Active Contributor
0 Kudos

Hi,

Try using normal alerts only. Remove the Control step for raising alerts in BPM. Also remove transformation step if any pertaining to the JDBC synchronous call from BPM. Do mapping outside mapping i.e., general mapping in ID.

Create a specific alert rule (releated your interface say sender: IP service, Abstract interface and name space) in RWB for the already existing alert category which u mentioned for mapping failure.

Regards,

Praveen Gujjeti.