on 01-08-2010 9:30 PM
I have an Invoice idoc contains line item and identifier changes into groups, let's say A & B
Using Message Mapping, Will i be able to Split into 2 IDOCs and combine A into one IDOC and B into Another IDOC and send it across to ECC with out using BPM?
Btw the header is commom for both the IDOCs
Source
<Header>
<headertext>headername</headertext>
<lineItem>
<item1>A</item1>
<item2>B</item2>
<item3>A</item3>
<item3>B</item4>
</item>
</lineitem>
</header>
Target
IDOC 1
<Header>
<headertext>headername</headertext>
<lineItem>
<item1>A</item1>
<item2>A</item2>
</item>
</lineitem>
</header>
IDOC 2
<Header>
<headertext>headername</headertext>
<lineItem>
<item1>B</item1>
<item2>B</item2>
</item>
</lineitem>
</header>
Any inputs are appreciated
you are doing a 1:N mapping.
you can avoid BPM only if you are creating N IDoc of the same type. If you have to create IDocs of multiple types then you will have to use BPM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> It is of same type IDOC, just creating one more with different action indicator by grouping into one for each
in that case;
use the above trick along with the logic proposed by sarvesh in your mapping
Like i mentioned above, the split is complete. As i am getting only one message with Number of Line items, the split suppose to happen at the Mapping level. I added external definition to accommodate multiple idocs as well.
Based on ActionIndiator at the lineitem, i have to create 2 or more idocs, please look at the source payload.
Will i be able to Split into 2 IDOCs
Yes if both the IDOCs are the same....you will have to perform [IDOC Bundling|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2762] [original link is broken] [original link is broken] [original link is broken]; apart from the mapping logic given by Sarvesh.
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I actually gave wrong information on the source structure, I am trying to execute scenario with the given examples, meanwhile any help is appreciated
<Header>
<Date>20100112</Date>
<Amount>10</Amount>
<No>20</No>
</Header>
<InvoiceItem>
<Line1>10</Line1>
<Line2>10</Line2>
<Amount>10</Amount>
<ActionIndicator>I</ActionIndicator>
</InvoiceItem>
<InvoiceItem>
<Line1>20</Line1>
<Line2>20</Line2>
<Amount>20</Amount>
<ActionIndicator>C</ActionIndicator>
</InvoiceItem>
<InvoiceItem>
<Line1>30</Line1>
<Line2>30</Line2>
<Amount>30</Amount>
<ActionIndicator>I</ActionIndicator>
</InvoiceItem>
<InvoiceItem>
<Line1>40</Line1>
<Line2>40</Line2>
<Amount>40</Amount>
<ActionIndicator>C</ActionIndicator>
</InvoiceItem>
Target 1
<Header>
<Date>20100112</Date>
<Amount>10</Amount>
<tNo>20</No>
<ActionIndicator>I</ActionIndicator>
</Header>
<InvoiceItem>
<Line1>10</Line1>
<Line2>10</Line2>
<Amount>10</Amount>
</InvoiceItem>
<InvoiceItem>
<Line1>30</Line1>
<Line2>30</Line2>
<Amount>30</Amount>
</InvoiceItem>
Target 2
<Header>
<Date>20100112</Date>
<Amount>10</Amount>
<tNo>20</No>
<ActionIndicator>I</ActionIndicator>
</Header>
<InvoiceItem>
<Line1>20</Line1>
<Line2>20</Line2>
<Amount>20</Amount>
</InvoiceItem>
<InvoiceItem>
<Line1>40</Line1>
<Line2>40</Line2>
<Amount>40</Amount>
</InvoiceItem>
I know the part of Splitting IDOC, which was executing correctly, with the external data type changes. Please advice
Hi,
As per my understanding you do your mapping like this...
item --->RemoveContext-->Sort-->SplitByValue(on value change)--->CollapseContext--->IDOC
So by doing above mapping it will generate N number of IDOCS for different items. e.g. in your case ite will generate 2 IDOCs.
item --->RemoveContext-->Sort-->SplitByValue(on value change)--->LineItem
above mapping should generate 2 lineItems in first IDOC & 2 in second IDOC.
item --->RemoveContext-->Sort-->SplitByValue(each value)---> Item
above mapping will map A,A in first IDOC item1 & item2. Simlarly B,B in second IDOC.
For Header you do the mapping like this...
Source headertext--->CopyValue(0)--->Target headertext.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> But still have other values to be mapped with exact context with out changes.
Then simply don't use the SORT function while doing mapping at item level.
item1 ->SplitByValue(each value)-> Item1 (if items already have a context change then no need of SplitByValue or set it the context accordingly.)
item2 ->SplitByValue(each value)-> Item2
item3 ->SplitByValue(each value)-> Item3 and so on...
All values must go automatically into corresponding IDOCs.
Regards,
Sarvesh
Action Indiccator > RemoveContext >
SortByKey > SplitByValue (Each Value) > Item
Itemtext > RemoveContext >
The above example helped me getting values and splitting idocs into 2 based on Action Indicator
At the root level, i used the following
ActionIndicator > sort > splitbyvalue (Value Chnage) > Field
Thanks for your help
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.