Skip to Content
0

Mapping element to node and make it repeat

Oct 31, 2017 at 09:38 PM

56

avatar image

hello,

I have to map from IDOC to xsd schema.

I have repeating segment in IDOC and I have repeating field in target structure (ReferenceID).

I have been told to map the repeating segment as well as other fields in the idoc to this repeating field.

Also I need to map the field value to the node and field name to the type attribute as shown.

I have done that but the idoc segments are not repeating in the target side.

Should I try node functions like SplitbyValue?

I have not mapped the repeat segment name , in this case, ZZCHARACTERISTICS 0...9999 to any node in the target structure. how will the target get all the values of this repeating segment ?

mapping.jpg (235.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Mark Dihiansan Nov 02, 2017 at 07:22 AM
0

Hi,

Just use removeContext for ZCHAR. Something like this:

Test

Regards,

Mark


map.png (15.9 kB)
test.png (13.9 kB)
Show 1 Share
10 |10000 characters needed characters left characters exceeded

worked like charm ! thanks!

1
Raghuraman S Nov 01, 2017 at 07:46 AM
0

Can you provide a sample XML and expected output.

Share
10 |10000 characters needed characters left characters exceeded
Bhakti joshi Nov 01, 2017 at 05:51 PM
0

IDOC INPUT-----------------

<?xml version="1.0" encoding="UTF-8"?>
<ZCREMAS05>
<IDOC BEGIN="">
<EDI_DC40 SEGMENT="">
</EDI_DC40>
<E1LFA1M SEGMENT="">
<MSGFN>a</MSGFN>
<LIFNR>a</LIFNR>
<ANRED/>
<BAHNS/>
<BBBNR/>
<BBSNR/>
<BEGRU/>
<LAND1>a</LAND1>
<LNRZA/>
<LOEVM>a</LOEVM>
<NAME1>a</NAME1>
<NAME2>a</NAME2>
<NAME3>a</NAME3>
<NAME4>a</NAME4>
<ORT01>a</ORT01>
<ORT02/>
<PFACH/>
<PSTL2/>
<PSTLZ>a</PSTLZ>
<REGIO/>
<SORTL/>
<SPERR/>
<ZZCHARACTERISTICS SEGMENT="">
<ZCLASS/>
<ZCHAR>1.1</ZCHAR>
<ZVALUE>1.2</ZVALUE>
<ZDESCRIPTION/>
</ZZCHARACTERISTICS>
<ZZCHARACTERISTICS SEGMENT="">
<ZCLASS/>
<ZCHAR>2.1</ZCHAR>
<ZVALUE>2.2</ZVALUE>
<ZDESCRIPTION/>
</ZZCHARACTERISTICS>
</E1LFA1M>
</IDOC>
</ZCREMAS05>
Current Output -------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<ns0:PACCARSupplier xmlns:ns0="paccar.procure-to-pay.supplier-management.supplier.v1.0">
<ns0:ID>a</ns0:ID>
<ns0:VATID/>
<ns0:ReferenceID type="1.1">1.2</ns0:ReferenceID>
<ns0:ReferenceID type="PurchashingBlockInd">a</ns0:ReferenceID>
<ns0:ReferenceID type="SupplierName2">a</ns0:ReferenceID>
<ns0:ReferenceID type="SupplierName3">a</ns0:ReferenceID>
<ns0:ReferenceID type="SupplierName4">a</ns0:ReferenceID>
<ns0:ReferenceID type="DeletionFlag">a</ns0:ReferenceID>
<ns0:ReferenceID type="CreateChangeInd">a</ns0:ReferenceID>
<ns0:ReferenceID type="CurrencyCd"/>
<ns0:ReferenceID type="PaymentTerms"/>
<ns0:ReferenceID type="ContractDeliveryTerms"/>
<ns0:ReferenceID type="QualityApprvalInd"/>
<ns0:Name>a</ns0:Name>
<ns0:CoCNumber city="a">default</ns0:CoCNumber>
<ns0:Language>a</ns0:Language>
<ns0:WebSite>Website not available</ns0:WebSite>
</ns0:PACCARSupplier>
Requried Output ---------------------------------------------------------
second record of ZZCHARACTERISTICS Segment should be seen
-------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<ns0:PACCARSupplier xmlns:ns0="paccar.procure-to-pay.supplier-management.supplier.v1.0">
<ns0:ID>a</ns0:ID>
<ns0:VATID/>
<ns0:ReferenceID type="1.1">1.2</ns0:ReferenceID>
<ns0:ReferenceID type="2.1">2.2</ns0:ReferenceID>
<ns0:ReferenceID type="PurchashingBlockInd">a</ns0:ReferenceID>
<ns0:ReferenceID type="SupplierName2">a</ns0:ReferenceID>
<ns0:ReferenceID type="SupplierName3">a</ns0:ReferenceID>
<ns0:ReferenceID type="SupplierName4">a</ns0:ReferenceID>
<ns0:ReferenceID type="DeletionFlag">a</ns0:ReferenceID>
<ns0:ReferenceID type="CreateChangeInd">a</ns0:ReferenceID>
<ns0:ReferenceID type="CurrencyCd"/>
<ns0:ReferenceID type="PaymentTerms"/>
<ns0:ReferenceID type="ContractDeliveryTerms"/>
<ns0:ReferenceID type="QualityApprvalInd"/>
<ns0:Name>a</ns0:Name>
<ns0:CoCNumber city="a">default</ns0:CoCNumber>
<ns0:Language>a</ns0:Language>
<ns0:WebSite>Website not available</ns0:WebSite>
</ns0:PACCARSupplier>

Share
10 |10000 characters needed characters left characters exceeded