Help for message mapping

Hi, I have an IDOC -> PI -> File simple scenario but I donu2019t know how to solve the following problem. I have to built my file header line with data from IDOC segments. That data comes from the same segment but different u201Cinstancesu201D and there is a field to identify the instances, something like that:
Source IDOC
     Segment1 with parameter = 001
     Segment1 with parameter = 002
Target FILE header line:
[segment1.001-field1];[segment1.002-field1]
The mapping checks the parameter value but generates an error because the 2nd field of the file is obligatory and when the mapping founds the 1st segment then it canu2019t continue searching the segment with parameter = 002 and complete the file line.
Sorry for my bad explanation, I hope you understand the problem.
Edited by: Marshal on May 20, 2009 12:04 PM

to make the if condition work for all the instances of <E1ADRM1>....the only thing that you need to do is in the mapping logic suggested by ravi just increase the context of the <PARTNER_Q> node on the source side and make it to point to <E1EDL20>...this will apply the logic for all the instances of E1ADRM1 in E1EDL20.....no need of any UDF
Hi abhishek,
I've done this but know the IF without els doesn't work. All the fields from the first E1ADRM1 instance are mapped to the file 2 times, and the 2nd E1ADRM1 data is not mapped right.
Here I post an example of target XML:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:OL_MT_Entrega xmlns:ns0="urn:general-optica-es:ol:entrega">
   <Entrega>
      <header>
         <tipreg>01</tipreg>
         <nument>vbeln</nument>
         <codol>OSP_Partner</codol>
         <nomol>OSP_NAME1</nomol>
         <domol>OSP_STREET1</domol>
         <pobol>OSP_CITY1</pobol>
         <cpol>OSP_COD1</cpol>
         <coddes>WE_Partner</coddes>
         <nomdes>WE_NAME1</nomdes>
         <domdes>WE_STREET1</domdes>
         <pobdes>WE_CITY1</pobdes>
         <cpdes>WE_COD1</cpdes>
      </header>
   </Entrega>
</ns0:OL_MT_Entrega>
PD: There is another positions part on target XML but 1st I have to solve the header mapping

Similar Messages

  • User defined function in java for message mapping

    I wrote the following user defined function in java for message mapping and mapped vendor with this. The aim of this function is to write a error file at defined path when i send empty Vendor value from File to RFC-Function module BAPI_PO_CREATE. The "err.txt" error file is not written when i execute in TEST but the value "ERROR" is returned to destination Vendor Field.
    public String  validation(String a, Container container) {
    //write your code here
    if (a.equals("")) {
    try {
    String source = "Vendor cannot be empty";
    char buffer[] = new char[source.length()];
    source.getChars(0, source.length(), buffer, 0);
    for (int i = 0; i < buffer.length; i +=2)
       f0.write(buffer<i>);
    f0.close();
    FileWriter f1 =  new FileWriter("/10.10.0.55/sapmnt/trans/edixiin/err.txt");
    f1.write(buffer);
    f1.close();
    catch (IOException e) {}
    return "ERROR";

    Hi Senthil,
    Check these things :
    1) Whether you have permission to create a file in that directory.
    2) try giving this 
    10.10.0.55
    sapmnt
    trans
    edixiin
    err.txt
    3) Also check for permissions.
    Hope this will help you.
    Regards
    Suraj

  • Need Help with Message Mapping in PI 7.1 - JDBC to IDOC

    I have an outgoing SQL function that sends multiple rows of data for use in creating an IDOC in ECC. I am trying to key the creation of new IDOCs (already did the maxOccurs trick to the IDOC definition) based on a field in the JDBC return data...
    JDBC Message Format...
    SEGNAM - TRANS_ID - MATERIAL - VKORG...ETC
    MARA -  00001 - 1234 - <space> - ...
    MARC -  00001 - 1234 - VK01 - ...
    MARA - 00002 - 9876 - <space> - ...
    MAKT - 00002 - 9876 - <space> - material description - ...
    Each time there is a new TRANS_ID, I need to indicate a new IDOC in the message mapping. I have tried all kinds of combinations of TRANS_ID --> dropContext --> splitValue and TRANS_ID --> collapseContext --> splitValue, but nothing has worked.
    Has anyone done this kind of message map (without any BPM please)?
    Thanks,
    Nathan

    Hello Nathan,
    For this one, you have to play with contexts.
    row 1 SEGNAM = MARA, TRANS_ID = 1, MATNR = 123...
    row 2 SEGNAM = MARC, TRANS_ID = 1, MATNR = 123, WERKS = PL01...
    row 3 SEGNAM = MARA, TRANS_ID = 2, MATNR = 987
    This also depends on the occurrence of the parent node. example, if I want MATNR to be populated, the logic would be like
    ex:
    IDOC1..unbounded) (The logic is the already provided in an earlier response)
    -->MATNR (1..1)
    MATNR --------> removeContext ----------------> FormatByExample --> MATNR
    TRANS_ID --> removeContext --> splitByValue:ValueChange --> /
    If the rows are not in order of trans_id, then you need to incorporate sorting into the logic above.
    Hope this helps,
    Mark

  • 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

  • Help with Message Mapping - Context Change

    I need help with the following message mapping.  I am filtering by EMP_STAT in the Message Mapping.  I have this working for the ROW structures, but I can get the HEADER/REC_COUNT field to calculate.  I can do just a record count of ROW and get it to work, but I can't get it to work with the filter EMP_STAT = 'REG' added.  I get a context error.  Could someone send me the mapping code.
    Sender XML----
    <RECORD>
    <ROW>
    <EMPLOYEE>111</EMPLOYEE>
    <EMP_STAT>REG</EMP_STAT>
    </ROW>
    <ROW>
    <EMPLOYEE>222</EMPLOYEE>
    <EMP_STAT>PT</EMP_STAT>
    </ROW>
    <ROW>
    <EMPLOYEE>333</EMPLOYEE>
    <EMP_STAT>REG</EMP_STAT>
    </ROW>
    </RECORD>
    Receiver XML----
    <RECORD>
    <HEADER>
    <REC_COUNT>2</REC_COUNT>
    </HEADER>
    <ROW>
    <EMPLOYEE>111</EMPLOYEE>
    <EMP_STAT>REG</EMP_STAT>
    </ROW>
    <ROW>
    <EMPLOYEE>333</EMPLOYEE>
    <EMP_STAT>REG</EMP_STAT>
    </ROW>
    </RECORD>

    Hello,
    You can use this mapping
    For REC_COUNT:
    EMP_STAT -> equalsS: constant:REG -> ifWithoutElse -> removeContext -> count -> REC_COUNT
                                     EMPLOYEE -> /
    For ROW:
    EMP_STAT -> equalsS: constant:REG -> ifWithoutElse -> removeContext -> ROW
                                     EMPLOYEE -> /
    For EMPLOYEE:
    EMP_STAT -> equalsS: constant:REG -> ifWithoutElse -> removeContext -> SplitByValue -> EMPLOYEE
                                     EMPLOYEE -> /
    For EMP_STAT:
    Constant: REG -> EMP_STAT
    Hope this helps,
    Mark

  • Different options for message mapping in BPM

    Hey guys
    i m in the learning phase of BPM and am kinda confused with the different ways we can do message mapping in a BPM scenario.
    first of all we can do message mapping before BPM,we can also do after BPM and lastly we can do inside BPM(ofcurse this is not recommended as its too resource consuming)
    i have bene through starters blog on BPM by Krishna moorthy and Arpit seth,and now am wondering how to use the mapping in diff. ways
    suppose i m doing a simple File to File with BPM(just for practise purpose)
    now here is what i have designed in IR
    DT_sender_File                                       DT_receiver_File
    MT_sender_File                                       MT_receiver_File
    MI_Outbound_sender(async,outbound),     MI_Inbound_receiver(async,inbound)
    AI_sender(abstract,async)                        AI_receiver(abstract,async)
    MM_File_File(using MT_sender_File and MT_receiver_File)
    now i want to clear some doubts about interface mapping.my understanding is
    if i do interface mapping between MI_Outbound_sender and AI_receiver,this will be interface mapping before BPM.
    if i do interface mapping between AI_sender and MI_Inbound_receiver,this will be interafce mapping after BPM
    and if i do interface mapping between AI_sender and AI_receiver then it will be mapping inside BPM.
    is my understanding correct?if yes,then does that means we can we any of the above mapping in our scenario.(if we dont consider the performance issue as of now)
    thanx
    saif

    Hi Saif,
    <i>
    is my understanding correct?</i>
    Yes, thts correct
    <i>if yes,then does that means we can we any of the above mapping in our scenario</i>
    Of course, u can use any of them (overlooking the performance issue)
    Regards,
    Prateek

  • Please help for ios6 maps, india

    It is nt working properly, as it not showing navigation between two places. Only shows current location. Please need ur immediate help.

    I should have never done the Grave mistake of downloading Disastrous iOS6. The maps are not working at all. Also, they have moved YouTube Icon from new version.I am using Iphone 4S.
    If this was not enough, take a look at below link:-
    http://www.apple.com/ios/feature-availability/#maps-directions
    Do anyone of you know replacement for Apple Maps?
    Thanks
    Ankit

  • Need help in Message Mapping

    Hi Folks,
    I have below Query. Can you please suggest how do i solve below case.
    My source system has 4 fileds A , B, C, D and the target system has 1 Filed TOTAL.
    I have to concatenate all the 4 source fields by using slash(/) and placed in TOTAL target field.
    i need output has A/B/C/D.
    but here is my Query?  if any one of the field is not present in source field i.e. if source B filed is empty then I have to print Output has  A/C/D.
    NOTE:  there is no empty slashes for B.
    Please help me on this issue.
    Thanks,
    Enivass

    Hi Supriya,
    Actually I didnot get ur mapping shot
    Can u tell me some more briefly plzzz
    I tried blow
    A
             concat  -
    >    trim -
    > then what i have to use.       
    Thanks,
    Enivass
    Edited by: enivas on Oct 20, 2010 9:47 AM

  • Need help on message mapping

    Hi,
    Need ur help on below situation.
    I have input file structure as
    - <G_SPO1>
    - <S_PO1>
      <D_350>0001</D_350>
      <D_330>6</D_330>
      <D_355>EA</D_355>
      <D_212>151</D_212>
      <D_235>VC</D_235>
      <D_234>40421-821/1920-02</D_234>
      <D_235_2>SK</D_235_2>
      <D_234_2>427Y73226</D_234_2>
    - <S_REF>
      <D_128>SU</D_128>
      <D_127>0060325940</D_127>
      </S_REF>
    - <S_REF>
      <D_128>SU</D_128>
      <D_127>0060325957</D_127>
      </S_REF>
    - <S_REF>
      <D_128>SU</D_128>
      <D_127>0060325964</D_127>
      </S_REF>
    - <S_REF>
      <D_128>SU</D_128>
      <D_127>0060325971</D_127>
      </S_REF>
    - <S_REF>
      <D_128>SU</D_128>
      <D_127>0060325988</D_127>
      </S_REF>
    - <S_REF>
      <D_128>SU</D_128>
      <D_127>0060325995</D_127>
      </S_REF>
    - <S_REF>
      <D_128>CR</D_128>
      <D_127>WHITEHOUSE,RYAN</D_127>
      </S_REF>
    </S_PO1>
    </G_SPO1>
    I need to map D_127 elements to target field.
    here i need to check conditions.
    IF D_128 = SU then only i need to map D_127 to target field. otherwise ignore that record.
    Plzz let me know how would i map thid field to target field.
    Thanks,
    Singh.

    Lakshmi,
    for PO1 first element is 0001 i need output as
    0060325940
    0060325957
    0060325964
    0060325971
    0060325988
    0060325995
    for next PO1 first element is 0002 then i need output as
    0070325940
    0070325957
    0070325964
    These below fields are present in input file. the above file i mentioned only for PO1 first element D_350 = 0001.
    Presnetly i am geting output as
    0060325940
    0060325957
    0060325964
    0060325971
    0060325988
    0060325995
    0070325940
    0070325957
    0070325964
    but i need to differentiate this output as separate based on D_350 = 0001.
    finally required output is
    if PO1 1st element D-350 = 0001
    then output is
    0060325940
    0060325957
    0060325964
    0060325971
    0060325988
    0060325995
    if PO1 1st element D_350 = 0002
    then
    0070325940
    0070325957
    0070325964
    Plzzzz let me know.
    Thanks,
    Singh.

  • Help on message mapping requirement

    I have a source file with a structure like below:
    emp no , company code , dependent name , dependent age , dependent qualification
    an exp file would look something like below :
    PERNRA , 1000, ABC , 23, CA
    PERNRA,  1000, DEF , 25 , BE
    PERNRB,  1200, XYZ , 35 , GE
    PERNRA,  1000, TGH, 30, BE
    My target structure expects one node per employee number and the dependent information node recurring inside the <emp> ..... </emp> node.
    Please advise.
    Mathews

    Please look at following:
    I am asumming your source message will be do FCC to following format:
    <Recordset>
       <emp_no>PERNRA</emp_no>
       <comp_code>1000</comp_code>
       <dep_name>ABC</dep_name>
       <dep_age>23</dep_age>
       <dep_qua>CA</dep_qua>
    </Recordset>
    <Recordset>
       <emp_no>PERNRA</emp_no>
       <comp_code>1000</comp_code>
       <dep_name>DEF</dep_name>
       <dep_age>25</dep_age>
       <dep_qua>BE</dep_qua>
    </Recordset>
    I am assuming that your target message is something look like below:
    <emp>
      <emp_num>PERNRA</emp_no>
      <emp_info>
       <comp_code>1000</comp_code>
       <dep_name>ABC</dep_name>
       <dep_age>23</dep_age>
       <dep_qua>CA</dep_qua>
      </emp_info>
      <emp_info>
       <comp_code>1000</comp_code>
       <dep_name>DEF</dep_name>
       <dep_age>25</dep_age>
       <dep_qua>BE</dep_qua>
      </emp_info>
    </emp>
    <emp>
    </emp>
    Then your mapping design will look like below:
    remember that the formatbyExampe take two parameters, I put it just in same line of first parameter. Silimarly for sortbyKey
    emp_no -> removeConetext -> Sort -> SplitByValue[Value Change] -> CollapsContext -> removeContext --> emp
    emp_no -> removeConetext -> Sort -> SplitByValue[Value Change] -> CollapsContext ->emp
    _num
    emp_no --------------------------------------------------------->FormatbyExample -->emp_info
    emp_no -> removeContext -> sort -> SplitByValue[Value Change]--->
    Other nodes, for example dep_age:
    emp_no->removeContext-->sortbyKey -> SplitByValue[Each Value] -> dep_age
    dep_age->removeContext->
    Liang

  • Adding a variable menu for message mapping

    I know that variable menus serve the purpose of a sub-routine in terms of ABAP but I'd like to know if including them will affect the output in ABAP Proxy? I am currently planning optimizing my mapping by defining a variable that has a commong function for my duplicate records. Thanks!

    Hello Richard,
    After a quick review I think you missed the creation of a reversed DNS record (PTR record) for the new IP address. For SMTP traffic it's really important to have a good PTR record.
    Besides that I would invite you to read carefully the topics about "virtual gateways" in you online documentation. Those are a specially created solution for your problem and if I remember right you can even use a secondary IP address on you existing interface for it.
    Good luck!
    PS: kudos for your marketing department, most of the times those guys start their e-mail cannons without even thinking about any possible side effect on the main production mail flow. :-)
    Steven

  • Help for on mapping - Std function or UDF?

    Hi All,
    I am working on DELVRY03 Idoc (outbound) n doing mapping betweeb Idoc and legacy structure. In delivery line item we have lineitem quantity field E1EDL24-LFIMG. Let say if we have 3 line items with LFIMG values 5,10,15...we need add up all these and send to target total quantity field. Is there any std function or sample code for writign UDF???
    Thx
    Navin

    Hi,
    use sum function (from standard functions)
    but before using it use removecontext function (from node functions)
    as it sums all values from one context only
    so if you remove it will work as you need
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Help on message mapping.

    Hi,
    I am working on EDI to IDOC scenario.
    In my input side i have PO1 record with occurence 1..1 and
                                       REF record with occurence 0 to unbound
    In my output side E1EDPT2 record with occurence 1 to unbound.
       E1EDPT2  RECORD HAVE FIELD TDLNR.
    My input file as
    PO10016
    REFSU12345
    REFSU2345
    REFSU3456
    REFCR789
    PO10026
    REFSU54321
    REFSU235
    REFSU3465
    REFCR7896
    Here my Question is
    if PO1 1st field = 001 and REF 1st field  = SU then i need to map REF 2nd  field to TDLNR.
       if REF 1st field = CR then ignore that record in output.
    same thing for PO1 1st field =  002.
    How can i map for above conditions.
    Thanks,
    SIngh.

    Hi Sarvesh,
    Can u plzz tell me how would i used in Graphical mapping that REF 1st element  is SU then map REF 2nd element to target fields
    Here i need to check PO1 value also.
    Plzz give me briefly  how would i use if/else. give me some hints.
    Thanks,
    SIngh.
    Edited by: vcpsingh on Mar 10, 2010 5:09 PM
    Edited by: vcpsingh on Mar 10, 2010 5:36 PM

  • Need urgent help for (Message file sp1 lang .msb not found)

    sir
    c:\oracle9i this is my database folder name
    c:\oraform this is my form folder name
    which one my oracle_home name
    sir i test this command
    c:\ set ORACLE_HOME=c:\ORACLE9I
    c:\ set ORACLE_SID=AAMIR
    c:\ sqlplus / as sysdba
    AND RUN SQL PLUS THEN SYSTEM GIVE ME THIS ERROR
    incorrect environment variable plus_dflt program execution error
    please give me idea how i run my system
    thank

    Duplicate post:
    ''Urgent'' incorrect environment variable plus_dflt program execution erro

  • 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

Maybe you are looking for