cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping

Former Member
0 Kudos

Hi,

I have situation where the sales order are coming in Text element. For eg.

1st text element (TDLINE) contains 80010416,80010217,80010318,80010519,80010620,0080010421

It would show in source  XML with Sales order in TDLine

<E1TXTP6 SEGMENT="1">

    <TDFORMAT>*</TDFORMAT>

<TDLINE>80010416,80010217,80010318,80010519,80010620,0080010421</TDLINE>

</E1TXTP6>


Next text element contains 0080010724,0080010425,0080010426,0080010427, it will come as in idoc

<E1TXTP6 SEGMENT="1">

      <TDFORMAT>*</TDFORMAT>

<TDLINE>0080010724,0080010425,0080010426,0080010427</TDLINE>

</E1TXTP6>

Like this there are 13 text elements and each text element will create a segment E1TXTP6 , with TDline containing  sales order no

In target, I would need this to map to segment E1EDL20 where each sales order should create one segment of E1EDL20.

In above case, if i have 13 Text elements & each contains 5 sales order, on target i should have 65 E1EDL20 with each contains sales order info

Also there are 2 fields in the E1EDL20. Field VBELN would be the actual sales order no and fields XBLAN would be the first sales order of the TDLINE.

So for 1st TDLine, the E1EDL20-VBELN will be 80010416 and XBLAN would be 80010416

In next segment, E1EDL20-VBELN will be 80010217 but XBLAN would be 80010416 ( First Sales order of TDLINE)

Both the segment ( E1EDL20 & E1TXTP6 ) are at same level

I am thinking of way to do this mapping & looking for help on this..Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

you can handle with udf ( queue) - split the text values by comma and store it as a result list and use node function split by value..

Former Member
0 Kudos

Thanks for reply. Can you elaborate more on UDF and its functionality.

Former Member
0 Kudos

you can refer the below thread -

for your requirement you can start with the following code.

public void fnSplit(String[] pText, ResultList result, Container container) throws StreamTransformationException{

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

  String b[] = pText[a].split(",");

  if ( b != null ) {

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

  result.addValue(b[i].trim());

    }

}else{

   result.addSuppress();

}

}

}

Former Member
0 Kudos

Thanks for the mail & sorry for my little knowledge on UDF. I am looking for scenarios where the i have to split each value from TDline ( contains value for e.g 80010416,80010217,80010318,80010519,80010620,0080010421)

From this create a node for each Sales order on target. I worked on the code above but due to little knowledge of UDF could not figure it out.. If Ram or anyone else can add more help, it will appreciated



Former Member
0 Kudos

did you try created the user defined fn in messge mapping?

you need to just pass the TDline as input parameter to the udf.

you can go through the below blogs for creating udf..

User Defined Function&amp;#39;s Part 1 - Process Integration - SCN Wiki

Former Member
0 Kudos

Thanks Ram. I Did this

TDline->UDF->RemoveContext->SplitByValue->VBELN

So let's say in TDLine has value as 80010416,80010217,80010318,80010519,80010620,80010421

The end result in VBELN is only giving first value 80010416.

Also VBELN comes under E1EDL20. So i am looking for E1EDL20 to repeat for as many times as values in TD line ( in our case 6 time) and each VBLEN  should contains the value. of SO (80010416)

Currently i am getting only one segment of E1EL20 with VBELN containing 80010416

Appreciate your help on this!

Former Member
0 Kudos

Try this

TDline->UDF->RemoveContext->VBELN

Former Member
0 Kudos

Hi,

I tried this and it is only creating one segment.. Can you advice how to create multiple segment of E1EDL20 for each sales order. I guess once that is created, VBLEN would work as well. Thanks!

Former Member
0 Kudos

can you share some screenshots to analyze further.. make sure E1EDL20 is unbounded.

Former Member
0 Kudos

Please find the screen shot..Also E1ELD20 is unbounded..

I am looking each TDline value to create  as much as E1EDL20 segment.. Also each TDLine would create VBELN.

Thanks!

Former Member
0 Kudos

E1EDL20

TDline->UDF->RemoveContext->E1EDL20


VBELN

TDline->UDF->RemoveContext->Splitbyvalue> VBELN

Former Member
0 Kudos

you can close this thread, it its answered!

Answers (0)