on 2024 Dec 11 7:47 AM
Extract and store the KUNN2 value from the segment hierarchy E1KNA1M-E1KNVVM-E1KNVPM of the RawDEBMas IDoc into a custom string field in Hybris named (payerID). The mapping should occur conditionally, only when the value of PARVW in the same E1KNVPM segment is equal to 'RE'.
We have asked a detailed question and also attempted to resolve the issue on StackOverflow: https://stackoverflow.com/questions/79231159/hybris-datahub-filter-rawdebmas-idoc-value
Request clarification before answering.
I also answered your question on Stack Overflow. I will copy my answer here in case someone finds your question on this platform and wants to learn the answer:
If your TargetItem only updates the desired field on the B2BUnit, you can achieve your goal by using <filterExpression> attribute on your TargetItem. Your updated TargetItem definition should be as follows:
<item>
<type>CanonicalPartyReB2BUnit</type>
<exportCode>B2BUnit</exportCode>
<description>Update payerId</description>
<canonicalItemSource>CanonicalPartyRelationshipSales</canonicalItemSource>
<updatable>true</updatable>
<filterExpression>'RE'.equals(relationshipTypeCP)</filterExpression>
<attributes>
<attribute>
<name>uid</name>
<transformationExpression>resolve('CanonicalParty').externalPartyId.concat('_').concat(salesKey)</transformationExpression>
<exportCode>uid[unique=true]</exportCode>
<mandatoryInHeader>true</mandatoryInHeader>
</attribute>
<attribute>
<name>payerId</name>
<transformationExpression>businessCustomerNumber</transformationExpression>
<exportCode>payerId</exportCode>
</attribute>
</attributes>
</item>
The following part ensures that this item is published only when the condition is met.
<filterExpression>'RE'.equals(relationshipTypeCP)</filterExpression>
For more details, refer to the following SAP documentation:
Filtering Canonical Items with SpEL Before Publication
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.