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

Mapping - a curious scenario?

Hi,

I have an intresting scenario where in my input message looks like this.....2 customer master data.

Customer

SoldTo1

BillTo1

BillTo2

Customer

SoldTo2

BillTo3

BillTo4

ShipTo1

I would want to create a single idoc Debmdm06 structure with the segment E1KNA1M for each SoldToBillToShipTo.

How can i achieve this in graphical mapping ? any suggestions?

so hence as in above input, there will 7 E1KNA1Ms.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2008 at 02:50 AM

    Hi BRamchan,

    If you have source message structure as

    Customer 1...unbounded

    --SoldTo 0...unbounded

    --BillTo 0...unbounded

    --ShipTo 0...unbounded

    and want to create E1KNAM segment as sum of (SoldTo+ BillTo + ShipTo) times use the following Context UDF code

    public void RepeatSegment(String[] a,String[] b,String[] c,ResultList result,Container container)

    {

    int cnt;

    cnt = a.length;

    cnt = cnt + b.length;

    cnt = cnt + c.length;

    for(int k = 0;k<cnt ; k++)

    result.addValue(" ");

    }

    This UDF takes 3 inputs i.e SoldTo,BillTo, ShipTo.

    after each of these 3 inputs use removeContexts node function,the output from this node function map as UDF input.

    Please let me know if your requirement is different from what i assumed.

    Cheers,

    Jag

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi BRamchan,

      I have created 2 UDFs to map DLR-NBR(from SOLDTO node) and NAME elements from Source structure to KUNNR and NAME1 elements in target strcture.

      1. Map DLR-NBR to KUNNR :-

      Create Context UDF with 3 arguments

      Code as follows

      int cnt = b.length + c.length;

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

      {

      result.addValue(a[k]);

      for(int m=0;m< cnt;m++)

      result.addValue(ResultList.CC);

      }

      3 Inputs to UDF:

      1st Argument is DLR-NBR element which is under SOLDTO node in source

      2nd Argument is NAME element which is under BILLTO node in source(Change Context to CUSTOMER )

      3rd Argument is NAME element which is under SHIPTO node in source(Change Context to CUSTOMER )

      2.Map NAME to NAME1

      Create Context UDF with 3 arguments

      Code as follows

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

      result.addValue(a[k]);

      for(int k=0;k<b.length;k++)

      result.addValue(b[k]);

      for(int k=0;k<c.length;k++)

      result.addValue(c[k]);

      Note:- use SplitByValue node function between UDF and NAME1 field

      3 Inputs to UDF:

      1st Argument is NAME element which is under SOLDTO node in source( Change Context to CUSTOMER )

      2nd Argument is NAME element which is under BILLTO node in source(Change Context to CUSTOMER )

      3rd Argument is NAME element which is under SHIPTO node in source(Change Context to CUSTOMER )

      Note:-Change Context to CUSTOMER

      To do this context change just right click on source element in Data flow editor Context->CUSTOMER

      Please let me know if you are have any issues with this logic.

      Cheers,

      Jag

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2008 at 10:32 PM

    Hi BRamchan,

    In the target structure on the idoc right click on E1KNA1M and select duplicate tree. Do this seven times so that seven segments will be created. Now you map each segment to one segment from the source.

    You can use exists and createif combination for this target segments to create or not to create. Once the segment is created map the filed what ever your business is expecting.

    Regards,

    ---Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 22, 2008 at 04:44 AM

    Hi Can you write the target structure for the source message that you provided in your first post so it would be easy to interprete it well...

    Regards.

    Jeet.

    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.