cancel
Showing results for 
Search instead for 
Did you mean: 

context problem during mapping.

Former Member
0 Kudos

I have to map header details with item details.

in header one segment has 3 records.

when i am using splitbyvalue with removecontext, the 3 records are coming only in first item details. other item details are blank.

How to solve it ? please help.

Regards,

Study SAP

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I hope you are getting the result of mapping like this:

<node>

<Item1>

< abc>

< abc2>

<abc3>

<Item2>

<Item3>

<Item4>

But your expectation is some thing like this:

<node>

<Item1>

< abc>

< abc2>

<abc3>

<Item2>

< abc>

< abc2>

<abc3>

<Item3>

< abc>

< abc2>

<abc3>

<Item4>

< abc>

< abc2>

<abc3>

If this is your requirement then use Explicit Context Selection.

This is done by selecting the graphical mapping editor,select the particular node then change the context to Header level by right clicking the node then change context

Hop this helps you.

Best Regards

Praveen

Former Member
0 Kudos

Hi,

Thanks for your reply,

I have already worked on context change, but it is not effective in this case.

Still I am facing the same problem,

Regarding the UDF, I have no idea, how to create a UDF for this problem, what will be structure for this and how we can handle that.

Regards,

Study SAP

Former Member
0 Kudos

Hi,

Check this Presentation, hope this atleast serve your purpose:

[Advance Graphical mapping|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/b9af5e71-0701-0010-d0b8-f612fb6593dd]

Context handling presentations:

[Context Handling |https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8e6d433a-0b01-0010-1093-ff0dc0b38810]

Be patience with the presentation it might be bit slow.

Best Regards

Praveen

Former Member
0 Kudos

Hi,

Please follow teh steps to create the UDF.There will be no structures..it will be based on input parameters.

Take the sample steps as below,

Thanks

Swarup

Former Member
0 Kudos

hi,

splitbyvalue can create target node equal to the minimum Occurrence of the target node.

i dont get ur problen exactly.

here if u r controlling the occurrence of the target header node with the attribute from sourceattribute than u need to map the target header node using remove cotext and split by value from source attribute.

if you mapped this than can u try with the collapscontext to break the item in diffrent context...

regards

navneet

Former Member
0 Kudos

hi,

can you paste the source n target structure here ?

Former Member
0 Kudos

Sender Payload is :

<?xml version="1.0" encoding="UTF-8" ?>

<X12>

<ISA>

<ISA01>00</ISA01>

<ISA02 />

<ISA03>00</ISA03>

<ISA04 />

<ISA05>08</ISA05>

<ISA06>8493</ISA06>

<ISA07>12</ISA07>

<ISA08>434343</ISA08>

<ISA09>071030</ISA09>

<ISA10>2145</ISA10>

<ISA11>U</ISA11>

<ISA12>00400</ISA12>

<ISA13>100001802</ISA13>

<ISA14>0</ISA14>

<ISA15>P</ISA15>

<ISA16>></ISA16>

</ISA>

<GS>

<GS01>PO</GS01>

<GS02>4343</GS02>

<GS03>24343</GS03>

<GS04>20071030</GS04>

<GS05>2145</GS05>

<GS06>243438</GS06>

<GS07>X</GS07>

<GS08>004030</GS08>

</GS>

<TS_850>

<ST>

<ST01>850</ST01>

<ST02>300091763</ST02>

</ST>

<BEG>

<BEG01>00</BEG01>

<BEG02>SA</BEG02>

<BEG03>64821185</BEG03>

<BEG04 />

<BEG05>20071030</BEG05>

<BEG06>100000485002</BEG06>

</BEG>

<REF>

<REF01>DP</REF01>

<REF02>832</REF02>

<REF03>W</REF03>

</REF>

<REF>

<REF01>IA</REF01>

<REF03>119800</REF03>

</REF>

<CSH>

<CSH01>P4</CSH01>

</CSH>

<ITD>

<ITD01>14</ITD01>

<ITD02 />

<ITD04 />

<ITD05>5</ITD05>

<ITD06 />

<ITD09 />

<ITD12>NET 45</ITD12>

</ITD>

<DTM>

<DTM01>010</DTM01>

<DTM02>20071031</DTM02>

</DTM>

<DTM>

<DTM01>001</DTM01>

<DTM02>20071107</DTM02>

</DTM>

<TD5>

<TD505>FOLLOW TRAFFIC DIVISION</TD505>

</TD5>

<TD5>

<TD505>SHIPPING INSTRUCTIONS</TD505>

</TD5>

<GROUP_6>

<N1>

<N101>SF</N101>

<N102>D</N102>

</N1>

<N4>

<N401>D</N401>

<N402>J</N402>

<N403>43</N403>

</N4>

</GROUP_6>

<GROUP_8>

<GROUP_9>

<N1>

<N101>Z7</N101>

<N102 />

<N103>92</N103>

<N104>14811</N104>

</N1>

</GROUP_9>

<GROUP_9>

<N1>

<N101>BT</N101>

<N102 />

<N103>92</N103>

<N104>94508</N104>

</N1>

</GROUP_9>

<GROUP_9>

<N1>

<N101>ST</N101>

<N102 />

<N103>92</N103>

<N104>94508</N104>

</N1>

</GROUP_9>

</GROUP_8>

<GROUP_11 />

<GROUP_12>

<PO1>

<PO101 />

<PO102>2</PO102>

<PO103>AS</PO103>

<PO104>103.8</PO104>

<PO105>WH</PO105>

<PO106>IN</PO106>

<PO107>10090110</PO107>

<PO108>ON</PO108>

<PO109>F</PO109>

<PO110>08</PO110>

<PO111>3434234</PO111>

</PO1>

<GROUP_14>

<PID>

<PID01>F</PID01>

<PID02>75</PID02>

<PID03>VI</PID03>

<PID04 />

<PID05>CLWHT</PID05>

</PID>

</GROUP_14>

</GROUP_12>

<GROUP_12>

<PO1>

<PO101 />

<PO102>2</PO102>

<PO103>AS</PO103>

<PO104>103.8</PO104>

<PO105>WH</PO105>

<PO106>IN</PO106>

<PO107>10090219</PO107>

<PO108>ON</PO108>

<PO109>F</PO109>

<PO110>08</PO110>

<PO111>43423342</PO111>

</PO1>

<GROUP_14>

<PID>

<PID01>F</PID01>

<PID02>75</PID02>

<PID03>VI</PID03>

<PID04 />

<PID05>WH*BL</PID05>

</PID>

</GROUP_14>

</GROUP_12>

<GROUP_12>

<PO1>

<PO101 />

<PO102>1</PO102>

<PO103>AS</PO103>

<PO104>103.8</PO104>

<PO105>WH</PO105>

<PO106>IN</PO106>

<PO107>10090318</PO107>

<PO108>ON</PO108>

<PO109>F</PO109>

<PO110>08</PO110>

<PO111>4342424</PO111>

</PO1>

<GROUP_14>

<PID>

<PID01>F</PID01>

<PID02>75</PID02>

<PID03>VI</PID03>

<PID04 />

<PID05>BL*WH</PID05>

</PID>

</GROUP_14>

</GROUP_12>

<GROUP_31>

<CTT>

<CTT01>4</CTT01>

</CTT>

</GROUP_31>

<SE>

<SE01>29</SE01>

<SE02>300091763</SE02>

</SE>

</TS_850>

</X12>

Receiver Payload is :

<?xml version="1.0" encoding="UTF-8"?>

<ZZ_-AFS_-ORDERS05><IDOC BEGIN="1"><E1EDK01 SEGMENT="1"><ACTION></ACTION><BSART>SA</BSART>

<BELNR>64821185</BELNR>

<ABLAD></ABLAD>

<VSART_BEZ>20071030</VSART_BEZ>

<AUGRU_BEZ>100000485002</AUGRU_BEZ>

<ZJCP_ISA SEGMENT="1">

<AUTH_INFO_QUALIF>00</AUTH_INFO_QUALIF>

<AUTHORIZATION_INFORMATION>

</AUTHORIZATION_INFORMATION>

<SECU_INFO_QUALIF>00</SECU_INFO_QUALIF>

<SECURITY_INFORMATION></SECURITY_INFORMATION>

<INTERCHANGE_ID_QUALIF_DUNS>08</INTERCHANGE_ID_QUALIF_DUNS>

<INTERCHANGE_SENDER_ID>6111350003</INTERCHANGE_SENDER_ID>

<INTERCHANGE_ID_QUALIF_UCC>12</INTERCHANGE_ID_QUALIF_UCC>

<INTERCHANGE_RECEIVER_ID>2126438989</INTERCHANGE_RECEIVER_ID>

<INTERCHANGE_DATE>071030</INTERCHANGE_DATE>

<INTERCHANGE_TIME>2145</INTERCHANGE_TIME>

<REPETITION_SEPARATOR>U</REPETITION_SEPARATOR>

<INTERCH_CTRL_VER_NO>00400</INTERCH_CTRL_VER_NO>

<INTERCHANGE_CTRL_NO>100001802</INTERCHANGE_CTRL_NO>

<ACKNOWLEDGMENT_REQUESTED>0</ACKNOWLEDGMENT_REQUESTED>

<USAGE_INDICATOR>P</USAGE_INDICATOR>

<COMPONENT_ELEMENT_SEP>&gt;</COMPONENT_ELEMENT_SEP>

</ZJCP_ISA><ZJCP_REF SEGMENT="1">

<REF01>DP</REF01><REF02>832</REF02><REF03>WOMENS APPAREL</REF03></ZJCP_REF><ZJCP_REF SEGMENT="2"><REF01>IA</REF01><REF03>119800</REF03></ZJCP_REF>

<E1J3P01 SEGMENT="1">

<E1EDPA1 SEGMENT="1">

<PARVW>JM</PARVW>

</E1EDPA1>

<E1EDPA1 SEGMENT="2">

<PARVW>RE</PARVW

></E1EDPA1>

<E1EDPA1 SEGMENT="3">

<PARVW>WE</PARVW>

</E1EDPA1>

</E1J3P01><E1J3P01 SEGMENT="2">

</E1J3P01>

<E1J3P01 SEGMENT="3">

</E1J3P01>

</IDOC></ZZ_-AFS_-ORDERS05>

we need to map value of N1 (all the 3 values) Segment with E1EDPA1 segment, it should come in all the item segments (E1J3PO1).

But it is coming only in first item segment (E1J3PO1).

This is the problem.

Regards,

Study SAP

Former Member
0 Kudos

Hi,

Make sure that you have mapped the E1J3PO1 according to <N1> as below

Here the Root Node of N1 are different i.e. Group_6, Group_7, Group_8 which treat it as seperate nodes. So even if you play with Context change it will not work.

You need to pass all the N1 values as below

(Group_6) N1 --->

(Group_7) N1 ---> TestUDF -


> E1J3PO1

(Group_8) N1 --->

(Group_9) N1 --->

Add below code in UDF

Cache parameter = queue & input of N1 will be as a,b,c,d,......

for(int i = 0; a.length>i;i++){

result.addValue(a[0]);

result.addContextChange();

}

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

result.addValue(b[0]);

result.addContextChange();

}

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

result.addValue(b[0]);

result.addContextChange();

}

//and so on ...for all input fields so all N1 will be under single queue.

Thanks

Swarup