Skip to Content

This short blog shall give a little help for decision-making if you have to use an IDOC to IDOC mapping with a segment called E1BPPAREX on target side. The source can also be a flat file or any other format with the target IDOC and the segments E1BPPAREX.

To handle this we have several possibilities and this blog will have a look to three of them, developed in a project from different developers for the same requirement (this was consolidated afterwards ;-)). It will also show the experience in the aspect of maintenance and customer usability.

The following possibilities will be shown:

  • JAVA with standard message mapping
  • standard message mappings which in some cases will become confusing or an
  • extended modified standard IDOC as an intermediate format with standard message mapping

to map several fields from several source IDOC segments into the IDOC segment E1BPPAREX and a arbitrary kind of flat table structure e.g. a MARA, VBAP….

The using of the segment E1BPPAREX in general is simple and allows you to use a lot of different fields in a table of the target system without modification of the standard IDOC structure themselves. Unfortunately this simple using of the segment can have quite a big impact on the message mapping, the solution and test.

The reason for this is the using of the five fields in the PAREX segment. The field STRUCTURE is used to tell the input program which structure will be follow in the fields VALUEPART1… VALUEPART4.

So e.g. the target IDOC or better the inbound function module for that IDOC needs to use the structure:

image

That would mean in that example you have to fill the PAREX segment as following:

    STRUCTURE = BAPE_VBAK
    VALUEPART1 = 1234567890 67889lösaj abcdefg

The content of the field VALUEPART1 has to be a string with a maximal length of 240 characters. If your target table structure has more than 240 character you need to split the source into two, three or four rows. Important is that all fields or better characters have to be occurring in the target even if they are not available in the source because the function module which read this content is character based. That means if one field is missing the function module would read the wrong data because following values then would stay on the wrong position.

E.g. YYVDOC_TYPE = 1111, YYVSENVKORG = 2222 and YYVBUKRS = 3333

The concatenate normaly would look like 111122223333 and the inbound function module would read DOC_TYPE = 1111, VKORG = 2222 and BUKRS = 3333.
If e.g. the VKORG would not have any value the concat would deliver the following: 11113333. This would give the inbound module the wrong result.

1. general Task:

You have to map e.g. up to 25 or more fields from IDOC: e.g.

    YORGOM.OILORD02.YILORD03

into one field of IDOC: e.g

    YSALESORDER_CREATEFROMDAT2.YGOM_SALESORDER.YGOM_SALESORDER

image

2. Challenge:

  • the fields have to be in sequence like the structure is in the SAP-ERP system
  • Fields have to have a fix length that means:
    • If not available on source side we have to fill in spaces
    • If available but not with the right length we have to fill up the fields with spaces

image

3. Message Mapping

3.1. possibility 1 – JAVA coding with standard message mapping

For the JAVA solution a program was developed and deployed. As second JAVA piece was a Customer Function in the message mapping themselves which was using the imported class.

image

As you can see also this makes the graphical message mapping not really small.

image
detail view of graphical mapping

3.2. possibility 2 – use only standard message mapping

• Use only the standard mapping tool off IB combined with a small user function if a standard function is not available

image

• As you can see the graphical mapping becomes really large and it is not nice to handle in all aspects like changes and erreor handling.

image
detail view of graphical mapping

3.3. possibility 3 – standard message mapping with extended IDOC structure

As a pre step export the IDOC as XML and add the structure of the needed target table e.g. BAPE_VBAK to the IDOC

image

Afterwards import the modified IDOC into the IB “External Definitions”

image

  • First mapping step:
    • Map the source fields into the necessary fields of the added structure>. This will be like a 1:1 mapping with may be some needed rules.

    image

  • Second mapping step
    • Do a second mapping (1:1) from “External Definitions” to target IDOC for all fields except the fields for the extended structure.

    image

    Use a smal customer function to concatenate all fields of the structure and map them to the target field image

    4. pro and contra of different solutions

    4.1. Solution one = JAVA with standard message mapping :

    • Pro:
      • looks more comfortable than version two
    • Contra:
      • JAVA knowledge for developing is necessary
      • JAVA knowledge for maintenance is necessary
      • developing of classes outside XI
      • no standard possibility for debugging to find errors (using of ‘display queue’ for debugging not possible)

    4.2.Solution two = use only standard message mapping :

    • Pro:
      • only standard functionality is used
      • no JAVA knowledge for maintenance is necessary
      • use ‘display queue’ for debugging
    • Contra:
      • difficult to handle
      • to huge to see the whole mapping
      • takes quite a long time to build
      • not nice for maintenance

    4.3. Solution three = standard with extended structure of IDOC:

    • Pro:
      • only standard functionality is used
      • no JAVA knowledge for maintenance is necessary
      • Can use ‘display queue’ for debugging
      • Second step can be used like a canonical for any other source format if the target is the same.
      • Easy to handle
    • Contra:
      • Modification of message for interim step
      • Two step mapping

    5. performance comparison (only option two and three)

    two-step mapping

    one-step mapping with complex MM

    small ca. 10k

    Duration: ca. 2.3 sec

    small ca. 10k

    Duration: ca. 1.3 sec

    medium ca. 100k

    Duration: ca. 2.35 sec

    Medium ca. 100k

    Duration: ca. 2.16 sec

    large – greater than 100k

    Duration: ca. 6.5 sec

    large- greater than 100k

    Duration: ca. 5.8 sec

    To report this post you need to login first.

    5 Comments

    You must be Logged on to comment or reply to a post.

    1. Amit Kumar Singh
      Hi Ulf,

      Blog u have written is really nice from the perspective of project but what do you really mean when u say One Step process or two Step process?
      These terms have you used with respect to the blog above or these are generic ?

      Regards

      (0) 
      1. Ulf Kretzschmar Post author
        The one step mapping and two step mapping means that you have to call in the Interface Mapping for the one step mapping only one message mapping and when I write two step mapping I mean you have to call two message mappings in a sequence so this is more a generic term from my point of view.

        Regards

        (0) 
    2. Jegatheeswaran Pitchaimuthu
      Hi Ulf,

      I have 2 doubts.

      First doubt
      ———–

      The purpose of export the IDoc as XML in external definition and use this as Interim Step is not clear to me.

      Because you concatenated again all fields and mapped to target structure in the Second Step as you did in other 2 methods. Then’s what’s the purpose of introducing Canonical Mapping

      Second doubt
      ————

      We can handle this complicated mapping  thru XSLT/ ABAP XSLT is little bit easy. Speed also will be fast when compare to the above.

      Could you kindly clarify the above …?

      (0) 
      1. Ulf Kretzschmar Post author
        to  ‘First doubt’:
        In general yes, you have to do the concatenation in all of the three possibilities.

        But please have a look to the focus of that blog. This is under the focus that customer has no JAVA resources and / or the project rules do not allow you to use it.
        But it is also visible that the debugging in solution three is much easier and faster then in the other two possibilities. May be this will only be visible if you have more then 15 or 20 fields but then you will see it.
        May be for only 5 fields it would not make sense.

        to  ‘Second doubt’:
        I never said that there are no better ways / possibilities. I only described three possible ways because this was a project and to use XSLT was only recommended or allowed if al other things would not work. Also to use JAVA was an option which was not on the first position.

        regards Ulf

        (0) 
    3. Mark Eijpe

      Hello,                                         <xsl:value-of select=”format-number((position()10),’00000′)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns9:AmountType, ‘  ‘),1,2)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns1:TariffCode, ‘          ‘),1,10)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns1:TariffDescription, ‘                                   ‘),1,35)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns1:ItemReference, ‘              ‘),1,14)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns1:Note, ‘          ‘),1,10)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns1:OriginRailwayLocationRU, ‘            ‘),1,12)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns1:OriginRailwayLocationStation, ‘     ‘),1,5)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns1:OriginRailwayLocationName, ‘                                                  ‘),1,50)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns1:DestinationRailwayLocationRU, ‘            ‘),1,12)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns1:DestinationRailwayLocationStation, ‘     ‘),1,5)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns1:DestinationRailwayLocationName, ‘                                                  ‘),1,50)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns1:ValidityStartDate, ‘        ‘),1,8)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns1:TravelClassCode, ‘   ‘),1,3)”/><br/>                                                    <xsl:value-of select=”substring(concat(ns1:Description, ‘                                                                      ‘),1,50)”/><br/>                                             </VALUEPART1><br/>                                             </E1BPPAREX><br/>                                             <E1BPPAREX SEGMENT=”1″><br/>                                      <STRUCTURE><br/>                                          <xsl:value-of select=”‘BAPE_VBAPX'”/><br/>                                    </STRUCTURE><br/>                                      <VALUEPART1><br/>                                          <xsl:value-of select=”concat(‘          ‘,format-number((position()10),’00000′),’ XXXXXXXXXXXXXXX’)”/><br/>                                      </VALUEPART1><br/>                                  </E1BPPAREX><br/><br/>Regards,<br/>Mark

      (0) 

    Leave a Reply