Skip to Content
0
Former Member
Dec 12, 2011 at 03:38 PM

PI 7.11: IDoc Message mapping

59 Views

Hi there,

I'm currently working on a graphical message mapping using IDoc HRMD_A06 as source structure (HR master data transferred via PFAL).

In my result structure I have to fill a field CostCenter with the following logic:

If field KOSTL (cost center) is filled in node E1P0315, map this field to CostCenter in result structure, otherwise take KOSTL of node E1P0001.

The end date (ENDDA) has to be '99991231' in each case.

This is how the result structure looks like:

<e>                       [1...1]
  <CostCenter>            [1...1]
</e>

This is the simplified source structure:

<E1PLOGI SEGMENT="1">
  <E1PITYP SEGMENT="1">                        [0...n]
     <E1P0001 SEGMENT="1">                     [0...n]
       <INFTY>0001</INFTY>                     [0...1]
       <ENDDA>99991231</ENDDA>                 [0...1]
       <KOSTL>0000012345</KOSTL>               [0...1]
    </E1P0001>
  </E1PITYP>
  <E1PITYP SEGMENT="1">                        [0...n]
    <E1P0315 SEGMENT="1">                      [0...n]
      <INFTY>0315</INFTY>                      [0...1]
      <ENDDA>99991231</ENDDA>                  [0...1]
      <KOSTL>0000024001</KOSTL>                [0...1]
    </E1P0315>
  </E1PITYP>
</E1PLOGI>

How can I do the check if field KOSTL of node E1P0315 is null?

I've tried an existence check for the whole node (E1P0315->exists), but then it fails, because all E1PITYP nodes are processed.

I hope my problem is clear to you.

Would it be better to use another mapping type?

As I'm an ABAP developer, I would of course prefer some lines of code to this graphical drag&drop thing.

Thanks in advance!