cancel
Showing results for 
Search instead for 
Did you mean: 

IDoc to file. Grouping and generation of files based on condition

Former Member
0 Kudos

Hi All,

I am working on a scenario, Idoc to File. I need to create number of files based on occurrence of a field(vendor) in the idoc. Also the condition is to group by the field(vendor) and create as many files as the number of groups formed.

For e.g.: In an Idoc if there are ten items present and 3 vendors who are supplying it. <b>The vendor and items can repeat in any order within the same idoc. </b>

I need to group the items by the vendors and create a file separately for each vendor. Like :

-


Item Vendor

-


Item1 V1

Item2 V1

Item3 V2

Item4 V2

Item5 V2

Item6 V2

Item1 V2

Item2 V2

Item3 V3

Item6 V3

-


What we have to achieve is, to group by the vendors irrespective of the order of the items or number of reoccurrence of the items. As you see, the Item1 is supplied by both V1 and V2. I need to generate 3 files as follows:

V1.xml with Item1 and Item2 details.

V2.xml with Item3, Item4, Item5, Item6, Item1 Item2 details.

V3.xml with Item3 and Item6 details.

Can someone please help me with achieving this without using BPM?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

See this Discussion

Regards

Giri

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Shashi,

For this scenario you have to use multimaping without BPM using this blog.

/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

And while doing your message mapping you have to use <b>removeContext</b> & <b>SplitByValue</b> (double clike the on splitbyvalue and select <b>value changed</b>) function. This function you have to use with the node in which your Vendor is coming. Example:

if required to sort the vendor, then first sort the vendor in the below mapping.

Vendor (NODE) -


> removeContext -


> SplitByValue (value Changed) -


> IDOC.

By doing this your vendor will be grouped and you will get new IDOC on change of Vendor.

Regards,

Sarvesh

Former Member
0 Kudos

Thanks for the replies.

I am able to split the messages based on the vendors. I used a user defined function to group the items.

I have one problem, For naming those files I have to use dynamic configuration(requirement). I understand that dynamic configuration is possible for only one target msg. But in this case we are not sure about the number of messages in the target(depends on values in IDOC). So I need to loop through the target messages and use dynamic configuration individually. Can I not use BPM fr only looping purpose. Or is there any other turn around. Please help in acheiving this..

Former Member
0 Kudos

<br>

Item Vendor<br>

-


<br>

Item1 V1<br>

Item2 V1<br>

Item3 V2<br>

Item4 V2<br>

Item5 V2<br>

Item6 V2<br>

Item1 V2<br>

Item2 V2<br>

Item3 V3<br>

Item3 V3<br>