on 03-04-2016 5:19 PM
Refer the blog http://scn.sap.com/docs/DOC-61626
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the udf based on that example but not getting as expected E1EDl37 created correctly but E1EDl44 . for ( int i = 0;i< pono_in.length; i++ ) { if ( i == 0 ) { e1edpl37.addValue(""); aLicenseno_out.addValue( aLicenseno_in[i]); e1edpl44.addValue(""); } if ( i > 0 && ( aPkgId_in[i] != (aPkgId_in[i-1] ) ) ) { e1edpl37.addValue(""); aLicenseno_out.addValue( aLicenseno_in[i]); } if ( i > 0 && ( pono_in[i] != pono_in[i-1] || blno_in[i] != blno_in[i-1] || slno_in[i] != slno_in[i-1] ) ) e1edpl44.addValue(""); }
expected target structure
<E1EDL37 SEGMENT="1">
<EXIDV>ABCD1</EXIDV>
<E1EDL44 SEGMENT="1">
<POSNR>1</POSNR>
<E1EDL46 SEGMENT="1">
<SERNR>1</SERNR>
</E1EDL46>
<E1EDL46 SEGMENT="1">
<SERNR>2</SERNR>
</E1EDL46>
</E1EDL44>
</E1EDL37>
<E1EDL37 SEGMENT="1">
<EXIDV>ABCD2</EXIDV>
<E1EDL44 SEGMENT="1">
<POSNR>3</POSNR>
<E1EDL46 SEGMENT="1">
<SERNR>6</SERNR>
</E1EDL46>
</E1EDL44>
</E1EDL37>
But I am getting two E1EDl44 under first E1EDL37 .
ok, so the last XML was indeed well formed.
So your desired target is:
<E1EDL37 SEGMENT="1">
<EXIDV>ABCD1</EXIDV>
<E1EDL44 SEGMENT="1">
<POSNR>1</POSNR>
<E1EDL46 SEGMENT="1">
<SERNR>1</SERNR>
</E1EDL46>
<E1EDL46 SEGMENT="1">
<SERNR>2</SERNR>
</E1EDL46>
</E1EDL44>
</E1EDL37>
<E1EDL37 SEGMENT="1">
<EXIDV>ABCD2</EXIDV>
<E1EDL44 SEGMENT="1">
<POSNR>3</POSNR>
<E1EDL46 SEGMENT="1">
<SERNR>6</SERNR>
</E1EDL46>
</E1EDL44>
</E1EDL37>
But you you're getting this:
<E1EDL37 SEGMENT="1">
<EXIDV>ABCD1</EXIDV>
<E1EDL44 SEGMENT="1">
<POSNR>1</POSNR>
<E1EDL46 SEGMENT="1">
<SERNR>1</SERNR>
</E1EDL46>
<E1EDL46 SEGMENT="1">
<SERNR>2</SERNR>
</E1EDL46>
</E1EDL44>
<E1EDL44 SEGMENT="1">
<POSNR>3</POSNR>
<E1EDL46 SEGMENT="1">
<SERNR>6</SERNR>
</E1EDL46>
</E1EDL44>
</E1EDL37>
<E1EDL37 SEGMENT="1">
<EXIDV>ABCD2</EXIDV>
</E1EDL37>
Now, please answer / do the following:
1. Is above assumption correct? If not, poste corrected versions of "desired target" and "actual target".
2. Please now give us again the example input again, using the advanced editor and "plain text" syntax highlighting (click in "insert") like so
This is a Syntax highlighting for plain text.This should not wrap around.
Cheers
Jens
Thanks for looking into it .yes. That is the expected format. How do we get the advanced tab editor
<xs:Item>
<xs:ItemDetail>
<<xs1:Sellerno>1</<xs1:sellerno>
<xs:Pkgdtls>
<xs:PkgID>6</ns0:PkgID>
<xs:Licenseno>ABCD</ns0:Licenseno>
<xs:Srlno>A1</ns0:srlno>
</ns0:Pkgdtls>
</xs0:ItemDetail>
</xs0:Item>
<xs:Item>
<xs:ItemDetail>
<<xs1:Sellerno>2</<xs1:sellerno>
xs:Pkgdtls>
<xs:PkgID>6</ns0:PkgID>
<xs:Srlno>A2</ns0:srlno>
<xs:Licenseno>ABCD</ns0:Licenseno>
</ns0:Pkgdtls>
</ns0:ItemDetail>
</xs0:Item>
<xs:Item>
<xs:ItemDetail>
<<xs1:Sellerno>3</<xs1:sellerno>
<xs:Pkgdtls>
<xs:PkgID>7</ns0:PkgID>
<xs:Srlno>A3</ns0:srlno>
<xs:Licenseno>ABCD1</ns0:Licenseno>
</xs0:Pkgdtls>
</xs0:ItemDetail>
</xs0:Item>
1. You can open advanced editor on the right upper side (link in blue font color) of the input area.
2. The xml in your the last post... Is that the original input?
3. That last xml is not well formed. See http://www.w3schools.com/xml/xml_validator.asp Especially the line "<<xs1:Sellerno>1</<xs1:sellerno>"... seems wrong. Also there are numerous namespace conflicts. Please provide a well formed example.
Cheers
Here is sample data <10 <1 12345 6 Serial ABCD1 A1 <10 <2 12345 6 A2 ABCD1 <10 ❤️ 12345 7 ABCD2 A3 Target ZDELVRY05 E1EDP20 E1EDL37 ABCD1 E1EDL44 Sellerno1 E1EDL44 Sellerno2 E1EDL46 SrlnoA1 E1EDL46 SrlnoA2 E1EDL37 ABCD2 E1EDL44 Sellerno3 E1EDL46 SrlnoA3 If the pkgid changes it should create new E1EDL37. Under that E1edl44 .For each unique sellerno/buyerno/pono one E1EDl44 Under one E1EDl44 multiple E1EDl46 with srlnos Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, but unfortunatelly it's a little hard to follow.
Please provide...
Thx
Cheers
Jens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
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.