on 10-02-2013 9:32 PM
I'm receiving IDocs from ECC , based on that I have to generate a XML and put it in a target directory.
Question: In IDoc, if one specific node occurs multiple times I need to generate multiple XML files. How can I achieve this?
Hope I'm clear with the question.
Thanks in advance.
Hi,
Not very clear at which level you need help, however it is a common question, check SDN for blogs on specific information
below doc/ links/ sub links may help you achieve it.
note : in the target structure, for the node that needs to repeat, you have to make the occurrence as (0..unbounded)
http://help.sap.com/saphelp_nw73ehp1/helpdata/en/18/fa87311cea41e49dc9d931a3b67703/content.htm
http://help.sap.com/saphelp_nwpi711/helpdata/en/42/f3b31d48fb1bc8e10000000a11466f/content.htm
Regards
Vishnu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I recommend you, go to signature tab and in the target structure modify the occorrance to 0....ounbouded. Later go back to the signature tab and you will see that 2 additional nodes where added to the original structures - Messages and Message1. dont care about this because are dummy nodes that wont be send to the backend system
once you do this create map the node of the IDOC with the node of Message1 of the target structure.
then you will need to change the mapping of each field. i reccomend you to use the standar funtion INDEX under constant Functions(if i not wrong).
every field should look like:
<field1>--->INDEX(0)---<rest of mapping>
the use of this function will allow you the get the value of the field for each time that the node of the IDOC repeat.
Try this and let me know.
Regards
Rodrigo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for all you replies.
I'm following the below blog to do it, everything looks good so far and I could generate multiple files.
For every 'subnode' occurrence in source, a XML file should be created. i.e. if there are 3 'subnodes' 3 XML files should be generated.
In below case I could successfully generate multiple XML files:
But when I change the mapping of 'tg_fld1' to 'src_fld1' , I'm getting an error: see mapping below ( circled in black ) ...
Below is the error :
Please advice. Thanks in advance !!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Subnode Occurrence is N , not 1. I have attached a wrong image.
Here is the correct mapping screen shot:
Error Message:
Cannot create target element /ns0:Messages/ns0:Message1/ns1:test_msg[2]/tg_node/tg_fld1. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD
See error logs for details
Thanks !!
Hi Aday,
you can map the specific Idoc node with the root node of the target field to genrate the same number of xml files.
PFB the link with similar scenario for clear understanding.
http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=202080406
thanks and regards,
Praveen T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Follow below blog for 1:N mapping for your requirement. You have to achieve this by multimapping.
Regards
Aashish Sinha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aday,
You can do multi-mapping (1:n) in PI to generate multiple files. There are multiple blogs on this topic. Concept remains the same.
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.