Remove segment in Message Mapping

Hello,
I am sending the ORDRSP.ORDERS05 to an external message ORDERS05 which is based on the
same structure as the ORDERS05.
However I should not be sending all E1EDP01 segments. If the item belongs to a higher level item, then it should not be sent. If the item belongs to a higher level item then the field E1EDP01-UEPOS exists and has a value. In that case I should not transfer the E1EDP01 segment.
See example for what I mean. This would be the source message:
- <E1EDP01 SEGMENT="1">
  <POSEX>000010</POSEX>
  <ACTION>000</ACTION>
  <MENGE>1.000</MENGE>
  <MENEE>PCE</MENEE>
  <PMENE>PCE</PMENE>
- <E1EDP01 SEGMENT="1">
  <POSEX>000020</POSEX>
  <ACTION>000</ACTION>
  <MENGE>1.000</MENGE>
  <MENEE>PCE</MENEE>
  <PMENE>PCE</PMENE>
  <UEPOS>000010</UEPOS>
- <E1EDP01 SEGMENT="1">
  <POSEX>000030</POSEX>
  <ACTION>000</ACTION>
  <MENGE>1.000</MENGE>
  <MENEE>PCE</MENEE>
  <PMENE>PCE</PMENE>
  <UEPOS>000010</UEPOS>
This first item is the header item and does not contain the field UEPOS.
The next two items belongs to item 000010 and should not be sent.
In this case only the POSEX 000010 should be sent.
The target message should then look like this:
<E1EDP01 SEGMENT="1">
  <POSEX>000010</POSEX>
  <ACTION>000</ACTION>
  <MENGE>1.000</MENGE>
  <MENEE>PCE</MENEE>
  <PMENE>PCE</PMENE>
I think this should be possible with the standard functions in Message Mapping, and I have been playing around with CREATEIF and EXISTS, but have had no success. Anybody has any idea what to do?
Regards,
Per Rune

Hi Per,
If I understood correctly ,Do like this and let us know.
UEPOS---> Exists -----------> 
                                            and------>Not------->  IfWithoutElse --> E1EDP01----->E1EDP01
UEPOS-> Equals -> POSEX
Thanks!

Similar Messages

  • How to remove nodes in Message mapping

    Hi XI friends,
    in my idoc to file..
    i have number of segments..all segments are optional...
    i want to remove in resultanat xml file..
    please tell me how to remove if the values are not exsisted for that Segment ..
    i think its possible in message mapping..
    please guide me..
    Munna

    Hi Munna,
    Try Creating a UDF in your mapping name it like: "Create"
    Paste the below mentioned code in it
    ========================
    String str = a;
    if(str != null && str.length()>0)
    return "true";
    else
    return "false";
    ========================
    2) Save this function .
    3) Now Map like this
    (Source Node->UDF Create)->Check if it returns a string "true"--> if yes Map it with source node->add this in the "then" of an "if with out else"---->Target node.
    4) Test now in testing tool in Message mapping.
    Try it.
    it will work
    regards
    Pl: reward points if it worked

  • Is it possible to copy segment mapping in message mapping??

    Hii Experts,
    I want to duplicate one segment and I want to copy all the mappings of one segment into the other in message mapping.
    Mapping Templete does not work here.
    Anyone knows any other work around ?? The segment contains hell lot of mapping rules and it is difficult to copy each and every rule.
    Thanks in advance.
    Shri

    Hi shripad
    just try one thing right click on target field which you want to copy and select option copy node ..if it is work then it may.....otherwise i donot think its possible..
    Thanks
    Kunaal

  • 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>

  • Graphical message mapping

    Hello Expert
    I am woking in IS retail Outbound Scenario for article master  where enhancement segment E1WXX01 repeat multiple time and contain different -2 value  and I want to collect that different value in different Target filed 
    Suppose
    When first time segment E1WXX01 come contain
    fldname Zcolor
    Fldvalue red
    Target field Color
    In second time segment E1WXX01 contain value
    fldname ZSIZE
    Fldvalue 40
    Target filed SIZE
    And so on
    I want configure that scenario with the help of graphical message mapping
    Thanks
    Amit Shivhare

    Hi Shakif,
    <b>CONTEXT CHANGE</b>
    Please go through these links which clearly explains context and context changes in mapping.....
    http://help.sap.com/saphelp_nw04/helpdata/en/40/7b8e40496f6f1de10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/35/fb8c4057d5701de10000000a1550b0/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/42/f7293b2dbe1a71e10000000a422035/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/79/2835b7848c458bb42cf8de0bcc1ace/frameset.htm
    Go thru this guide~good source
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
    <b>REMOVE CONTEXT</b>
    Remove context removes all the higher-level contexts of a source field thereby delete all hierarchy levels and generate a list.In simple form
    removes all top hierarchy levels, so that all elements of the target queue are assigned to a root element of the source queue
    <b>SPLIT BY VALUE</b>
    The SplitByValue () function is the counterpart to removeContexts(): Instead of deleting a context, we can insert a context change in the source value queue. We then receive this element for each inserted context change instead of a top node element. However, for this to be possible, the top node source field must be assigned a top node target field and minOccurs must be >0. A maximum of minOccurs top node target fields can be inserted here.
    We can insert a context change in the queue after each value, after each change to the value, or after each tag without a value.
    refer this for node functions
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/2d8c4024d26e1de10000000a1550b0/content.htm
    Cheers...
    Vasu
    <b>** REward POints if found useful **</b>

  • Run Time Message Mapping error

    Hello Experts,
    I am working on JDBC to IDOC scenario. I am getting mapping error at SXMB_MONI and the error message is as below:
    com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ZABCD01. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD at  and so on.....
    I tested in Message Mapping by entering the values and I am able to see the target structure with out any Mapping errors..
    But when JDBC real time it got Runtime mapping error as above:
    Source
    tablename.Set -
    1.1
    row--
    0.Unbound
    a----
    0.1
    b----
    0.1
    Target
    ZABCD01-----1.1
    IDOC--
    1.1
    -Begin-----Required
    XYZ--
    0.1
    a----
    0.1
    b----
    0.1
    Dont know where is the problem is: I tried with payload its giving the same error as runtime....
    Payload looks as :
    <?xml version="1.0" encoding="utf-8" ?>
    - <set>
    - <row>
      <a>value</a>
      <b>value</b>
    </row>
    </set>
    Can any one faced same issue?
    Thanks
    Rajeev

    HI Satish,
    I created a new Datatype and tested wtih payload still the same..I am unable to create target node as IDOC segment is 0..unbound and below all fields are not not creating stilll they are mapped to source fileds.. what would be the reason?
    IDOC structure is:
    ZIDOC........................1....1
    ...IDOC........................1....1
    .....BEGIN.....................Requied (I disabled this filed)
    .....SEGMENT1.............1....1
    .....SEGMENT2..............0...1
    .........SUBSEGMENT1...0...99
    ..............FIELD1.............0....1
    ..............FIELD2..............0...1
    ..............FIELD3..............0...1
    ..........SUBSEGMENT2....0...1
    ..............FIELD4..............0...1
    ..............FIELD5..............0...1
    JDBC strucute is
    MT_XYZ
    ....set.................1...1
    .....row...............0...unbound
    ......field1............0...1
    ......field2............0...1
    ......field3............0...1
    ......field4............0...1
    I am not mapping all fields to respective fileds of source to target ...if I dont map ZIDOC and IDOC then mapping executing successful but I am not getting SUBSEGMENT1 and SUBSEGMENT2 with there fields values..
    If I do test by entering values manually it populate all fields values with subsegments but when i copy the payload from SXMB_MONI then I am getting error and If I remove target node mappings I am unable to get subsegment and fileds populated..
    How can I make FIELDS of IDOC to get populated??
    Thanks
    Rajeev
    Edited by: rajeev raj on Aug 25, 2009 9:26 PM

  • 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 error in UDF

    I am receiving errors when trying to activate my MM.  I believe the issues are in one of two UDF's.  These UDF's do work in another MM without error.  Below are the error's and UDF's.
    ERRORS:
    Activation of the change list canceled Check result for Message Mapping MM_WPDBBY_WPDBBY01_TO_POS_WAWAFILE | http://wawa.com/xi/erp/pos:  Starting compilation  Source code has syntax error:  /usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map5420e070cabe11dcab4b00306ef38da9/source/com/sap/xi/tf/_MM_WPDBBY_WPDBBY01_TO_POS_WAWAFILE_.java:3291: cannot resolve symbol symbol : variable container location: class com.sap.xi.tf._MM_WPDBBY_WPDBBY01_TO_POS_WAWAFILE_ map = container.getTransformationParameters(); ^ /usr/sap/XID/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map5420e070cabe11dcab4b00306ef38da9/source/com/sap/xi/tf/_MM_WPDBBY_WPDBBY01_TO_POS_WAWAFILE_.java:3293: cannot return a value from method whose result type is void return constant; ^ 2 errors
    UDF's:
    public String getSender(Container container){
    String constant;
    java.util.Map map;
    // get constant map
    map = container.getTransformationParameters();
    constant = (String) map.get (StreamTransformationConstants.SENDER_SERVICE);
    return constant;
    IMPORTS:  com.sap.xi.mapping.parse.dom.;javax.xml.parsers.;java.io.;com.sap.aii.mapping.lookup.;org.w3c.dom.*;
    public String getSeqNum(String fileType,String objNum,String Sender,Container container){
    String request = "<ns0:ZRFC_NUMBER_GET_NEXT xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\"><NR_RANGE_NR>" + fileType + "</NR_RANGE_NR><OBJECT>" + objNum + "</OBJECT><QUANTITY/></ns0:ZRFC_NUMBER_GET_NEXT>";
    InputStream isRequest = new ByteArrayInputStream(request.getBytes());
    SystemAccessor accessor = null;
    String num  = null;
    try{
         // 1. Determine a channel.
         Channel channel = LookupService.getChannel(Sender, "R_RFC_ERP");
         // 2. Get a system accessor for the channel.
         accessor = LookupService.getSystemAccessor(channel);
         // 3. Create a payload according to the data type which the adapter expects.
         //    Use service.getBinaryPayload() for binary payload,
         //    and service.getTextPayload() for text payloads.
         Payload payload = LookupService.getXmlPayload(isRequest);
         // 4. Execute lookup.
         Payload response = accessor.call(payload);
         //Parse response
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         DocumentBuilder builder = factory.newDocumentBuilder();
         InputStream resStream = response.getContent();
         Document doc = builder.parse(resStream);
         Element sequence = doc.getDocumentElement();
         NodeList number = sequence.getElementsByTagName("NUMBER");
         //Extract Number
         num = DOMUtil.getSimpleElementText((Element) number.item(0));
    } catch (Exception e) {
         return e.getMessage();
    } finally {
         try {
              if (accessor != null) accessor.close();
         } catch (Exception e) {
              return e.getMessage();
    GlobalContainer gc = container.getGlobalContainer();
    gc.setParameter("Num", num);
    return num;
    Any help is appreciated.
    Regards,
    Darrell

    Fauver,
    Just to narrow down the problem first remove the first udf and only use the 2nd user defined function. Also in the 2nd udf you have to change this line:
    try{
    // 1. Determine a channel.
    Channel channel = LookupService.getChannel(Sender, "R_RFC_ERP");
    In the above line instead of Sender you use the business service or business system where R_RFC_ERP RFC communication channel is created in Integration Directory. So you are hardcoding it first.
    Once you have done this changes do save and test it once again. If this works then you can change back to original and your first udf needs to be checked.
    Regards,
    ---Satish

  • Creation of CDATA with message mapping

    Hello all,
    Is everyone absolutely sure that a cdata string cannot be created in the middle of an xml file using message mapping? 
    I have tried doing the XSL map in other blogs I even tried writing a whole XSL map in xml spy - yet xi complains about not finding this class file and that class file.  I'm having a hard time believing that this is so hard to do in XI - especially when Microsoft web service implementation seem to long for data crammed into a string ( in my experience ).
    Any help is GREATLY appreciated.
    Thank you!!!
    Scott

    Hi Scott,
             Pls follow the following steps to insert XML string into a single element:
    Create a xsl file with the following data:
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <i><b>NSpace</b></i>>
    <xsl:template match="/">
    <namespace:name1>
    <xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text><xsl:copy-of select="<b>//namespace:name</b>"/><xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text><xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
    </namespace:name1>
    </xsl:template>
    </xsl:stylesheet>
    In the above code I have removed xmlns:p2="http://frik.bcc.com.pl" which is not needed.
    Also you have to put '<b>//</b>' before the target element from where you want to start creating XML string over here it is <b>name</b>. And <b>name1</b> is the element you want to store the XML string in.
    So anything in the element <b>name</b> will be stored in <b>name1</b>
    Regarding the <b>namespace:</b> To find out the namespace test your message mapping between the source and the target without adding XSLT mapping. After testing click on <b>'SCR'</b> tab present on top of the target window. There you will see <b>ns1: or ns2:</b> attached to each element. Replace <b>namespace</b> in the above code with <b>ns1: or ns2:</b>.  And replace <b>NSpace</b> in the above XSL Header with the namespace in the SCR of test map.
    So the final XSL file will look like that:
    <?xml version='1.0' ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <i><b>xmlns:ns1="http://sap.com/xi/HR"</b></i>>
    <xsl:template match="/">
    <<b>ns1:</b>name1>
    <xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text><xsl:copy-of select="<b>//ns1:name</b>"/><xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text><xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
    </<b>ns1:</b>name1>
    </xsl:template>
    </xsl:stylesheet>
    Dont forget to put '//' before the target element.
    This should work. Or pls put the source and target xml struct and we will assist you further.
    Regards,
    Ashish

  • RuntimeException in Message-Mapping transformatio

    Hi all,
    My XI server is successfully picking up a comma separated file from an FTP server and generating the corresponding XML:
    <?xml version="1.0" encoding="utf-8" ?>
    <ns:CondRec_MT xmlns:ns="http://namespace-ConditionRecords">
    <Recordset>
    <ConditionRecord>
      <Usage>A</Usage>
      <Table>018</Table>
      <Application>M</Application>
      <ConditionType>PB00</ConditionType>
      <VarKey>00000039301300-340 2 0</VarKey>
      <Material>1300-340</Material>
      <Vendor>3930</Vendor>
      <PurchasingOrg>2</PurchasingOrg>
      <Infotype>0</Infotype>
      <InfoRecord>5300003218</InfoRecord>
      <CondRecordNo>0000020727</CondRecordNo>
      <ValidFrom>30.05.2006</ValidFrom>
      <ValidTo>31.12.9999</ValidTo>
      <ScaleType>A</ScaleType>
      <CalculatType>C</CalculatType>
      <KBETR>15.00</KBETR>
      <CondCurrency>USD</CondCurrency>
      <CondItemIndex>01</CondItemIndex>
      <RelToPricing>X</RelToPricing>
      </ConditionRecord>
      </Recordset>
      </ns:CondRec_MT>
    But nothing is getting submitted to the receiver adapter.
    The error in SXMB_MONI reads as follows:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_file2file_mm_</SAP:P1>
      <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
      <SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>During the application mapping com/sap/xi/tf/_file2file_mm_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    I am using a simple one to one mapping(i.e the same msg type is being used for both the outbound and inbound interface).
    Pls can anybody guide me as to what can be the probable error.
    Thanks in advance
    Regards
    Neetu

    Hi all,
    Thanks for ur prompt responses.
    I followed the blog and performed testing of the mapping.
    The XML with which i tried was as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <ns:CondRec_MT xmlns:ns="http://namespace-ConditionRecords">
    <Recordset>
         <ConditionRecord>
              <Usage>A</Usage>
              <Table>018</Table>
              <Application>M</Application>
              <ConditionType>PB00</ConditionType>
              <VarKey>00000039301300-340          2   0</VarKey>
              <Material>1300-340</Material>
              <Vendor>3930</Vendor>
              <PurchasingOrg>2</PurchasingOrg>
              <Infotype>0</Infotype>
              <InfoRecord>5300003218</InfoRecord>
              <CondRecordNo>0000020727</CondRecordNo>
              <ValidFrom>30.05.2006</ValidFrom>
              <ValidTo>31.12.9999</ValidTo>
              <ScaleType>A</ScaleType>
              <CalculatType>C</CalculatType>
              <KBETR>15.00</KBETR>
              <CondCurrency>USD</CondCurrency>
              <CondItemIndex>01</CondItemIndex>
              <RelToPricing>X</RelToPricing>
         </ConditionRecord>
    </Recordset>
    </ns:CondRec_MT>
    this gave the following error:
    Cannot produce target element /ns:CondRec_MT/ConditionRecord. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
    But when i removed the tag 'RECORDSET', it works fine and output gets genersted.
    My datatype has no such field called recordset.
    The adapter generates it on its on.
    How do i solve this issue.
    Regards
    Neetu

  • Need Clarification on Looping in Message Mapping.

    Hi All,
      I'm trying to implement the Dynamic emailing as explained in the Michals blog.
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    I have this partially working for the scenario I have.
    XI will be receiving a ORDRSP IDoc from an external system and XI needs to do the following.
    1) Check the value of <b> E1EDP01-ABGRU </b> equals to Z2. If any of the E1EDP01-ABGRU has a value of Z2, it should do the following
             a) Get the email address from the E1EDKA1-ILNNR and map it to the TO field as shown in the blog.
              b) Get the values of BELNR-E1EDK01, MENEE, VPREI, POSEX, PEINH, ABGRT from the E1EDP01 segment and concatenate them all and map it to the Content tag as explained in Michals blog.
      I have this process partially working. The XI interface is only mapping for the first occurrence of E1EDP01 and not the subsequent occurrences of E1EDP01 which matches the criteria ( E1EDP01-ABGRU = Z2)
    Any help in getting fixing this problem??
    Thanks

    Make sure to define multiple target messages in your message and interface mappings, for the mail package message definition (occurrence = 0...unbounded).
    Also, in the logic of your message mapping, you need to create a new mail package message only if  E1EDP01-ABGRU = 'Z2'. Use it like this:
    ABGRU   ---   EqualS   ---   createIf   ---   Mail
    Constant[Z2]
    Regards,
    Henrique.

  • 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

  • Message-Mapping transformation Error(Soap - XI - SAP)

    Hi
    We have a sceanio
    Soap <-> XI <-> SAP
    We could see the RFC return message from SAP but while trasforming that message to SOAP response ,we are getting the following error. We have manually run the response mapping program, it is executing fine.
    <SAP:Stack>During the application mapping com/sap/xi/tf/_MM_GR_GetTODetails_Response_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>
    Could anybody please help us.
    Thanks
    Ramesh

    Hi
    Thank you so much for your promt responses. I could get great inputs from your responses.
    It is the problem with the RFC return message structure. In one of the segment it was defined mandatory but the RFC is not populating that segment data.
    Appreciate your help.
    Warm Regards
    Ramesh

  • Message Mapping- 3 problems

    Hi,
    1)I need some information regarding Message Mapping. I need to map the field TDLINE of segment E1EDKT2 of IDOC ORDERS05 to the target fields. But based upon the index number of the record of this segment, I must map it to different fields (eg.E1EDKT2[10], E1EDKT2[3]). How can I incorporate this in Message Mapping?
    2)And one more scenario is as follows.Use PARTN if exists or use LIFNR to map to target and it must satisfythe conidtion PARVW = AG. Should we need Java code or can we achieve this using two 'If' conditions.
    3)We are looping at a source segment and it has multiple  occurances.How to create multiple segments in target based on condition.
    Can anyone help me.
    Thanks,
    Srinivas

    > 1) I need to map the field TDLINE of segment E1EDKT2
    > of IDOC ORDERS05 to the target fields. But based upon
    > the index number of the record of this segment, I
    > must map it to different fields (eg.E1EDKT2[10],
    > E1EDKT2[3]). How can I incorporate this in Message
    > Mapping?
    You can use the index function (with SP13):
    E1EDKT2* - index
                      equalS
        constant(10) /     
                             ifWithoutElse - target
    TDLINE - removeContexts /
    check the correct context
    > 2)And one more scenario is as follows. Use PARTN if
    > exists or use LIFNR to map to target and it must
    > satisfy the conidtion PARVW = AG. Should we need Java
    > code or can we achieve this using two 'If'
    > conditions.
    Sure you can chain if statements:
            PARVW
                  equalS 
    constant(AG) /     
                         ifWithoutElse
                  PARTN /            
                       PARTN - exist - if - target
                                  LIFNR
    This mapping assumes, that PARVW = AG is available, when PARTN is available.
    > 3)We are looping at a source segment and it has
    > multiple  occurances. How to create multiple
    > segments in target based on condition.
    Here is a pattern:
    condition - createIf - target
    condition has to be a queue of true and false with the same occurrency as source.
    All sub nodes of source are now arranged correctly under the target node.
    Regards
    Stefan
    Message was edited by: Stefan Grube

  • Message Mapping(Display queue and Suppress Value)

    Hi Experts,
    In Message Mapping(graphical mapping), upon checking the properties of the nodes,there's one property display queue, in which suppress is there??
    What does it mean?? Which queue it points and what value is suppressed??
    Thanks & Regards,
    Sushama

    Hi Sushama,
    SUPPRESS means no value.
    suppose we are checking one condition (tdid = "RE" then pass tdline) based on the condition we will send one output. if the condition fails then suppress value goes to the target.
    > What does it mean?? Which queue it points and what value is suppressed??
    es:  if(tdid.equals("WE") ifwithoutelse pass tdline value as output.    [tdid is in E1EDKA1 segment and this segment occurance is multiple]
    In this case if the condition is satisfied once and failed once (means E1EDKT1 segment comes 2 times) then first time it sends the corresponding tdline value and second time it sends the SUPPRESS value.
    Regards
    Ramesh

Maybe you are looking for