Functions at Message Mapping - Concatenate with If

Dear SAP Masters, please kindly help me to solve this case.
Please guide me how to achieve this :
Column1 = Sales Order number
Column2 = Sales Order Item number
Column3 = Sales Order Type
Column4 =
For each line, if Column3 start with "ZOR" then column 4 = concatenate Column 1 (SO No) with Column2 (SO Item No), else then Column4 = <blank>
Please kindly give me an idea.
Thanks,
GJ

Hi GJ,
what about something like this:
Let me know if it works.
Regards!

Similar Messages

  • How to use functions in Message Mapping

    Hi All,
           I am new to SAP XI. I don't know how to use functions in message mapping.     Can any body tell me how to use IF condition in message mapping.
         Please provide me a good link where I can get the details how to use those functions.
    Thanks,
    Srinivas.

    HI Srinivas
    Please take a look at these links,
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
    /people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    This will help you
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/190eb190-0201-0010-0ab3-e69f70b6c257
    http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/a8/bfc6373c8fea43bdb3541535bcbd43/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8a57d190-0201-0010-9e87-d8f327e1dba7
    This will give you a detailed Idea about Context
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db95f835c111d1829f0000e829fbfe/frameset.htm
    This will give more explanation on Queue
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/51a39490-0201-0010-5b9f-ae21e8b78195
    For understanding node functions this blog will help you
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    Not sure you can find a collection of all...
    Cheers..
    Vasu
    <i>** REward Points if found useful **</i>

  • Copy value function in message mapping?

    can someone help me understand copy value function in message mapping???

    Hi,
    Here's a good example providen yesterday by Mark in a thread.
    [Re: different contexts to different targets]
    And here's SAP help: [http://help.sap.com/saphelp_nwpi71/helpdata/EN/26/d22366565be0449d7b3cc26b1bab10/content.htm]
    Then play...
    Mickael

  • Message Mapping  - concatenate issue

    Dear all,
    I am making a message mapping with two structures:
    Source:                
    UF
    CNF
    I am creating a target message that will have a initial tag (  at the end of line if I don´t have this field ?
    Thanks,
    Regards,
    Fernando

    Hi,
    <i>How can I concatenate the fields to only one line without lost the tag control?</i>
    You could use the 'constant' function(from the available list of functions in the mapping editor) to generate the tags.
    <item><cUF>43</cUF><cNF>137530928</cNF></item>.
    1st function concatenate:
    1st input: <item> field
    2nd input: const <cUF>
    2nd function concatenate:
    1st input: output of '1st function concatenate'
    2nd input: substring(0,2)
    3rd function concatenate:
    1st input: output of '2nd function concatenate'
    2nd input: const </cUF>
    4th function concatenate:
    1st input: output of '3rd function concatenate'
    2nd input: const <cNF>
    5th function concatenate:
    1st input: output of '4th function concatenate'
    2nd input: substring(2,10)
    6th function concatenate:
    1st input: output of '5th function concatenate'
    2nd input: const </cNF>
    7th functon concatenate:
    1st input: output of '6th function concatenate'
    2nd input:constant </item>
    Hope this helps.
    Regards,
    Smitha.
    Message was edited by:
            Smitha Rao

  • How to use node functions in Message mapping !!

    Hi  Gurus,
    I have got one issue in message mapping, please can any one put some ideas on this !!
    Source Structure
    <Group_ZA>  0..unbound
         <D02_ZA>           0.. unbound
             ZA_01             0..1   - QA
             ZA_02             0..1      20
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1     QD
             ZA_02             0..1     40
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QN
             ZA_02             0..1     12
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QP
             ZA_02             0..1    60
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
          iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
         <D02_ZA>          
             ZA_01             0..1     QA
             ZA_02             0..1      20
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1     QD
             ZA_02             0..1     40
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QN
             ZA_02             0..1     12
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QP
             ZA_02             0..1    60
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
    iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
    <D02_ZA>          
             ZA_01             0..1    QN
             ZA_02             0..1     12
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QP
             ZA_02             0..1    60
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
    iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
    <D02_ZA>          
             ZA_01             0..1     QA
             ZA_02             0..1      20
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1     QD
             ZA_02             0..1     40
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QN
             ZA_02             0..1     12
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
         <D02_ZA>          
             ZA_01             0..1    QP
             ZA_02             0..1    60
             ZA_03             0..1
             ZA_04             0..1
         </D02_ZA>
    </Group_ZA>
    Target Structure
    ProductActivityNotification                                                       0..unbound
                          ProductActivity                                                             1..1
                                        Item                                                                 1..unbound
                                              Inventory                                                   0..1
                                                     UnrestrictedUseQuantity                    0..1
    The Group_ZA comes 'n' number of times and D02_ZA comes sometimes 5 times and sometimes 6 times etc.,
    ZA_01 field can come with 5 to 6 different values like 'QA','QD','QN' etc., sometimes ZA_01 comes only 3 times QA,QD,QN.
    if ZA_01 = 'QA' then only  we need to pass   ZA_02 value on to ''UnrestictedUseQuantity'' (target side),
    I mapped the fields, the vlaue ZA_02  passing properly on to 'UnrestictedUseQuantity' when D02_ZA comes 5 or 6 times, all the times 'QA'  value comes into ZA_01 field. In case if QA value missed or doesn't come from source, the Target side ' 'UnrestictedUseQuantity' field last value comes into last but one.
    Ex: QA value is in 3 times, but I have 4 source message on top. values comes into target side like
    20
    20
    20
    suppose to come like
    20
    20
    -- (Space)
    20
    Please required your valuable inputs in bit urget !!
    how to map field level please?
    Many Thanks in Advance
    Kind Regards
    San

    Petre:
    If you want to use standard functions then you try this:
    If-->currentdate -OR- Constant(01.02)
    currentdate -OR- Constant(02.02)   --> OR -->
    currentdate -OR- Constant(03.02)
    Then give some output
    Else give some output
    So give the output for the first two conditions to another OR and the result of the third to the same OR. So whenever the condition is true in any of the condition you will get the THEN value else you will get the ELSE value.
    ---Satish

  • Count-Function in Message Mapping

    Hey, trying to map following structures:
    message
    -m1
    --m11
    -m2
    --m22
    -m3
    --m33
    to
    message
    -m1
    --m11
    -m2
    --m22
    -m3
    --m33
    -f1
    --countItems
    The nodes m1,m2 and m3 can appear 1..unbounded. In target structure I would
    like to have the numbers of all nodes (m1,m2,m3).
    For example: In this source structure m1,m2,m3 appear only one time. In the
    field countItems I would like to have the number 3.
    I tried the count function, but it could only count the structure where I used it (in
    this case: f1).
    How can I count the above-mentioned nodes?
    thanks
    chris

    Hey,
    thanks for your answers.
    But I still couldn't understand how to do this. I open the message mapping for field f1, but the count function could only be set on an target-element, so where to set the counters for m1,m2,m3? Do I have to insert extra fields under m1..m3?
    If I do the counter would increment with every node, so if I have two times m1, in second tree of m1 a two will be insert. If I use the add function, only for these two tree the result would be three!
    @Gangisetty Vijaya Bhaskarudu
    Is this just one UDF? From where he knows, which nodes he have to count, if I have more than m1..m3, but only want to count this three?
    @ sasitharan
    same problem as mentioned above:
    this doesn't work:
    m1--count---\
    I can't use m1 as input for count! Or do I have a wrong count function?
    <b>....au damm, answered my own question. Of course. I use COUNTER and you use
    COUNT!!!!!!!!!!!! I will try this with COUNT!!</b>
    thanks
    chris

  • RFC Lookup's in message mapping fail with RuntimeException for no reason

    Hi guys,
    We have developed interfaces that execute a lot of RFC's from Message Mapping, by making use of RFC Lookup API.
    In ID, in the corresponding RFC Receiver Communication Channel we have set the number of maximum connections to 100.
    However, when a big number of Idocs with lots of items is sent to XI some messages fail in XI because mapping fails with a runtime exception that is not correct, since there is a return value found from the execution of the RFC function. And when I am testing the mapping in Test mode of XI IR, the mapping is executed successfully.
    Do you think that by increasing the maximum number of connections in Communication Channel, it will take effect?
    Evaggelos

    Hi Evaggelos,
    DECREASE, may be til 10.
    Regards,
    Udo

  • Query related message mapping: Play with queue.

    Hi
    i have a text file which i converting using File Content Conversion of file sender adapter. My file was very nested so i couldn't convert it the way i wanted i.e.
    <Header></Header>
    <Detail>
        <Weights></Weights>
    </Detail>
    <Trailer></Trailer>
    So now I m left with this kind of source xml:
    <ns: MT_REQ>
    <header>
    </header>
    <Detail>
    </Detail>
    <Weight>
    </Weight>
    <Weight>
    </Weight>
    <Detail>
    </Detail>
    <Weight>
    </Weight>
    <Weight>
    </Weight>
    <trailer>
    </trailer>
    And i want to map it to the same message type <ns: MT_REQ> but due to queuing of data it gives the following result:
    <ns: MT_REQ>
    <header>
    <Identifier>H</Identifier>
    </header>
    <Detail>
    <Identifier>D</Identifier>
    Identifier>
    </Detail>
    <Detail>
    <Identifier>D</Identifier>
    </Detail>
    <Weight>
    <Identifier>W</Identifier>
    </Weight>
    <Weight>
    <Identifier>W</Identifier>
    </Weight>
    <Weight>
    <Identifier>W</Identifier>
    </Weight>
    <Weight>
    <Identifier>W</Identifier>
    </Weight>
    <trailer>
    <Identifier>T</Identifier>
    </trailer>
    i.e. all detail together then weights and header trailer on top and bottom. Now the problem is there is no relation between the weights and detail except that in the monitoring it comes like
    1. First detail tag opens and closes with its data
    2  then weights which are the heirarchy  detail 1 open and closes
    3  then second detail opens and closes and then weights of second detail comes under it before any third detail tag opens
    So i was wondering if with the help of functions provided in the message mapping it will generate exact mirror image of my source  <ns: MT_REQ>  into the target  <ns: MT_REQ1> which is the exact replica of the former.
    I tried it with FormatByExample but dd not work. Is there any Userdefined function or something foe my problem.
    Please help !!
    Naina

    Stefen
    My Inbound file was coming correctly like this :
    record
    - detail
    - weight
    - weight
    record
    - detail
    - weight
    but when mapping to the target in same style it was going this way
    - detail
    - detail
    - weight
    - weight
    - weight
    so what i did...i asked the portal people to add an identifier to the details and weights so that i can read it and write a UD to finally map it correctly:
    - 1detail
    - 2detail
    - 1weight
    - 1weight
    - 2weight
    - 2weight
    it is working properly now....thanks to you all.....have given the points

  • Message Mapping Problem with UTF-16LE Encoded XML

    Hello,
    we have the following scenario:
    IDoc > BPM > HTTP Sync Call > BPM > IDoc
    Resonse message of the HTTP call is a XML file with UTF-16LE processing instruction. This response should then be mapped to a SYSTAT IDoc. However the message mapping fails "...XML Parser: No data allowed here ...".
    So obviously the XML is not considered as well-formed.
    When taking a look at SXMB_MONI the following message appears: "Switch from current encoding to specific encoding not supported.....".
    Strange thing however is if I save the response file as XML and use the same XML file in the test tab message mapping is executed successfully.
    I also tried to use a Java Mapping to switch encodings before executing message mapping, but the error remains.
    Could the problem be, that the codepage UTF-16LE is not installed on the PI system ? Any idea on that ?
    Thank you!
    Edited by: Florian Guppenberger on Feb 2, 2010 2:29 PM
    Edited by: Florian Guppenberger on Feb 2, 2010 2:29 PM

    Hi,
    thank your for your answer.
    This is what I have tried to achieve. I apply the java conversion mapping when receiving the response message - i tried to convert the response to UTF-16, UTF-8 but none of them has helped to solve the problem.
    I guess that using adapter modules is not an option either as it would modify the request message, but not the response, right?

  • Message Mapping Issue with data without namespace

    Hi,
    I have a common xsd imported which has its own target namespace into my SWC namespace. Based on this xsd I have generated a Message Interface and webservice and given the wsdl to third party system for invoking my webservice.
    The problem is I have done the message mapping based on xsd which has namespace but whereas the third party system which is consuming my webservice is sending the xml data without any namespace and because of which my mapping is failing (target structure is not getting generated as expected). I have tested the mapping with namespace and without namespace from IR already. I have explained this below with example.
    I cannot change the xsd as it is a common and even cannot ask the end system to change the data format they are sending as they are sending the same data to some other systems also, which are not complaining.
    How to resolve this issue in XI?
    Actual xml data generated from my imported xsd (with namespace)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Root xmlns:ns0="http://employee/types">
       <ns0:EmployeeDetails>
          <ns0:EmployeeId>12</ns0:EmployeeId>
            <ns0:EmployeeName>XYZ</ns0:EmployeeName>
    </ns0:EmployeeDetails>
    </ns0:Root>
    Actual Data coming from third party system (without namespace)
    <?xml version="1.0" encoding="UTF-8"?>
    <Root>
       <EmployeeDetails>
          <EmployeeId>12</EmployeeId>
            <EmployeeName>XYZ</EmployeeName>
    </EmployeeDetails>
    </Root>
    Thanks
    Amit

    Just  wild guess:)
    I am not 100% sure but i guess XSLT mapping does not checks the incoming payload against the sender message type.Within XSLT mapping you can add/remove namespace as you would like,use this XSLT mapping before your actual message mapping in interface mapping.
    I am saying this coz recently i was able to generate XSLT mapping(in altova Map Transform) without even specifying any sender or receiver Message type and it worked just fine.
    Thanx
    Aamir

  • Using useOneAsMany function in Message Mapping if subtree is optional

    Hi,
    I am trying to develop a message mapping for the following case:
    In the source message, there is a value "Value1" which is on the same level as a subtree "Struct2" which can occur 0..unbound times
    In the target message the value "Value1" has to be part of that subtree, so it has to be copied for each occurence of "Struct2" in the source message
    For the case that the subtree has cardinality 1..n there are some examples on the web, e.g. useOneAsMany (SAP-Bibliothek - Partner Connectivity Kit). But that does not fit my case. The subtree in the source message is optional here.
    See a screenshot of the message mapping and my solution for the mapping of "Value1" below:
    All other values are mapped 1:1.
    Sadly, this solution does not work when "Struct2" has cardinality 0..unbound, for 1..unbound it works perfectly. Here is my example:
    When I try the mapping, I get the following error message:
    That is true. The first queue of the useOneAsMany function has more values than the second. But I don't know how I can fix it, so that it works for my example. Can anyone give me a hint please?
    Setup is AEX 7.31.

    Hi Stefan,
    You can use this mapping.
    And for Struct2-Value1
    Result:
    Hope this helps,
    Mark

  • Message-Mapping Problem with empty queue while testing

    Hello,
    I want to develope an mapping to an BMEcat-structure. This mapping should be an filter.
    My problem is, that everytime I want to check, if my mapping works correct, the queues for the proccessing steps keeps empty.
    I filled a test case with all data I needed for the step I want to test (not the whole mapping is ready, but for this step, it is). Now I go to my mapping step an check the queue for the parameters and the queue comes up and displays the correct values. In next step I want to display the queue of an "equalsS"-Step, but this queue keeps empty as all following queues too. Sometimes there is coming up an empty "Processing log"-window.
    The problem only comes up, if the target-message is a BMEcat-Structure.
    Have you any solution for this behaviour? Or do you need more informations?
    Here you can find some Screenshots:
    http://www.gothsite.de/sapscreen/ScreenShot00113.jpg
    http://www.gothsite.de/sapscreen/ScreenShot00114.jpg
    http://www.gothsite.de/sapscreen/ScreenShot00115.jpg
    http://www.gothsite.de/sapscreen/ScreenShot00116.jpg
    http://www.gothsite.de/sapscreen/ScreenShot00117.jpg
    Edited by: Dirk Koch on Feb 6, 2008 12:00 PM

    Hello,
    thank you for your tip, but the main problem is still existing. As you can see in the next screenshots, I build in your code and I'm sure it normally works fine. Also I filled the "have to"-Fields in the strukture, so that the check-function (F7) delivers an all right.
    But still I get no queue results.
    http://www.gothsite.de/sapscreen/ScreenShot00118.jpg
    http://www.gothsite.de/sapscreen/ScreenShot00119.jpg
    For tests you can take these informations:
    http://www.gothsite.de/sapscreen/Z_RFC_EAN_CHECK_resp.xsd
    http://www.gothsite.de/sapscreen/bmecat_2005_XSDs.zip
    Edited by: Dirk Koch on Feb 6, 2008 12:56 PM

  • Message-mapping: sort  with subnodes

    Hello everybody,
    as far as i know (and tested) the SORT-function sorts just the node. The subnodes are not sorted.
    Sample:
    <B>
    <BField_1>
    <BField_2>
    <A>
    <AField_1>
    <AField_2>
    <u>after using the SORT:</u>
    <A>
    <<b>B</b>Field_1>
    <<b>B</b>Field_2>
    <B>
    <<b>A</b>Field_1>
    <<b>A</b>Field_2>
    <u>what I want:</u>
    <A>
    <AField_1>
    <AField_2>
    <B>
    <BField_1>
    <BField_2>
    Thanks, Regards
    Mario

    Hi Mario
    xml -> xml: take xsl:stylesheet subelement "xsl:output" for control (method="xml")
    xsd -> xsd: not possible. You need a instance for a mapping (should be clear as you dont have field values)
    map all source fields to target fields 1:1: take xsl:copy-of. Use attribute select. Put there a X-Path expression, for example '/', what means everything (but why do you use a mapping at all??)
    The copy-of command is very strong as you can copy well selected parts of your source message with very less code, just a little bit X-Path.
    Regards,
    Udo

  • Message Mapping - problem with target sequence

    Hi, I hope somebody can help:
    I have already read lots of blog entries and help articles to find a solution but all the tricks with node functions and special conditions didn't help yet.
    I would like the sequence of A and B nodes just as is. In the source structure they are on the same level and in the target structure B is subnode of A.
    Thank you very much in advance.
    Source structure:
    Node A
    - source fields A
    Node A
    - source fields A
    Node A
    - source fields A
    Node B
    - source fields B
    Node A
    - source fields A
    Node B
    - source fields B
    Node B
    - source fields B
    Target structure (desired):
    A
    - fields A
    A
    - fields A
    A
    - fields A
       B
       - fields B
    A
    - fields A
       B
       - fields B
       B
       - fields B
    However, what I get is:
    A
    - fields A
       B
       - fields B
       B
       - fields B
       B
       - fields B
       B
       - fields B
    A
    - fields A
    A
    - fields A
    A
    - fields A

    Hi,
    Can u try like this.
    Map one to one.
    Dont use  any node function also dont change any conexts also af any node or element.
    But in target,make node B is under node A, and both are 0..unbounded occurence.
    Try with this....
    Let us know the result.
    Babu

  • Node functions in Message Mapping

    Hi,
    Could someone help me with some good exercises for node functions such as splitbyvalue, collapsecontents, removecontexts.
    I am a newbie to these functions and have absolutely no idea on how to use them. Would appreciate if someone could give very detailed examples to these functions in a step by step manner, so that I can create them just by following your instructions.
    Any links to video presentations are welcome too.
    Cheers,
    S

    Hi ,
    For a fresher, the informationa and examples given in the help.com would be more helpful and it will help you in building string fundamentals. Once your basics and funcdamentals concepts becomes strong then you can go for more complex exmples. Here is help.sap link where you can leran Node functions of MM of PI.
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm
    Thanks,
    RK

Maybe you are looking for