cancel
Showing results for 
Search instead for 
Did you mean: 

Idoc to file -- Records based on the segment repitition. Urgent..Pls.!!

Former Member
0 Kudos

Hi Experts,

Iam doing a Idoc to file scenario.

Based on the sales organization(VKORG),i need to create the multiple records in the file.

For example :

E1MARAM 0..Unbounded

|

|E1MARMM 0..Unbounded

|

E1MARMM

|

E1MARMM

|

E1MARMM

|

E1MVKEM 0..Unbounded

|

E1MVKEM

When E1MVKEM-VKORG = Z200 then i need to create a file with 4 records (for 4 E1MARMM segments 4 records will be created)

When one more E1MVKEM-VKORG = Z201 present then we need to create 4 more records for Z201 in the same file.

So now i will be getting a single file with 8 records.

Each E1MVKEM segment will be having only one VKORG value.

I tried with <b>oneasmany</b> function,but its creating only for VKORG=Z200 with 4 values but its not providing the values for VKORG=Z201.

Please suggest me what to do.. I need to write UDF's or can i achieve without using them.??

PS: we are not using BPM in our scenario.

Thank You.

Regards

Seema.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

DONE

Former Member
0 Kudos

Try this mapping , and create the global variable

String vkorgs;

VKORG(source file) -


> removeContexts ->UDFSplitby4s-> UDFStore -


> E1MARMM

Make UDFSplitby4s a UDF function with the cache as Queue

In the function use this code:

for(int i=0;i<a.length;i++)

{

for(int j=0;j<4;j++)

{

result.addValue(a<i>);

}

}

Now make a UDFStore function with cache as Value

In this function use this code:

vkorgs = a;

return a;

Now make a UDFRetreive function with cache as Value and no arguments

In this function use this code:

return vkorgs;

This last fuction is what you will use to map to anywhere you want the VKORG value to go.

award points if you like this...

prabhu_s2
Active Contributor
0 Kudos

ur strucutre is confusing. can u be clear on ur requirement.

Former Member
0 Kudos

Hi Prabhu,

I need to display the records in the file for each sales organisation (MVKEM-VKORG) .

MARAM is the parent node and MARMM,MVKEM are child nodes.

MARAM

MARMM

MARMM

MARMM

MVKEM

MVKEM

Consider that first MVKEM has VKORG = Z200 then 3 records has to display in file (for 3 MARMM segments 3 records has to display)

Simillarly consider second MVKEM has VKORG = Z201 then 3 more records has to display in file. ( same as above for 3 MARMM segments = 3 records in file)

So for the above structure i will be getting a total of 6 Records in my output file.

Iam trying with different Node functions but it is taking only for first VKORG and not taking the second one.so iam getting only 3 records in my file.

Please help me in cracking this.

Regards

Seema.