Skip to Content
author's profile photo Former Member
Former Member

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

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Aug 07, 2007 at 01:48 PM

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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Aug 07, 2007 at 01:53 PM

    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...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 02:04 AM

    DONE

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.