Message Mapping IDoc-segment

Hello,
In my scenario I will do the following mapping with an source structure to an ORDERS05 Idoc:
file structure:
#E1EDP01|10|33|ST
#E1EDP20|33|20050823
inbound message:
<?xml version="1.0" encoding="utf-8" ?>
<ns:MT_ORDERS_OUT xmlns:ns="http:/ /ORDERS">
  <E1EDP01>
  <IDENTIFIER>#E1EDP01</IDENTIFIER>
  <POSEX>10</POSEX>
  <MENGE>33</MENGE>
  <MENEE>ST</MENEE>
  </E1EDP01>
  <E1EDP20>
  <IDENTIFIER>#E1EDP20</IDENTIFIER>
  <WMENG>33</WMENG>
  <EDATU>20050823</EDATU>
</E1EDP20>
</ns:MT_ORDERS_OUT>
MT_ORDERS_OUT    to      IDOC ORDERS05 :
E1EDP01     ___>     E1EDP01
POSEX   ____>           - POSEX
MENGE   ____>           - MENGE
MENEE   ____>           - MENEE
E1EDP20 ______>               E1EDP20
WMENG   ________>                  - WMENG
EDATU   _________>                  - EDATU
configuration of the file adapter:
recordsetstructure: E1EDP01,,E1EDP20,
keyfield:  IDENTIFIER
E1EDP01.keyFieldValue     = #E1EDP01
E1EDP01.endSeparator      = 'nl'
E1EDP01.fieldSeparator    = |
E1EDP01.fieldNames        = IDENTIFIER,POSEX,MENGE,MENEE
E1EDP20.keyFieldValue     = #E1EDP20
E1EDP20.endSeparator      = 'nl'
E1EDP20.fieldSeparator    = |
E1EDP20.fieldNames        = IDENTIFIER,WMENG,EDATU
With this configuration, the result is only a mapping of the E1EDP01 fields.
I can't see the E1EDP20 fields in the IDoc.
Did I  something wrong?
Regards
Christoph

Hello Shravan,
I guess my file adapter is not doing the correct conversion.
The payload of the inbound message must look as follow:
<E1EDP01>
<IDENTIFIER>#E1EDP01</IDENTIFIER>
<POSEX>10</POSEX>
<MENGE>33</MENGE>
<MENEE>ST</MENEE>
<E1EDP20>
<IDENTIFIER>#E1EDP20</IDENTIFIER>
<WMENG>33</WMENG>
<EDATU>20050823</EDATU>
</E1EDP20>
</E1EDP01>
my actuel payload looks like:
<E1EDP01>
<IDENTIFIER>#E1EDP01</IDENTIFIER>
<POSEX>10</POSEX>
<MENGE>33</MENGE>
<MENEE>ST</MENEE>
</E1EDP01>
<E1EDP20>
<IDENTIFIER>#E1EDP20</IDENTIFIER>
<WMENG>33</WMENG>
<EDATU>20050823</EDATU>
</E1EDP20>
Who can help me, with the conversion?
Christoph

Similar Messages

  • How to map idoc segment field E1IDB02-FIIKONTO with BSEG-ESRNR.

    Hi,
    I have searched for lot of threads in the forum , and also i tried myself but i am not able to map this fields segment with my logic, so please anyone kindly contribute in mapping idoc segment field  with the logic given below:
    idoc type :PAYEXT  outbound idoc.
    message type: PEXR2002
    This is my logic: i need to populate the ISR number(BSEG-ESRNR  ) in idoc segment field( E1IDB02-FIIKONTO)
    DATA : str1 TYPE string,
          len1  TYPE i,
          len2  TYPE i,
          str2  TYPE string,
          str3  TYPE string.
    str1 = '01-1234-4'. ---> BSEG-ESRNR  "ISR Subscriber Number
    REPLACE FIRST OCCURRENCE OF '-' IN str1 WITH '_'.
    REPLACE ALL OCCURRENCES OF  '-' IN str1 WITH space.
    CONDENSE str1.
    len1 = STRLEN( str1 ).
    IF len1 LT '9'.
    len2 = '9' - len1.
    CASE len2.
       WHEN '1'.
         REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '00'.
       WHEN '2'.
         REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '000'.
       WHEN '3'.
         REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '0000'.
       WHEN '4'.
         REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '000000'.
       WHEN OTHERS.
    ENDCASE.
    ELSEIF len1 EQ '9'.
    REPLACE ALL OCCURRENCES OF '_' IN str1 WITH '0'.
    ELSEIF len1 GT '9'.
    REPLACE ALL OCCURRENCES OF '_' IN str1 WITH space.
    CONDENSE str1.
    ENDIF.
    Thanks in Advance.

    Resolved.

  • Message Mapping - IDOC to http

    Hi ,
    I am creating Message mapping for IDOC to Http scenario.
    In which i have the following requirement. For a partner Role in segment E1BPDLVPARTNER we need to get the Address_No value
    and then with that we need to get the address from segment E1BPADR1
      <E1BPDLVPARTNER>
          <PARTN_ROLE>AG</PARTN_ROLE>
         <PARTNER_NO>0007745359</PARTNER_NO>
      </E1BPDLVPARTNER>
      <E1BPDLVPARTNER SEGMENT="1">
        <PARTNER_NO>0007745359</PARTNER_NO>
        <ADDRESS_NO>0000267775</ADDRESS_NO>
      </E1BPDLVPARTNER>
       <E1BPDLVPARTNER SEGMENT="1">
         <PARTNER_NO>0007759123</PARTNER_NO>
         <ADDRESS_NO>9000001048</ADDRESS_NO>
      </E1BPDLVPARTNER>
      <E1BPADR1 SEGMENT="1">
         <ADDR_NO>000075</ADDR_NO>
         <NAME>BRIDT HOSPITAL INC</NAME>
       </E1BPADR1>
       <E1BPADR1 SEGMENT="1">
         <ADDR_NO>00775</ADDR_NO>
          <NAME>BRIDGA</NAME>
       </E1BPADR1>
       <E1BPADR1 SEGMENT="1">
        <ADDR_NO>05</ADDR_NO>
        <NAME>BRIDL INC</NAME>
       </E1BPADR1>
    Can you provide inputs on this.
    Thanks,
    Vishal

    For the Address No 0007745359 in E1BPDLVPARTNER we need to go to the E1BPADR1 segment and get the address from
    it and populate the target. Also the data above is test one
    Me a bit confused about your requirement!
    In your structure Partner_Number is having the value 0007745359
    What i get is you have to check for PartnerNo in E1BPDLVPARTNER and if that value matches then go to E1BPADR1 segment and get the Address......but to go to a particular E1BPADR1 you need to check for some field within it.....
    Your mapping logic will be something like:
    PartNum/ AddrNum -->
                                  --->equalS --->
    Constant(0007745359)
                                                              ----> And ----> IfWithoutElse --->    Target
    Field_of_E1BPADR1 (validation logic) -->             Then(Field_of_E1BPADR1)
    Context of PartNum/ AddrNum to be raised and also that of Field_of_E1BPADR1 (the one on which validation is imposed.
    If possible get some more details from your technical lead on how to select the E1BPADR1 ...
    Regards,
    Abhishek.

  • How to map idoc segments to multiple output structures

    Dear experts,
    On Pi I need to map segments from an Idoc to 2 different outputstructures. My scenario is as follows:
    incoming Idoc on PI -> if segment eq 'X' then map to outputstructure '1'; if segment eq 'Y' then map to outputstructure '2'
    Idoc structure is as follows:
    - 1 header segment
    - 1..n detail segments (which I need to map to outputstructure 1)
    - 1 summarisation segment (which I need to map to outputstructure 2)
    Output needs to be a .txt file.
    I would like to use the graphical message mapping on PI, how can I map the Idoc to multiple output structures?
    Thanks in advance,
    William

    Hi
    You can do 1:n multimapping
    in message mapping in messages tab ..add both the structures in target tab and do the mapping
    and in operation mapping add both the message interface on the target side
    PLease go through this blog
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

  • How to map IDoc segment with qualifiers

    Hi everyone!
    I have the following problem: In an IDoc of type DESADV01 there can be several segments of type E2EDS01. Each segment has a different qualifier, which is the value of the field SUMID in this case. My target structure (type EDIFACT) now has several segments, each again with a sort of qualifier. Now I have to map the values of certain source segments to the respective target segments.
    Exaple (in XML format):
    Source
      <E1EDS01 SEGMENT="1">
        <SUMID>021</SUMID>
        <SUMME>0000000001.000</SUMME>
        <SUNIT>KGM</SUNIT>
      </E1EDS01>
      <E1EDS01 SEGMENT="1">
        <SUMID>022</SUMID>
        <SUMME>0000000001.000</SUMME>
        <SUNIT>KGM</SUNIT>
      </E1EDS01>
    Target
      <S_MEA>
        <C_C502>
          <D_6313>N</D_6313>
        </C_C502>
        <C_C174>
          <D_6411>KGM</D_6411>
          <D_6314>1</D_6314>
        </C_C174>
      </S_MEA>
      <S_MEA>
        <C_C502>
          <D_6313>G</D_6313>
        </C_C502>
        <C_C174>
          <D_6411>KGM</D_6411>
          <D_6314>1</D_6314>
        </C_C174>
      </S_MEA>
    (i have omitted several details here, but I'm only interested in the general procedure anyway).
    So in general the source segment with qualifier "021" should be mapped to a target structure with qualifier "N" etc.
    How can this be done using standard XI mapping techniques?
    Regards, Joerg

    Hi everyone!
    Thanks for your input data - unfortunately this wasn't quite what I was looking for. However I thik I solved my original problem and I just wanted to share this solution with you - maybe it helps others, maybe some of you have suggestions what I could do differently.
    To sum up the requirement: There can be multiple input segments, each with a certain qualifier. These input segments have to be mapped to the target segments, respectively - however, the qualifiers change. There can be several segments with qualifiers that do not match the requirement, and required segments might be missing.
    So here's what I came up with:
    Use the qualifier of the source segments as an input to a <b>FixValues</b> function. In this function, map the desired qualifiers to the value <b>true</b>, use <b>false</b> as the default value. Map the output of the <b>FixValues</b> function to a <b>createIf</b> function and use this to create the desired output segment. This way, for each of the required segments, one target segment will be created. All other segments (with unwanted qualifiers) will be removed.
    So far, this technique worked for me - do you have improvements/suggestions?
    Regards, Joerg

  • Leaving mapped idoc segments out of plain text output

    Hello all,
    I mapped a customer IDoc with one header and detail lines to a message maping with one header and detail lines. The value's in the header are used for variable substitution for the file name.
    The has to be writen as csv to a ftp server. I do this by using the file content conversion. Now I only want the detail lines to be written to the file so I only mensioned the detail line as the record set structure.
    When I look at the output the header is stil part of the csv file.
    Is there a way to prevent the header line being part of the output ? (of course without deleating it from the message type structure)
    Regards,
    Jasper

    check this link
    http://help.sap.com/saphelp_nw04/helpdata/en/1d/756b3c0d592c7fe10000000a11405a/frameset.htm
    Try Using the following
    Customer.addHeaderLine = 0
    Customer is the structure here.
    Reward if helpful.
    Sachin

  • Reg:Mapping  (IDOc Segment)

    Hi Guys,
    In my mapping has many segmants at sender but i need to map one field from one segment to one target filed thats fine if ,but i want to map same fields from all segments to target field.
    please give me solution
    Thanks

    In my mapping has many segmants at sender but i need to map one field from one segment to
    one target filed thats fine if ,but i want to map same fields from all segments to target field.
    If your Target Field is 0..unbounded then you can duplicate the target node and then map each node to each of the source node
    If your target node is 0...unbounded and you dont know how many times the source node is going to repeat then just directly map the source node to target...so that target will repeat as many time as the source repeats....
    If your Target node is 0..1...then make sure that the parent node containing this node is repeating....map the source node to the parent node and also to the target node.....you will need to increase the Context of the source node in this case....when you map it to the parent node...
    Regards,
    Abhishek.

  • IDOC in Message mapping

    Hi folks,
    I am working on file to idoc scenario.   I Imported the IDOC to my scenario. In Messaga Mapping IDOC structure displaying fields as a documention. but i need techincal names of those fields.
    for Example:   In my IDOC 1 field is showing companycode but I want to see that field as a BUKRS.
    How to see the technical names of IDOC fields in Message Mapping.
    Your help is highly appreciated.
    Thanks,
    Anitha.

    Hi bavesh...
    thank you so much for very your quick responses..
    i got xsd as source..based on xsd i created external definition for source xsd  and  i created outbound interface based on source external deifinition <b>MI_OUT_WearUnits</b>.
    and i imported Idoc and exported as xsd and changed occurance to unbounded and again imported as external definition.
    i did mapping between these two external definitions.
    and i selected standard idoc for source and target interface for interface mapping  and given message mapping of previous step.
    In ID
    sender agreement :
                    sender service :BS_external
                    sender interface :<b>MI_OUT_WearUnits</b>
    receiver agreement:
                  receiver service :R/3
                  receiver interface :  standard Idoc
    Interface determination:
    sender service :BS_external
    sender interface :<b>MI_OUT_WearUnits</b>
    reciever service :R/3
    and clicked create
    inbound interface : Standard IDOc
    i am not getting Interface mapping which i created in IR.
    i tried Enhance interface determination also..
    please guide me....
    waiting for your help.
    regards
    ram

  • Need help on message mapping screen

    Hi folks,
    I am working on file to idoc scenario.   I Imported the IDOC to my scenario. In Messaga Mapping IDOC structure displaying fields as a documention. but i need techincal names of those fields.
    for Example:   In my IDOC 1 field is showing companycode but I want to see that field as a BUKRS.
    How to see the technical names of IDOC fields in Message Mapping.
    Your help is highly apprecia

    Hi,
    I dont think we would be able to see the data element names of the IDOC in XI. Even the imported XSD of Idoc doesnot contain data element name.
    We would be only dealing with the field names/ structure of the IDOC for field message mappings. The field names are internally mapped to the data element names in SAP R3 system.
    To view the internal mapping between field names and data element names of the Idoc fields, you can go to the transaction 'WE30'. Give the basic type of the Idoc and go to the segment editor. You can find the data element names for each field name  there.
    Thank you.
    Regards,
    Subbu

  • Inbound idocs segment fields

    Hi,
    Iam new to idocs and a functional consultant. I need to know whenever we receive the inbound idocs and if i see the segments of the inbound idoc, do the fields which i see in the segments are the sap fields.????/ for instance if the inbound idoc needs to create a sales order, then the fields of the segments of such an inbound idoc are the normal sap sales order fields ??
    do i need to give functional specs to the abapers that whenever the inbound idocs is received the segments fields need to be mapped to sales order fields if such an idoc needs to create a sales order ??
    regards
    sachin

    Hi Sachin,
    Most of the IDoc segment fields are simmilar to SAP transaction fields e.g. most of the ORDERS IDoc segment fields will be simmilar to what you can see in VA01/VA02 screen fields.
    Some fields may have different names.
    In the case of few segments which may repeate in IDoc with different qualifiers (such as partner details, date segments), fields will be same but different qualifier value decides where these field values will be populated in the Order.
    If you are using standard function module to create Order, it will take care of mapping IDoc segment fields to VA01/VA02 screen fields. But if it is a Z function module, then you need to specify the mapping.
    Hope this information will help you.
    Regards,
    Mahesh Pakhale

  • IDOC Segment not getitng populated during message mapping

    Hi,
    In my scenario when i am testing, I send IDOC to XI and getting following message
    <Trace level="1" type="T">com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation: Cannot produce target element /ns0:I805_Abstr_CustOutlet_MT/Records/AMA_E1KNA1M_STATUS.
    When I checked th IDOC xsd, it doesn't show the segment  which mapped to above status field.
    Can anyone of you please let me know what it is and how it can be resolved.
    Regards
    Edited by: ria sen on Jun 30, 2008 5:15 AM

    Hi Amit,
    Following is the payload from SXMB_MONI
    <?xml version="1.0" encoding="UTF-8" ?>
    - <_-AMA_-DEBMAS06E11>
    - <IDOC BEGIN="1">
    - <EDI_DC40 SEGMENT="1">
      <TABNAM>EDI_DC40</TABNAM>
      <MANDT>110</MANDT>
      <DOCNUM>0000000000415387</DOCNUM>
      <DOCREL>700</DOCREL>
      <STATUS>30</STATUS>
      <DIRECT>1</DIRECT>
      <OUTMOD>2</OUTMOD>
      <IDOCTYP>DEBMAS06</IDOCTYP>
      <CIMTYP>/AMA/DEBMAS06E11</CIMTYP>
      <MESTYP>/AMA/DEBMAS</MESTYP>
      <STDMES>/AMA/D</STDMES>
      <SNDPOR>SAPDAR</SNDPOR>
      <SNDPRT>LS</SNDPRT>
      <SNDPRN>DARCLNT110</SNDPRN>
      <RCVPOR>DAX_001</RCVPOR>
      <RCVPRT>LS</RCVPRT>
      <RCVPRN>CCABASIS</RCVPRN>
      <CREDAT>20080630</CREDAT>
      <CRETIM>133535</CRETIM>
      <SERIAL>20080627162157</SERIAL>
      </EDI_DC40>
    - <E1KNA1M SEGMENT="1">
      <MSGFN>018</MSGFN>
      <KUNNR>0001231235</KUNNR>
      <BBBNR>0000000</BBBNR>
      <BBSNR>00000</BBSNR>
      <BUBKZ>0</BUBKZ>
      <KTOKD>S</KTOKD>
      <KUKLA>S</KUKLA>
      <LAND1>AU</LAND1>
      <NAME1>Drew Smith again</NAME1>
      <ORT01>Ashfield</ORT01>
      <PSTLZ>2193</PSTLZ>
      <REGIO>NSW</REGIO>
      <SORTL>DREW</SORTL>
      <SPRAS>E</SPRAS>
      <STRAS>29 Hardy Street</STRAS>
      <UMJAH>0000</UMJAH>
      <JMZAH>000000</JMZAH>
      <JMJAH>0000</JMJAH>
      <UMSA1>0</UMSA1>
      <HZUOR>00</HZUOR>
      <SPRAS_ISO>EN</SPRAS_ISO>
    - <_-AMA_-E1KNA1M SEGMENT="1">
      <_-AMA_-REF_KUNNR>200</_-AMA_-REF_KUNNR>
      </_-AMA_-E1KNA1M>
    - <_-SCL_-E1ADRMAS SEGMENT="1">
      <QUALF>ADRMAS02</QUALF>
      <OBJ_TYPE>KNA1</OBJ_TYPE>
      <OBJ_ID>0001231235</OBJ_ID>
      <CONTEXT>0001</CONTEXT>
      <IV_CHECK_ADDRESS>X</IV_CHECK_ADDRESS>
      <IV_TIME_DEPENDENT_COMM_DATA>X</IV_TIME_DEPENDENT_COMM_DATA>
    - <_-SCL_-E1BPAD1VL SEGMENT="1">
      <FROM_DATE>00010101</FROM_DATE>
      <TO_DATE>99991231</TO_DATE>
      <NAME>Drew Smith again</NAME>
      <CITY>Ashfield</CITY>
      <POSTL_COD1>2193</POSTL_COD1>
      <STREET>29 Hardy Street</STREET>
      <COUNTRY>AU</COUNTRY>
      <COUNTRYISO>AU</COUNTRYISO>
      <LANGU>E</LANGU>
      <LANGU_ISO>EN</LANGU_ISO>
      <REGION>NSW</REGION>
      <SORT1>DREW</SORT1>
      <TIME_ZONE>AUSNSW</TIME_ZONE>
    - <_-SCL_-E1BPAD1VL1 SEGMENT="1">
      <LANGU_CR>E</LANGU_CR>
      <LANGUCRISO>EN</LANGUCRISO>
      <ADDR_GROUP>BP</ADDR_GROUP>
      <COUNTRY>AU</COUNTRY>
      <COUNTRYISO>AU</COUNTRYISO>
      <REGION>NSW</REGION>
      <TIME_ZONE>AUSNSW</TIME_ZONE>
      </_-SCL_-E1BPAD1VL1>
      </_-SCL_-E1BPAD1VL>
      </_-SCL_-E1ADRMAS>
      <_-SCL_-DSD_FIELDS SEGMENT="1" />
      <_-SCL_-E1KNA1M SEGMENT="1" />
      <E1KNA11 SEGMENT="1" />
    - <E1KNVVM SEGMENT="1">
      <MSGFN>018</MSGFN>
      <VKORG>AU01</VKORG>
      <VTWEG>Z2</VTWEG>
      <SPART>Z0</SPART>
      <KALKS>1</KALKS>
      <BZIRK>AU4</BZIRK>
      <PLTYP>02</PLTYP>
      <AWAHR>100</AWAHR>
      <ANTLF>9</ANTLF>
      <LPRIO>00</LPRIO>
      <PERFK>AU</PERFK>
      <PERRL>AU</PERRL>
      <WAERS>AUD</WAERS>
      <KTGRD>01</KTGRD>
      <ZTERM>Z060</ZTERM>
      <VWERK>1005</VWERK>
      <VKBUR>A4TT</VKBUR>
      <BOKRE>X</BOKRE>
      <UEBTO>0.0</UEBTO>
      <UNTTO>0.0</UNTTO>
      <PODTG>0</PODTG>
    - <_-SCL_-E1KNVVM SEGMENT="1">
      <_-SCL_-CU_KZREG>000000</_-SCL_-CU_KZREG>
      <_-SCL_-CU_KZPLP>000000</_-SCL_-CU_KZPLP>
      <_-SCL_-CU_FBDWE>0000</_-SCL_-CU_FBDWE>
      <_-SCL_-CU_VBDG1>0000</_-SCL_-CU_VBDG1>
      <_-SCL_-CU_VBDG2>0000</_-SCL_-CU_VBDG2>
      <_-SCL_-CU_VBDG3>0000</_-SCL_-CU_VBDG3>
      <_-SCL_-CU_FEDWE>0000</_-SCL_-CU_FEDWE>
      <_-SCL_-CU_VEDG1>0000</_-SCL_-CU_VEDG1>
      <_-SCL_-CU_VEDG2>0000</_-SCL_-CU_VEDG2>
      <_-SCL_-CU_VEDG3>0000</_-SCL_-CU_VEDG3>
      <_-SCL_-CU_MTPST>0000000000</_-SCL_-CU_MTPST>
      <_-SCL_-CU_MXHUB>0000000000</_-SCL_-CU_MXHUB>
      <_-SCL_-CU_SORTR>0</_-SCL_-CU_SORTR>
      <_-SCL_-PO_ZFHMG>0.000</_-SCL_-PO_ZFHMG>
      <_-SCL_-PO_MXSTH>0</_-SCL_-PO_MXSTH>
      <_-SCL_-PO_TWPLUS>000000</_-SCL_-PO_TWPLUS>
      <_-SCL_-GC_LONGITUD>0.000000000000</_-SCL_-GC_LONGITUD>
      <_-SCL_-GC_LATITUDE>0.000000000000</_-SCL_-GC_LATITUDE>
      <_-SCL_-GC_REFID>0000000000</_-SCL_-GC_REFID>
      </_-SCL_-E1KNVVM>
    - <E1KNVPM SEGMENT="1">
      <MSGFN>009</MSGFN>
      <PARVW>YM</PARVW>
      <KUNN2>0001231235</KUNN2>
      <KNREF>00000038</KNREF>
      <PARZA>0</PARZA>
      </E1KNVPM>
    - <E1KNVPM SEGMENT="1">
      <MSGFN>009</MSGFN>
      <PARVW>RE</PARVW>
      <KUNN2>0001231235</KUNN2>
      <PARZA>0</PARZA>
      </E1KNVPM>
    - <E1KNVPM SEGMENT="1">
      <MSGFN>009</MSGFN>
      <PARVW>RG</PARVW>
      <KUNN2>0001231235</KUNN2>
      <PARZA>0</PARZA>
      </E1KNVPM>
    - <E1KNVPM SEGMENT="1">
      <MSGFN>009</MSGFN>
      <PARVW>WE</PARVW>
      <KUNN2>0001231235</KUNN2>
      <PARZA>0</PARZA>
      </E1KNVPM>
      </E1KNVVM>
      </E1KNA1M>
      </IDOC>
      </_-AMA_-DEBMAS06E11>

  • PI 7.11: IDoc Message mapping

    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!

    Cheers, guys!
    I did it now like that:
    http://www.abload.de/image.php?img=mappingflknz.jpg
    Click on the image to enlarge it!
    The logic is as following (ABAP Pseudo-code ):
    IF 0315_KOSTL and 0315_ENDDA are populated.
      IF 0315_ENDDA equals '99991231'.
        map 0315_KOSTL to Cost_Center.
      ENDIF.
    ELSE.
      IF 0001_KOSTL and 0001_ENDDA are populated.
        IF 0001_ENDDA equals '99991231'.
          map 0001_KOSTL to Cost_Center.
        ENDIF.
      ENDIF.
    ENDIF.
    Is that a good way to do that mapping?
    Do I also have to use the removeContexts function or is it ok like that?
    Could I also do that with an ABAP mapping program?
    Thanks in advance!

  • Message mapping challenge in IDOC to EDI scenario

    Dear PI message mapping experts,
    I'm a newbie in PI and facing a mapping problem using graphical message mapping.
    I'm in an IDOC (INVOIC.INVOICE02) to FILE (EDI) scenario.
    Here after is the mapping i need to perform :
    Source structure IDOC :
    <E1EDKA1> (0..99)
       <NAME1> A </NAME1>  (0..1)
       <NAME2> B </NAME2>  (0..1)
       <NAME3> C </NAME3>  (0..1)
       <NAME4> D </NAME4>  (0..1)
    </E1EDKA1>
    Target structure :
    <AccountingCustomerParty>  (1..1)
       <Party> (0..1)
          <PartyName> (0..unbounded)
              <Name>A</Name> (1..1)
          </PartyName>
          <PartyName>
              <Name>B</Name>
          </PartyName>
          <PartyName>
              <Name>C</Name>
          </PartyName>
          <PartyName>
              <Name>D</Name>
          </PartyName>
       </Party>
    </AccountingCustomerParty>
    I know i have to play with context and queues with stanard function or UDF but cannot succeed to do it.
    Could you please help me ?
    Thanks in advance,
    Alysee

    One approach out of available few ways to implement this:
    NAME1 - Exists - CreateIf - PartyName[0]
    NAME2 - Exists - CreateIf - PartyName[1] (Create deuplicate segment)
    NAME3 - Exists - CreateIf - PartyName[2] (Create deuplicate segment)
    NAME4 - Exists - CreateIf - PartyName[3] (Create deuplicate segment)
    Srikanth Srinivasan

  • Mapping multi-segment IDOC to multiple JDBC INSERT statements

    Hi Everyone,
    This is probably going to be easy for the experienced PI developers out there but I'm just starting out in this technology. We are running PI 1.11 and the scenario is as follows. We have a bespoke IDOC message type ZSTOCK which can contain 1-many segments with the following field content:
    WERKS
    MATNR
    VBELN
    ACT_LABST
    AVL_LABST
    For each segment in the source IDOC, I want to generate an INSERT statement to insert a row in an SQL table via the JDBC adapter with the following columns:
    Plant
    Material
    SalesOrd
    ActStock
    AvlStock
    Basically, each field on the source IDOC segment maps directly onto the target column of the SQL table. The problem is, on a multi-segment IDOC only the first segment is generating a row in the SQL table. I've seen a number of threads on this forum that seem to tackle the same issue but the solution is either missing or unclear. I think the solution lies somwhere in the occurrences of the STATEMENT node in my target message type and perhaps specific definitions in the message mapping. Can anyone help solve this mystery?
    Thanks,
    Gary

    Hi Gary
    If you created a data type, try to change occurrence of STATEMENT node to 0..unbounded or 1..unbounded.
    In the message mapping, map the target STATEMENT node with the source 1-many segment.
    You can find [here|http://help.sap.com/saphelp_nw70/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/content.htm] more informations about the JDBC structure
    Regards,
    Giuseppe

  • Mapping of source message to IDOC.. What values should be assigned?

    Hi guys, again
    I have SOAP->XI->IDoc scenario, but my IDocs arrive only with 1 segment... The IDoc is not standard, and has a lot of fields, but I want to fill only a few of them in some segments. Lets say, that I have 4 segments, with occurence 0..999999, each value has occurence 0..1 like following..
    seg1-val1
        -val2
        -val3
    seg2-val1
        -val2
        -val3
    seg3-val1
        -val2
        -val3
    seg4-val1
        -val2
        -val3
    and I have source message like
    <seg1>
      <val1>..</val1
    </seg1>
    <seg1>
      <val1>..</val1>
    </seg1>
    I think, I have to map seg1 tag to seg1 segment, and val1 tag to val1 field..
    But! DO I HAVE TO MAP also seg1 tag to seg2, seg and seg4 segment? (to create logical "table"), or it is not necessary...
    Next question: what value should be assignet to @SEGMENT attribute of segments? also (IDOC segment?) Should it be some constant?
    Thank you guys!

    All you need to map is <b>seg1</b> source to <b>seg1</b> target and <b>val1</b> source to <b>val1</b> target . But remember that, if your source has seg2,seg3,seg4 and you want to use them then map them accordingly otherwise no need to map.
    @SEGMENT is counter for the number segments you are passing for each type of record. Use a java function to populate or just populate a constant 1.
    regards
    Shravan

Maybe you are looking for