on 11-16-2017 7:52 AM
Hi Experts,
This is regarding File to IDoc[DEBMAS06] where the input structure is external message and need to create multiple IDocs based on occurences on number of occurrences of BusinessPartner node with Address type constant equals to "CA" and E1KNBKM segments should be created under proper IDoc with number of occurrences equal of Banking node which is occuring under BusinessPartner node. Pls find the attached input sample files.
1st input:multiplebnks.txt
2nd input:newfile1.txt
Here 1st input should create 2 IDocs with 2 E1KNBKM segment occurrences under 1st IDoc and 5 E1KNBKM segment occurrences under 2nd IDoc.
Kindly help.
Thanks,
Ramu.
Hi Ramu,
You can also use ifWithoutElse function to fulfill your requirement. The point is to change the context of the first parameter to an upper level, which is the same level as the second parameter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramu!
I consider XSL transformation to be the most suitable for your requirement.
Here is an example template:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:q1="http://www.abc.com/yellowpages/businesspartner/1_1"
exclude-result-prefixes="xs q1" version="1.0">
<xsl:template match="/">
<DEBMAS06>
<xsl:apply-templates select="/q1:SyncBusinessPartner/DataArea/BusinessPartner[InternationalVersion/Address/AddressType = 'CA']"/>
</DEBMAS06>
</xsl:template>
<xsl:template match="BusinessPartner">
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
</EDI_DC40>
<xsl:apply-templates select="./Banking"/>
</IDOC>
</xsl:template>
<xsl:template match="Banking">
<E1KNBKM SEGMENT="1">
</E1KNBKM>
</xsl:template>
</xsl:stylesheet>
For your first input result looks like:
<?xml version="1.0" encoding="utf-8"?>
<DEBMAS06>
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1"/>
<E1KNBKM SEGMENT="1"/>
</IDOC>
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1"/>
<E1KNBKM SEGMENT="1"/>
</IDOC>
</DEBMAS06>
I guess you could enhance this template furher to build desired IDoc structures.
Regards, Evgeniy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.