Message Mapping : content based target structure generation

Hi Team,
As per my requirement , mapping should generate target structure based on one "field" value in source srtucture.i.e target structure should generate for some of the custid values  , not for all cust id's . also I dont want empty files .
Source:
MT_SOURCE
-Custid
-CustName
Target:
MT_TARGET
-Custid
-CustName
But I want to generate Target structure MT_TARGET only for custid values' 001,002,003 ; for remaining values I dont want to generate target structure MT_TARGET . Is it possible using graphical mapping.I think UDF is correct oprtion. can you provide sample code for this requirement.
Thanks.
Drumi

But I want to generate Target structure MT_TARGET only for custid values' 001,002,003 ; for remaining values I dont want to generate target structure MT_TARGET . Is it possible using graphical mapping.I think UDF is correct oprtion. can you provide sample code for this requirement.
might be it is helpful for ur requirement:
Custid + constant(001) +equals ->(first) if
Custid->then                                                 
Custid + constant(002) +equals-> else
First if ending -> Second if
Custid->then
Custid + constant(003) +equals-> Second else ->target Custid

Similar Messages

  • Calling Message mapping Dynamically based on a field value

    Hi gurus,
    I have
    1 source inteface
    1 target interface
    3 Message mapping programs based on the 1 source and 1 Target Interfaces
    I need to decide Dynamically as which message mapping program should be called based on the Input provided by the source system.
    For example:
    If the souce side file sends a field value=1 then message mapping 1 should be called
    If the source side file sends a field value=2 then message mapping 2 should be used...
    Pls provide me help on this ASAP.

    As ur source and target structures are always same, u should have used same mapping with multiple conditions instead of using three different mappings.
    Right now for ur requirement, in ID -> standard Interface Determination, u can use multiple interface mappings based on condition.
    Check heading "Specifying Conditions (for Multiple Inbound Interfaces)" here
    http://help.sap.com/saphelp_nw04s/helpdata/en/42/ea20e737f33ee9e10000000a1553f7/content.htm
    Regards,
    Prateek

  • BPM Message Mapping: "Cannot produce target element /ns1:BAPI...."

    Hi,
    A scenario File - BPM - BAPI call was developed, as described in blog 'RFC scenario using BPM' cfr. link
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
    The Mapping is as follows:
    MT_EDB_MATERIAL_REQ (1:1) --> BAPI_MATERIAL_EXISTENCE_CHECK (1:1)
    MATNR (1:1) -
    > MATERIAL (1:1)
    When executing the scenario, an error appears in the trace of SXMB_MONI, step 'Request Message Mapping'
    Cannot produce target element /ns1:BAPI_MATERIAL_EXISTENCECHECK. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd....
    I tried the following:
    1) import the XML-file into the testmapping: executed successfully
    File:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_EDB_MATERIAL_REQ xmlns:ns0="http://agfa.com/SD_EDB">
    <MATNR>15P6X</MATNR>
    </ns0:MT_EDB_MATERIAL_REQ>
    2) Removed the mapping on node level and left mapping only on element level (material): same error
    3) Activated the message mapping, interface mapping, determinations, etc again...:same error
    4) Removed the Interface Mapping and created it again: same error
    5) Compared the version ID of the Interface Mapping/message mapping in the Monitor trace with the version ID of the IR and saw that there was a difference.
    After the CPA full cache, SXI_CACHE full refresh and object refresh in the IB Administration, the differences remain, and also the error....
    Anybody an idea ?

    Hi
    >>>Cannot produce target element /ns1:BAPI_MATERIAL_EXISTENCECHECK. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd....
    The error clearly says that one of the occurrence value  for the target node mentioned is not coming from the source during mapping. The easiest way to solve the problem is as follows
    <b>
    First Execute the mapping as pointed out by "Raj" and the following steps.
    </b>
    1. Goto the Mapping Editor
    2. Double click on the target node that is causing the problem here BAPI_MATERIAL_EXISTENCECHECK.
    3.  Right click on the same node and select "DisplayQueue".
    4. View the Queue.
    5. YOu will find "Suppress" entries, which means a value is expected but no value is coming in.
    6.Go from right to left and check each node in the mapping and you will be able to trace where the suppress node comes from and take appropriate action
    regards
    krishna

  • Target structure generation using GUI mapping

    Hi Experts,
    I have two nodes in source  and one node in target structure .
    Source
    permanentemployee (0..n)
          name
          dept
    contract employee (0..n)
         name
         dept
    Target
    Employee (0..n)
        name
        dept
    If both nodes (permanentemployee  &  contract employee )are present in source then I should get two occurances of target..
    Please watch that I have same subnodes in permanentemployee  &  contract employee .
    Please let me know your thoughts.

    Hi Vamsi,
    Duplicate the target structure.
    then map
    permanentemployee (0..n) node to Employee (0..n) target node and fields should map to the target side fields [like name --> name and dept --> dept]
    and contract employee (0..n) node to Employee (0..n) target node [this is the duplicated node] and map the corresponding fields to tarhet fields. [like name --> name and dept --> dept]
    Regards
    Ramesh
    Edited by: Venkataramesh Boppana on Oct 8, 2009 12:43 AM

  • Mapping (content-based)

    Hi,
    I do not know how to proceed with a mapping.
    I have 1 source message and e.g. 2 target messages.
    Within one mapping program (I am using graphical mapping) I want to map a source message to exactly one message of the target messages based on a content of an element within a source message.
    e.g.
    <SourceMessage>
    <name>Peter</name
    <surname>Smith</surname>
    </SourceMessage>
    So if the name element in the source message has a value "Peter", I want to map the source message to the structure of a target message #1. If e.g. the name element has a value "George" then I want map the source message to the structure of target message #2.
    It's a kind of content-based mapping, but I do not know how to proceed it.
    thank you
    Tomas

    Hello,
    make a target field mapping for both of the possible target fields, use "equalsS" from the Function Category Text to check the content of the qualifier-field (name) and then "ifWithoutElse" from the Function Category Boolean to map the content or not.
    Regards
    Rainer

  • Message Mapping of Recursive Source Structure?

    Hello,
    a mapping needs to be implemented from a custom source structure to an IDoc. An XSD has been provided for the source structures which contains recursive elements --> an element of a specific type contains another element with the same type.
    If I import the XSD then the type of the recursive element is displayed in "red", but I still can expand it. If I want to use the source structure in the message mapping I cannot expand the recursive elements anymore. Does anyone of you have an idea how to handle this? I want to avoid XSLT if possible.
    Thank you!

    Hi again Florian,
    please have a look at [Structure Overview in Message Mappings on SAP help|http://help.sap.com/saphelp_nwpi71/helpdata/en/e3/92be7c6cd34fd485c967144e302fb6/content.htm]. There is a paragraph on Recursive Structures:
    ...It is possible to map these elements in the mapping editor in a rudimentary fashion by using the context menu to expand a specific number of subnodes and then use them in target-field mappings...
    That works for both source and target message.

  • Error in message mapping - Cannot produce target element

    As one step in my integration process, I am builing a very simple file to BPM integration (inbound MI async, outbound MI abstract).
    The source type and the target type are completely equal - I am only doing some modifications to some of the content.
    The type for both messages - source & target message - is an imported external definition (DTD), and hence no DT or MT are created.
    As a first step I am trying to fill the target message with the content from the source message (without any modifications to the content). However, when testing this in the message mapping area, I get an error message already when filling the first element, the 'root node'.
    The error message is as follows:
    Start of test
    Compilation of <MM name> successful
    Cannot produce target element <elementname>. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd Cannot produce target element <elementname>. . Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
    End of test
    Any suggestions?
    Thanks,
    C

    Thanks,
    when creating the source message manually in the MM it worked - so nothing wrong with the mapping.
    I saved this file and compared with the "original file" - containing the content which I wanted to upload, and on which the xsd (external definition) was based - and there where some inconsistancies.
    I changed some values in the source XML which made it work, also when uploading the file from a drive.
    So, I will go back to the source system and try to get a better XML.
    Thanks for now!

  • Changing datatype, afterwards Message-Mapping cannot produce target element

    Hi,
    we use PI/700.
    I changed a working system by changing a datatype of an existing message (adding a new element). My interface mapping contains two mappings: an XSL-Mapping and afterwards a Message-Mapping.
    My interface mapping looks like this:
    Message-Type A ->
          XSL-Mapping ->
    Message-Type B ->
          Message-Mapping ->
    Message-Type B
    When I test each mapping alone everything works fine (with the new element I added).
    But if I test my interface mapping in IBD with both mappings together, I'll get an error:
    "Cannot produce target element /MT_EDM_OUTBOUND_LASTGANG_TO_SAP/LASTGANG/MASSEINHEIT. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd".
    Is it possible that XI has problems in refreshing the XSDs?
    I tried this:
    (1) I changed my Message-Mapping and now all elements are mapped 1:1 -> no success!
    (2) Later I changed my Message-Mapping and build in "exists" with "if" to check whether the element "MASSEINHEIT" is generated by the XSL-Mapping -> It doesn't exists (??? - WHY? - when I test it, everything works fine)
    (2) Afterwards I changed my interface mapping and take only the XSL-Mapping (without the following Message-Mapping) -> the element "MASSEINHEIT" exists now!
    I'm totally confused!
    Any ideas?
    Regards
    Wolfgang Hummel

    Hi,
    If you have made structural changes to the data type..such as number of fields have decreased/increased..or some new fld altogether, then you have to activate the datatype..goto message mapping and then re-do the mapping...but if you have made "typo" changes like names have been changed, etc..then i think it should be alrite..i have sometimes made changes to my datatype, but after activating it, i had to redo the mapping..that was it!...the rest would fall into place:) No changes had to be made in the interface mapping..
    Regards,
    Sushumna

  • Message mapping not generating target fields

    hi
    iam doing jdbc--->rfc (bpm) created a one2one message mapping to import rfc table.
    thanks in advance
    sri

    Hi Sri Rao,
    Since you have created a one to one mapping, it would be required to map all the fields in your target message to ur source fields. In case there r some target fields which do not relate to your source field, map it onto a constant. This is all that is required to be done from what i understand from your query. In case there r further problems send the source n target data structure n i will be able to help you out better.
    Cheers,
    Christina

  • 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

  • Message Correlation - Content Based - xCBL documents

    Hello B2B Gurus
    We have xCBL documents being exchanged between trading partners, How do you correlate messages?
    1. I have also refered to the following tutorials which refers to "Message Correlation End to End"
    http://www.oracle.com/technetwork/testcontent/b2b-tu-001-b2b-bpel-133467.pdf
    2. technical note on "IP_MESSAGE_TYPE"
    http://www.oracle.com/technetwork/testcontent/b2b-tn-008-ip-message-type-129343.pdf
    Can you please explain for a Purchase Order scenario how does Content Based message correlation occur?
    Thanks

    You need to provide appropriate Xpath's in Correlation tab of Document Definition. Stay tuned and soon I should post more details here.
    Regards,
    Anuj

  • Message Mapping on the  Target side

    Hi
    I am working on Proxy to SOAP in PI 7.1, and have node which is defined on the target side as Unbounded (table)
    Here is the structure of the table that has been defined on the target side,
    CodeList - 0- Unbounded (Table)
        Id                               XSD Id
        CodeList Name           String
        CodeList Version         String
        CodeListOwnerCd        String
    Source System(ECC) is not sending any values and the values which needs to be assigned to the above structure are fixed on the target side,
    how can I assign multiple values to the Code List table
    Ex CodelistName Should contain ClaimsPartyRoleCdList, PolicyTypeCdLis ,  PaymentTypeCdList
    Please let me know how can I assign Multiple values to the target side table
    Thanks
    PR

    Hey
    You can easily do this via advanced UDF.
    Map the root node to the below UDF.Make sure that you have set the Cache as Queue for this.There will be no input values to this UDF
    //write your code here
    result.addValue(" ");
    result.addValue(" ");
    Map the underlying Nodes to the below UDF.Make sure that you have set the Cache as Context for this.There will be no input values to this UDF
    //write your code here
    result.addValue("3");
    result.addContextChange();
    result.addValue("4");
    result.addContextChange();
    I was able to acheieve the below XML by using the above two
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MI_Multiple xmlns:ns0="http://fxp.com">
       <Record>
          <First>3</First>
          <Second>3</Second>
       </Record>
       <Record>
          <First>4</First>
          <Second>4</Second>
       </Record>
    </ns0:MI_Multiple>
    Hope this works for you.
    Thanks
    Aamir

  • Target structure while creating amapping template

    Hi,
    I have a message mapping in which target structure is a External definition. When i try to create template based on mapping, i am having this message
    Selected target element must be assigned a data type or a complex type.
    Seems like i have to change the target structure as mapping templates can be defined only by using Complex type in external Definition.
    Should i change the External definition structure , if so what needs to be changed?
    Edited by: kalyan golla on Apr 11, 2011 5:56 AM

    HI Kalyan,
    How to create Mapping Template for External Definitions
    Change root tag in graphical mapping
    Article on Mapping template:
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50171256-1ee2-2a10-3f84-ddecf098f724
    Thanks,
    Bhupesh

  • Content based routing and XML with multiple objects

    I have some structure:
    <contracts>
      <contract>
         <department>1</department>
      </contract>
      <contract>
         <department>1</department>
       </contract>
      <contract>
         <department>2</department>
       </contract>
    </contracts>
    I need to route contract to 2 system based on <department> value:
    contracts/department = 1 --> System1
    contracts/department = 2 --> System2
    Will XI split my XML (based on Content Routing rules in ID) into 2 structures (with departmet=1 and department=2 accordingly) ?
    Or I have to perform 1ToN mapping? I don't like it bacause it will be diffucult to monitor hundred of messages.

    Alternatively if you donot like 1:n mapping and BPM.
    Create two message mappings in the IR
    1.Source :<contracts>
    <contract>
    <department>1</department>
    </contract>
    <contract>
    <department>1</department>
    </contract>
    <contract>
    <department>2</department>
    </contract>
    </contracts>
    Target:
    <contracts>
    <contract>
    <department>1</department>
    </contract>
    <contract>
    <department>1</department>
    </contract>
    Basically mapping generates a target structure which has only department 1.
    2.Same like step1 but the mapping should generate the XML with department = 2.
    Once requires steps are done in the ID , do the content based routing in the reciever determination and give the appropraite message mapping in the interface determination.
    That should your problem and also you will like doing it as it does not involve any split level mapping..:)

  • Content based Routing?

    Hi Forum,
    I've looked through the messages regarding content based routing or similar's but the answers did not satisfy my needs. I have an XSLT mapping from a flat file structure to an IDOC. To qualify the receiving system I have to do a database lookup in my XSLT mapping by a Java extension function with combining some of the inputfields. The result of this database lookup is the Receiver System. How can I use this result in the condition Editor for the receiver determination. I can only use here the Nodes from the inputmessage. Are there other ways to have access to a "global Container" where I can store the results from the databaselookup to use them here?
    Thanks for you patience
    Manfred Schmidt-Voigt

    Hi,
    If the outbound adapter is a j2ee adapter, you can write a module which performs the lookup in a database or what ever. Then alter the message and add the information looked up.
    The easy way would be to add an extra attribute on the root node and add the content of the lookup in this field.
    I whould though prefere to use add the information to my root node.
    If you are not that keen on adapter development, the send the message into a bpm where you perform a lookup. This could probably be performed useing one of SP13's lookup functions.  The BPM should only consist of a recieve and a send step. When sending the message you should be able to perform the routing.
    /daniel

Maybe you are looking for

  • How do I reinstall an application that appeared not to have installed?

    Yesterday I bought an application on the App  Store - I paid and the install button did its dance onto the Launchpad and I saw the download progress etc.  When all was completed I went to my Applications folder and there was no trace of the applicati

  • Help needed in refreshing a panel in  a JFrame.

    I have some problem in refreshing a panel of a window. Here I am writting the sample code bellow. My program contains 2 classes, one is "Test" other is "Testwindow". class Test contains main(),displays the buttons reading from the string array obtain

  • My Ipod Classic wont charge or turn on. Ive never had a problem with it before this.

    OK so long story short, I went to listen to my ipod this morning before school and it wouldnt turn on. I thought it might have died and didnt really think anything of it. When I was done with school i went to go turn it on again, still nothing. Now i

  • Photoshop cs4 installation problems

    hi im having big problems getting Photoshop on and off of my mac book iv tried to uninstall it (i did it complete wrong by dragging and dropping it in to the trash i now know that's not the way) iv put a post on the mac web site and was told to do th

  • Download songs from iPOD to second computer

    I have a main home computer that is my primary use machine. It has all my songs in the library. I also have a laptop which I would like to down load that library to. Does anyone have a clue how I get my empty library on my laptop reflecting my itunes