cancel
Showing results for 
Search instead for 
Did you mean: 

Is this can only be done through Java mapping?

Former Member
0 Kudos

Hi Friends,

my scenario is jdbc to idoc.

Am able to create multiple idocs basing upon delivery_date. But here my requirement is -- there are qty, slnumber, vaxinum are having different values. And all these should also be generated in the same Idoc.

INPUT
delivery_date         ------      qty   -------- slnumber        -------- vaxinum 

19/02/2006            ------  10      ----------   457854        --------- 10001
19/02/2006            ------  20      ----------   457855        --------- 10001
19/02/2006            ------  30      ----------   457854        --------- 10001
19/02/2004            ------  20      ----------   457854        --------- 10001
19/02/2004            ------  20      ----------   457854        --------- 10001
19/02/2005            ------  20      ----------   457854        --------- 10001

OUTPUT

Three Idoc's to be created -- am able to create it basing upon delivery_date.
But for 19/02/2006 this Idoc number there are different qty and different slnumber. So, I want to be created multiple segments in the same IDoc.

Thanks.

S.

Edited by: Swarna on Sep 21, 2011 1:29 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Swarna,

This can be done using normal graphical mapping.

You can use SplitByValue with Value Change parameter for creating IDoc

You can use useOneasmany function to map same header and different line items.

http://wiki.sdn.sap.com/wiki/display/XI/StandardFunctionsinPI7.0

http://wiki.sdn.sap.com/wiki/display/XI/MappingConceptsinSAPXI

Refer the above links

Regards

Ramesh

Answers (1)

Answers (1)

Former Member
0 Kudos

Yes you can do this with normal graphical mapping. Please provide expected target structure so that we can suggest mapping.

Regards,

Gouri

Former Member
0 Kudos

OUTPUT:

IDOCNUM 	delivery_date         ------      qty   -------- slnumber        -------- vaxinum 
 
000123		19/02/2006            ------  10      ----------   457854        --------- 10001
000123		19/02/2006            ------  20      ----------   457855        --------- 10001
000123		19/02/2006            ------  30      ----------   457854        --------- 10001
000124		19/02/2004            ------  20      ----------   457854        --------- 10001
000124		19/02/2004            ------  20      ----------   457854        --------- 10001
000125		19/02/2005            ------  20      ----------   457854        --------- 10001

above should be the output.

for 123 idoc number there are multiple dates, different qty's and different slnumber. So, I want for the same Idoc number multiple segments to be generated.
I hope my output requirement is clear.

Note: I am able to generate multiple idoc in gra mapping but not able to generate multiple segments, this is my problem.

Regards
S.

PriyankaAnagani
Active Contributor
0 Kudos

Hi Swarna,

Please try with the below logic.

DeliveryDate-->removecontext->sort->splitbyvaluechange->collapsecontext---IDOC

concatsortUDFSegment

coacat:

Input1-OutputofFormatByExample1sort

Input2-OutputofFormatByExample2sort

FormatByExample1:

input1:outputofsortbykey2

input2:DeliverNo-removecontext-sort--splitbyvaluechange

FormatByExample2:

input1:outputofsortbykey1

input2:DeliverNo-removecontext-sort--splitbyvaluechange

sortbykey1:

input1:DeliveryNo--removeContext

input2:SlNumber--removecontext

sortbykey2:

input1:DeliveryNo--removeContext

input2:qty--removecontext

*ExecutionType of UDF is all values of context*

public void UDF(String[] var1, ResultList result, Container container) throws StreamTransformationException{

ArrayList aList = new ArrayList();

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

if(aList.contains(var1<i>))

continue;

else{

aList.add(var1<i>);

result.addValue(var1<i>);

}

}

}

Thanks

Priyanka