on 03-10-2010 11:54 AM
Hi,
I have a scenario to post the idoc to file to mulitple receivers. I have to get both Message ID and Parent Message ID in mapping. I am able to get Message ID but not Parent Message ID. I tried to get it from Table sxmspmast but it does not contain the entry during runtime.
Any suggestions to get the Parent ID while in Mapping.
Thanks,
Manikandan R
maybe a dummy mapping of IDoc to single File in which you can extract the message id (parent) followed by 1 File to N file mapping in which you can get the child message id?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can create a UDF,say getMSGID, to get current message ID:
String headerField;
java.util.Map map;
// get runtime constant map
AbstractTrace trace=container.getTrace();
map = container.getTransformationParameters();
String key = "MessageId";
// get value of header field by using variable key
headerField = (String) map.get(key);
return headerField;
pass this output to an RFC lookup UDF which calls this FM in XI ABAP stack:
FUNCTION ZGET_PARENT_MSG_ID.
*"----
""Local Interface:
*" IMPORTING
*" VALUE(I_CURRMSGID) TYPE CHAR40
*" EXPORTING
*" VALUE(E_PARENTMSGID) TYPE CHAR40
*"----
DATA: lv_currmsgid type SXMSPMAST-MSGGUID,
lv_parentmsgid LIKE SXMSPMAST-PARENTMSG,
lv_currmsgid = i_currmsgid.
select single PARENTMSG from SXMSPMAST into lv_parentmsgid where MSGGUID = lv_currmsgid.
e_premsgid = lv_parentmsgid.
ENDFUNCTION.
Hello Manikandan,
We had a requirement where we create an IDoc out of EDIFACT file and then create an APERAK (Application Error acknowledgement) having the contents from original file along with the status of IDoc posted.
So I had created two mappings :
1) EDIFACT - IDoc
2) EDIFACT - APERAK
I needed to have IDoc status posted by first mapping and hence,I needed a reference to previous mapping in my current mapping.
In this case,I had a parent message with two child messages created for these two mappings.
So I had to pass current message ID and get parent message ID and then this parent message ID was used to get another child which would be the message created by first mapping.
Hence,in addition to the code I mentioned,I had an additional database query where I pass parent message ID in the same table to get another child message ID.
But it worked fine and this scenario has been live for a long time.
I believe,it should work in your case also.
Else,please let me know what exactly you are trying to achieve and where is it failing.
Regards,
Shweta
Hi Shweta,
An Outboud Idoc has to be posted as file to three different locations with the same file name.
File Name is generated in RFC lookup. I am using mulitple receivers in RD. I am using same interface mapping in all the ID.
When the MM gets exectued, in lookup, I will query the SXMS*MAST table for parent message id, this parentmsg id is used to get the filename from the customized table, if the entry is there it will return filename, else it will create the entry and retun filename.
When i tested, the *MAST table does not give parentmsgid as the entry is not yet recorded at that time.
It is available for you because you are querying in the second mapping, so u will be having the entry.
Now we are handling our logic using IDOC Number.
Thanks Shwetha..
Regards,
Manikandan R
Instead of MsgId, Idoc Number is persisted and File Name is returned based on it.
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.