I am creating an 850 to ORDERS Idoc message mapping in SAP PO. In the data and the mapping, it is possible to have two N2 segments and two N3 segments. How do you reference the first N301 element vs. the second N301 element?
Input xml structure for the 850 is like this:
S_N2
D_93
D_93_2
S_N3
D_166
D_166_2
So my question is: how do I reference the first occurrence of D_93 or D_166 vs. the second occurrence of it?
Depending on which address elements exist, I need to map to different fields in the Idoc.
Sample N1-N4 section:
<L_N1>
<S_N1>
<D_98>ST</D_98>
<D_93>CUSTOMER NAME</D_93>
<D_66>ZZ</D_66>
<D_67>CODE</D_67>
</S_N1>
<S_N3>
<D_166>FIRST N301 ADDRESS LINE</D_166>
<D_166_2>FIRST N302 ADDRESS LINE</D_166_2>
</S_N3>
<S_N3>
<D_166>SECOND N301 LINE</D_166>
<D_166_2>SECOND N302 LINE</D_166_2>
</S_N3.
<S_N4>
<D_19>CITYNAME</D_19>
<D_156>STATE</D_156>
<D_116>ZIPCODE</D_166>
<D_26>COUNTRY</D_26>
</S_N4>
</L_N1>
Thank you very much for your assistance.
Linda