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

Similar Messages

  • 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

  • Message Mapping Requirement

    Hi All,
    Iam trying to send data from a File to an R/3 using RFC.
    My input structure has a field called material number.Material numbers from the sender has a corresponding material code for receiver.ie for a material code SM01,receiver material code will be RM01.
    This values are not fixed.i.e user will keep on changing the values for material code for sender and reciver.So I cannot give a fixed mapping in XI.
    I have to give the user an option to enter the values for sender material code and receiver material code in a table and read that table evrytime in my mapping.
    Can someone tell me if this option is possible and if there is a better option available?.
    Thanks in advance.
    Soumya.

    Hi Soumya,
    U can Use any of the following mapping techniques:
    1)  <a href="/people/bhanu.thirumala/blog/2006/02/02/graphical-message-mapping-150-text-preview mapping</a>
    2) <a href="http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm">XSLT</a>
    3)  <a href="http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm">JAVA</a>
    4)  <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/u/455">abap</a>
    if you know the Java technologies and XML throughly, you can go with Java/XSLT mappings
    from
    Yallabandi...

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

  • 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

  • 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

  • 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

  • How to Alert RFC connection failure via message mapping? Kindly Help!

    Hi Experts,
        I have a JMS - XI - RFC scenario.
    JMS receives the Rosattenet PIP contents and sends it to RFC function module in remote SAP R/3 system.
       I have a requirement where I have to monitor RFC connection failure because of the remote R/3 system being down. I have to send a email alert where the subject contains the PIP number to understand for which PIP the connection failed.
      The PIP number exists in the PIP content at the interface.
      If I use the Alert configuration in the runtime workbench for monitoring then I cannot dynamically pass the PIP number.
      Only way I think of triggering alert is in the message mapping via a Java UDF.
      But I am not sure how can I do this? How do I check in the UDF if RFC connection has failed? Is this the correct approach?
      How to acheive my requirement? Note that my email subject content is dynamic bacause if PIP number.
    Please help!
    Thanks
    Gopal
    Message was edited by:
            gopalkrishna baliga

    Hi Gopal,
    what version/sps of XI are u running?
    The easiest way to do what u want inside a UDF is to
    1. use JCo to try estabilish a connection to the remote SAP System
    2. if that fails, use JavaMail to send an email message
    Let your UDF work on the PIP number, accepting it as input, and (maybe) returning it as output if everything goes ok. Otherwise break the mapping execution as described by Michal in one of his last weblog (using Dynamic Configuration).
    Note that the above method doesn't guarantee that the message will be actually delivered, as some seconds could last between your check and the real RFC delivery operated by the Adapter Engine...
    I am evaluating a way to do the same with Alert Framework. I will let you know the result!
    Cheers,
    Alex

  • Message mapping logic help

    Hi All
    I have a source structure like this below. It's a big structure actually. I'm just pasting the relevant structure where I need your help.
    </root>
         <storage> 
             <id>AB</id>
             <Type>TY</storType>
             <Temp>100</Temp>
        </storage>
    ----</root>
    My requirement is to check the value coming in <Type> and if it is TY, then the target structure will be the exactly the same
    If it is XY, then the target structure will have one more field <celsius> and will look like this below.
    </root>
         <storage> 
             <id>AB</id>
             <Type>TY</storType>
             <Temp>100</Temp>
             <celsius>922</celsius>
        </storage>
    ----</root>
    The <storage> complex element with elements can repeat as many times in the source XML. But the values of <Type> will be either TY or XY and I have to create the target structure accordingly. Pls help. I am using graphical message mapping
    thx
    mike

    Hi Michael,
    Please try below mapping
    Regards,
    Krupa

  • Message mapping/UDF help..

    Hi experts,
    Can someone let me know whether there is a chance to fulfill the below requirement:
    Input file:
    In the Input CSV file, there is a fixed length field with length 9 char and has leading zeroes (ex: 000000650)
    Output file:
    In the O/p XML file, the corresponding value should be displayed as "6.50" (Have to remove the leading zeroes, right justified and the last two digits should be allocated for decimals)
    Can anyone let me know if we can handle in Message mapping or should we write a UDF? If so can you please provide the code..
    Any help would be highly appreciated !!
    Thnx
    - Ravi

    Hi Ravi,
    UDF:
    Create a function zerosuppress and take the cache as value and take one argument input. Then put the code below:
    //Put this code
    String output = input.replaceFirst("^0+","");
    return output;
    With this function your leading zeros will remove.
    Then map like this:
    source field --> zerosuppress (udf) --> divide by 100 --> target field.
    This should solve your issue.
    Regards,
    ---Satish

  • I am trying to authorize my computer and I get an error message: The required directory was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed. Help?

    I am trying to authorize my computer and I get an error message: The required directory was not found or has a permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed. Help?

    I used Terminal to change the permissions on the folder in question.  I followed the instructions in this article:
    iTunes: Missing folder or incorrect permissions may prevent authorization
    In my case, the folder was there, so I needed the command to change permissions on the folder, not to create one.   I was hesitant to use Terminal b/c I know that if I made an error I could wipe out my hard drive or render my computer unusable.  So to be SURE I didn't make an error, I carefully copied the command from that page and *pasted* it into Terminal.  Also, before I could do anything in Terminal, I had to go change my admin password (it had been a blank password before and that's not acceptable for making changes in Terminal).  I was just super careful when entering my password or doing anything else while Terminal was open (making sure I didn't accidently hit the spacebar or another key, etc.)  And it fixed the problem right away.
    What was confusing for me was that the iTunes error message said to change permissions in the FINDER, which is what I was trying to do.  It didn't mention Terminal.  What would really be helpful is if Apple included a link to a page like this in their error message.

  • When trying to launch iTunes it freezes and I get the message: "Authentication Required. To access this site you need to log in to area "100656 on mellor.co. Your password will be sent in the clear." I am unable to enter a uname or password. Please help!!

    When trying to launch iTunes on my PC running Windows 7 it freezes and I get the message: "Authentication Required. To access this site you need to log in to area "100656 on mellor.co. Your password will be sent in the clear." Because iTunes is frizen at this point I am unable to enter a username or password, or in fact do anything. Please help!! I have uninstalled and reinstalled iTunes numerous times as well as attempting all of the fixes that I could find on-line and still no joy.

    That sounds extremely phishy to me... iTunes does not require authentication simply to launch it. I suspect you've got something nasty intercepting network traffic. That server may be set up to log the Apple ID that you enter so it can be used fraudulently. Try ComboFix from Bleeping Computer.
    FWIW the domain mellor.co is registered to an accountants in Knutsford, Cheshire, UK, and produces the same authentication request if visited with a browser. There is no sign of a "real" publicly visible website at that domain which is a somewhat odd.
    tt2

  • A little help needed in message mapping

    a little help needed in message mapping
    I have to map one of the idoc header segments as many times as it occurs to each Idoc when using the split message funcionality
    let us say we have the segment seg1 and there is a QUALF in it
    <seg1>
    <qualf>001</qualf>
    </seg1>
    <seg1>
    <qualf>002</qualf>
    </seg1>
    then we use the vbeln to split the idoc into 2.
    so if we have
    <vbeln> 1 </vbeln>
    and
    <vbeln>2 </vbeln>
    then 2 Idocs should be created like this
    <Idoc>
    <vbeln> 1 </vbeln>
    <seg1>
    <qualf>001</qualf>
    </seg1>
    <seg1>
    <qualf>002</qualf>
    </seg1>
    </Idoc>
    <Idoc>
    <vbeln> 2 </vbeln>
    <seg1>
    <qualf>001</qualf>
    </seg1>
    <seg1>
    <qualf>002</qualf>
    </seg1>
    </Idoc>
    it is easy to create the segment by using createif with the QUALF field but my problem how to map the qualf twice for each idoc
    Thanks.

    UseOneAsMany is the function you need to use.
    It takes three parameters:
    1 --- The node you want to duplicated
    2 --- How many times you want to duplicated
    3 --- The context you want to place for it.
    Regards
    Liang

Maybe you are looking for

  • Problem in case of or condition in  where clause in case of leftouter joi.

    hi i am encountering a wierd problem. in a select query if i have a left outer join and a or condition in where clause the order of condition in or matters and if i use a to_char problem is solved. see query below select * from custsupp left outer jo

  • Help with rsvp total

    I am arranging a trip for a group of middle school / high school students. I have a sheet that lists the student info and then a box to check that they are confirmed. At that bottom of that column I'd like to have the total of the number of people wh

  • Date addition

    I would like to display a date in the future based off of a date a user enters in a date field as well as a choice they make out of a drop list. Drop List (dl1) allows the user to select choices "1 week, 2 weeks, 3 weeks, 4 weeks" etc up to "9 weeks"

  • I have a iMac I recently loaded Mavericks and Safari is very buggy.  My MacBook pro has been doing great.  Anyone else having issues with safari?

    Safari just hangs up and has to be restarted.  My Macbook Pro has been doing great.  Just iMac.

  • Restore an ASM file

    Hi, 10g R2 on Unix I try to copy an Archived log but it fails : RMAN> run{ 2> 4> set archivelog destination to '/home/oracle/'; 5> restore archivelog sequence=364825 thread=1; 6> } using target database control file instead of recovery catalog alloca