on 02-22-2011 4:31 PM
Dear All,
I have implemented Alerts in my landscape with standard alert framework and i am able to receive alerts if any error.
But my client wants delivery No. also in the alert email. I searched SDN and come to know that this is not possible with out BPM.
I would like to go with BPM as Michael suggested, /people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated
Because all my interfaces are now in QAS for testing, my doubt is, should i change the interface to make interface run through BPM or just enough if i include a Integration process under Namespace?
Please suggest me
Regards
Hi,
Amith found a very nice trick for that and described it in his (pretty new) blog [Payload values in exception alerts using BADI and without BPM or UDF|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/22897] [original link is broken] [original link is broken] [original link is broken];
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am done with entire scenario and now able to get the expected exception under Error TAG in SXMB_MONI
But in Alert i am getting like "MAPPING.APPLICATION_FAULT". I want to get "Appointment Confirmation is Blank & Delv No. is 0085123200."
I have mentioned container variable for this in ALRTCATDEF as &SXMS_ERROR_CODE&
*Error from MONI*
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Request Message Mapping
-->
- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">APPLICATION_FAULT</SAP:Code>
<SAP:P1>Z_ABAP_MAP_EX</SAP:P1>
<SAP:P2>888</SAP:P2>
<SAP:P3>Appointment Confirmation is Blank & Delv No. is 0085123200</SAP:P3>
<SAP:P4 />
<SAP:AdditionalText />
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack>Application error in mapping program Z_ABAP_MAP_EX, error code: 888, error text: Appointment Confirmation is Blank & Delv No. is 0085123200 Exception CX_MAPPING_FAULT occurred (program: Z_ABAP_MAP_EX=================CP, include: Z_ABAP_MAP_EX=================CM001, line: 23).</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
Regards
Iam not sure about the XI/PI version/SP you are using. But it seems there is a limitation with container variables in retrieving the complete error node information.
The container variables SXMS_ERROR_CAT and SXMS_ERROR_CODE are filled from the XML tag <SAP:Code area="error_category">error_code</SAP:Code> (Reference - Note 913858 - XI Alerting: Troubleshooting).
But the container variable SXMS_TO_ADAPTER_ERRLINES is available to retrieve the error details from <SAP:AdditionalText /> and <SAP:Stack>.
The 'error text' available in the <SAP:Stack> which contains the custom error message will be helpful for your requirement.
To use the container variable SXMS_TO_ADAPTER_ERRLINES,you must implement the correction mentioned in Note 1403787 - XI alerting: Container variable for error text of IEngine.
Nagarjuna Thanks a lot
I Used SXMS_TO_ADAPTER_ERRLINES container variable to access <SAP:Stack>, i got alert like this
Mapping Error found for the Inbound interface MI_Shipment_FTP Because Application error in mapping program Z_ABAP_MAP_EX, error code: 888, e; rror text: Appointment Confirmation is Blank & Delivery No. is 0085123; 200 Exception CX_MAPPING_FAULT occurred (program: Z_ABAP_MAP_EX=======; ==========CP, include: Z_ABAP_MAP_EX=================CM001, line: 23).;
Here i didn't get the delivery No. correct, it is separated with ; like 0085123;200 it should be 0085123200, but SXMB_MONI displays 0085123200
Regards
When i am doing positive testing, It is not passing the Message mapping.
Even though Source Plant is not Blank, I am getting the exception . This is my mapping
http://img577.imageshack.us/img577/781/exceptions.jpg
Regards
Display queue is giving correct but i don't know even though it gave True, it went to else part
IfThenElse Block is giving like this
RuntimeException in Message-Mapping transformation: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_Shipment_Load_To_SAP_ method Dynamic$[SOURCE PLANT is Blank AND Delivery No. is 0085123200, com.sap.aii.mappingtool.tf3.rt.Context@7eaee24c]
Regards
Edited by: Bhavana Ch on Feb 23, 2011 10:52 PM
Edited by: Bhavana Ch on Feb 23, 2011 10:53 PM
As the ABAP class is called after the first msgmapping in interface mapping, it will create a exception everytime.
The ABAP class shown in the blog is not complete. There should be condition to pass the source value to target if the field is not blank.
If the field is blank, the code shown in the blog will create execption.Please refer the comment section in blog.
If i am testing in Interface mapping i agree that it will be called ABAP class every time.But i am testing in Message mapping itself not in Interface mapping.
When i am testing in Message Mapping, at least i should be able to get if then else conditions as expected. Every time it is going to else part.
Regards
>>There should be condition to pass the source value to target if the field is not blank.
Can you please guide me where to write and how to pass the validation
Because when i take payload from MONI and test it, it is success, where as if i go with Display Queue option it is throwing exception.
Regards
As you are calling the udf which acess XI runtime parameters, you cannot test the mapping using message mapping 'test' tab.
Sorry for my earlier response asking you to check 'disply queue'.The exception shown when you are trying to access the display queue is java nullpointer execption. The interface has to be run completely, to test the mapping.
The ABAP class should check the error node first and if it blank, then the source payload should be COPIED to target.Else call the exception code shown in blog.
This is File to Idoc Interface, in this case is it dependable on IDOC structure to parse the XML to target??
Is it required to know how many fields we are mapping to IDOC and parse those ?? like this
I have no idea on how to proceed for this..
Please give me some idea on how to proceed process, just brief the process on copying the xml in ABAP Mapping
Regards
Edited by: Bhavana Ch on Feb 24, 2011 4:15 PM
You don't need to parse the XML in ABAP mapping. The graphical mapping which you are using will do the transformation.
The ABAP class is called after the graphical mapping in interface mapping. So, in the ABAP class, you just need to check the error node of dynamic config. If its blank (no error), copy the input payload to output. Else, call the exception block.
The output of the graphical mapping is nothing but Idoc XML.So we don't need to parse xml structure in ABAP class.
something like - result = source which Henrique mentioned in this thread-
its like by-passing the second mapping without any XML parsing.The xml formed after the graphical mapping which is nothing but Idoc structure will be sent as-it-is to receiver Idoc adapter in case of no-errors.
If (Dynmic config error node is empty)
result = source
Else
CALL execptionblock
Check this thread aswell-
Edited by: nagarjuna _s on Feb 24, 2011 5:39 PM
Nagarjuna,
In ABAP class Even though i am checking for the error node value to raise the exception or not, Each and every time i am getting filled error node with exception even though the source plant is not blank.
Dont know the reason. Here is the ABAP class i have
METHOD if_mapping~execute.
DATA l_record TYPE mpp_dynamic.
DATA our_error TYPE string.
getting dynamic configuration value
filled in by any previous mapping
CLEAR: OUR_ERROR.
CALL METHOD dynamic_configuration->get_record
EXPORTING
namespace = 'http://sap.com/xi/XI/System/ERROR'
name = 'ERROR'
RECEIVING
record = l_record.
our_error = l_record-value.
IF our_error IS NOT INITIAL.
**raising exception with our message
RAISE EXCEPTION TYPE cx_mapping_fault
EXPORTING
TEXTID =
PREVIOUS =
error_code = '888'
error_text = 'our_error'.
ELSE.
result = source.
ENDIF.
ENDMETHOD.
Regards
Edited by: Bhavana Ch on Feb 24, 2011 9:08 PM
When i remove the UDF from mapping and execute Thru Test TAB, it is success.
I tested with Plant value and with out plant value also, following are the results from display queue
With Plant Value
http://img713.imageshack.us/img713/8569/error22.jpg
With out plant value
http://img231.imageshack.us/img231/1285/error21.jpg
Regards
The mapping looks good and providing the desired results.
Please include the udf in msg mapping and remove the ABAP map from interface mapping and test the interface (ene-to-end) for both the cases.
If this test provides the desired results then the problem is with ABAP code and it needs to be debuged.
Hello Nagarjuna,
Finally done the Job successfully . Able to get both positive & Negative tests.
The mapping should be like this, UDF should be after IfThenElse Block. ))
http://img215.imageshack.us/img215/1259/mappss.jpg
Thanks for your support all the way
Regards
I understand that i have to re-design all my interfaces those already developed to implement this BPM process
Since i have already developed Interfaces, I have to completely change the repository Objects & Directory objects to involve BPM process.
Correct me if i am wrong
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes..you need to change your interfaces design to accomodate the process integrations steps mentioned in the blog.
Instead of including the BPM steps, you can check the following blogs on 'how to trigger a custom error in sxmb_moni' so that you can get this information using the normal alert setup.
/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
/people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping
Nagarjuna,
Thank you very much for pointing me these blogs.
I have seen Alessandro's blog before to raise smart exceptions, but the problem with that blog is the exception messages comes under TRACE from SXMB_MONI. it will not be visible under ERROR Node.
I will try with Michal Blog as he said the exception wil appear under ERROR Tag.
One Q on this: To which field or node i have to mapp the UDF created??
And if i want to do some validations, where can i perform those??? in ABAP class?? or where??
Regards
I got you, here is my validation inside mapping
For Ex: i have "source Plant" field from source structure, If Source Plant is Blank, i would like to raise exception as "Source Plant is Blank"
Just give me some idea on this, where should i do these kind of validations?? in UDF or ABAP Class??
Regards
Edited by: Bhavana Ch on Feb 22, 2011 9:46 PM
You can do these validations in your mapping (graphical/xlst etc). Use IfElse block and check if the field is blank. If the field is blank, map the constant with text -"Source Plant is Blank". Else pass the vaue you received in the field.
The output of the IfElse block should be passed as input to udf. The udf populates the value in dynamic configuration 'ERROR' node.
This is what i did in mapping for validating the source plant is empty or not. If empty i am passing desired value to Exception and getting displayed that.
Now i have to do ABAP class and see what happens at runtime!!
http://img577.imageshack.us/img577/781/exceptions.jpg
Regards
User | Count |
---|---|
95 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.