on 07-02-2011 4:13 PM
HI Users,
my scenario is jms(xml file) to idoc. for each file have multiple records for each record i need to create multiple idocs.
source structure:
<lineitem>
<student sid="cid">456</student>
<hreference>
<reference rtype="number">123</reference>
.........
</hreference>
<hreference>
<reference rtype="number">789</reference>
</hreference>
<hreference>
<reference rtype="char">147</reference>
</hreference>
now condition is One input message must create only one output message for each unique rtype="number" and sid="cid" combination.
for example
1. rtype="number" and sid="cid" the value combination means 123456 for this one idoc
2. rtype="number" and sid="cid" the value combination means 789456 for this one idoc
--> the below file shows with out sid="cid"
<lineitem>
<student sid="abc">456</student>
<hreference>
<reference rtype="number">123</reference>
.........
</hreference>
<hreference>
<reference rtype="number">789</reference>
</hreference>
<hreference>
<reference rtype="number">147</reference>
</hreference>
in this case we have to consider only rtype="number" so here we need to create 3 idocs.
Could anyone help me in this regard.
Thanks in advance
Hi,
take XSD of IDoc change occurrence of IDoc segment to 1 to unbounded and import it as External definition and use it in message mapping.
write mapping logic to IDoc segment, try with different ways. this can be achieve easily.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First Change the IDOC occurence i.e. 0...Unbounded. Import into External Definition. you can use External Definiton only Message Mapping.
Operation Mapping you can use the Imported IDOC.
logic
if(rtype == number) && (sid == cid)
then
concat(rtype, sid) --> remove Context
Regards,
Naga.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you look your mapping logic in different angle then you don't need to bother about "cid". Basically the dependency of creating IDOC is when rtype="number". So apply the logic something like this..
IF (rtype = number) THEN (reference -RemoveContext-Sort-SplitByValue( On Value Change )-CollapseContext---IDOC)
Note: Before this you have to create the IDOC xsd with unbounded occurrence to generate multiple IDOCs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Swathip,
Change the occurence of the IDoc to "unbounded", so that multiple IDocs can get create
Try with below logic
If (SID = "CID")
Then
If(rtype = "number")
concat(student,reference ) ---> removeContext ---> Idoc
Else
rtype ---> removeContext ---> Idoc
If combination of unique student and reference can occur more than once in the XML, use sort command and splitByValue (Value Change)
Edited by: chandra shekhar on Jul 3, 2011 12:53 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
do ur mapping as mentioned below:
reference(change its context to lineItem) ---
-
Concat--sort-splitbyvalue (Each Value)--collapse context-Idoc
Student -
Refer this:
https://wiki.sdn.sap.com/wiki/display/XI/File%20to%20Multiple%20IDOC%20Splitting%20without%20BPM
thanks
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.