on 12-08-2014 8:03 PM
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!
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..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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();
}
}
}
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
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&#39;s Part 1 - Process Integration - SCN Wiki
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!
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.