Two 1-N relationships in target message

Hi
I am new to using the functions in message mapping and I was wandering if an expert could please offer me some help. I have a scenario where I need to produce two messages from the source message based on the number of line items for example, if there are 2 line items, the mapping needs to produce 2 messages from the source message. This part I have managed to get working fine.
The problem is that the target message has two 1-N relationships (i.e inside the header and payload) and am I am struggling to produce 2 MessageDestination nodes per message. The mapping that I am currently using only produces 2 MessageDestination nodes inside the first message and not the second message aswell (I am using the splitByValue function). Please see example below:
Source:
Message1
Header
-MessageDestination
--Destination[Destination1]Destination
-MessageDestination
-MessageDestination
--Destination[Destination2]Destination
-MessageDestination
Header
Payload
LineItem
-LineItem
--Line[Line1]Line
-LineItem
-LineItem
--Line[Line2]Line
-LineItem
Payload
Output:
MESSAGE1
Header
-MessageDestination
--Destination[Destination1]Destination
-MessageDestination
-MessageDestination
--Destination[Destination2]Destination
-MessageDestination
Header
Payload
LineItem
-LineItem
--Line[Line1]Line
-LineItem
-LineItem
--Line[Line2]Line
-LineItem
Payload
MESSAGE2
Header
-MessageDestination
--Destination[Destination1]Destination
-MessageDestination
Header
Payload
LineItem
-LineItem
--Line[Line1]Line
-LineItem
-LineItem
--Line[Line2]Line
-LineItem
Payload
The following is the required output that I need to produce (i.e. 2 MessageDestination nodes per target message):
Required Target / Output:
MESSAGE1
Header
-MessageDestination
--Destination[Destination1]Destination
-MessageDestination
-MessageDestination
--Destination[Destination2]Destination
-MessageDestination
Header
Payload
LineItem
-LineItem
--Line[Line1]Line
-LineItem
-LineItem
--Line[Line2]Line
-LineItem
Payload
MESSAGE2
-MessageDestination
--Destination[Destination1]Destination
-MessageDestination
-MessageDestination
--Destination[Destination2]Destination
-MessageDestination
Header
Payload
LineItem
-LineItem
--Line[Line1]Line
-LineItem
-LineItem
--Line[Line2]Line
-LineItem
Payload
Any help will be appreciated very much.
Thank you.
Edited by: Brendon Bouwer on Aug 24, 2009 2:28 PM
Edited by: Brendon Bouwer on Aug 24, 2009 2:31 PM

Source:
Message1
<Header>
<MessageDestination>
<Destination>1<Destination>
<MessageDestination>
<MessageDestination>
<Destination>2<Destination>
<MessageDestination>
<Header>
<Payload>
<LineItem>
<LineItem>
<Line>1<Line>
<LineItem>
<LineItem>
<Line>2<Line>
<LineItem>
Payload>
Current Output:
MESSAGE1
<Header>
<MessageDestination>
<Destination>1<Destination>
<MessageDestination>
<MessageDestination>
<Destination>2<Destination>
<MessageDestination>
<Header>
<Payload>
<LineItem>
<LineItem>
<Line>1<Line>
<LineItem>
<LineItem>
<Line>2<Line>
<LineItem>
Payload>
MESSAGE2 (Only one MessageDestination Node is being created, not 2)
<Header>
<MessageDestination>
<Destination>1<Destination>
<MessageDestination>
<Header>
<Payload>
<LineItem>
<LineItem>
<Line>1<Line>
<LineItem>
<LineItem>
<Line>2<Line>
<LineItem>
Payload>
The following is the required output that I need to produce (i.e. 2 MessageDestination nodes per target message):
Required Target / Output:
MESSAGE1
<Header>
<MessageDestination>
<Destination>1<Destination>
<MessageDestination>
<MessageDestination>
<Destination>2<Destination>
<MessageDestination>
<Header>
<Payload>
<LineItem>
<LineItem>
<Line>1<Line>
<LineItem>
<LineItem>
<Line>2<Line>
<LineItem>
Payload>
MESSAGE2
<Header>
<MessageDestination>
<Destination>1<Destination>
<MessageDestination>
<MessageDestination>
<Destination>2<Destination>
<MessageDestination>
<Header>
<Payload>
<LineItem>
<LineItem>
<Line>1<Line>
<LineItem>
<LineItem>
<Line>2<Line>
<LineItem>
Payload>

Similar Messages

  • Empty target message in 1 to n transformation

    I am using a ccBPM to handle a 1:n message scenario.  I believe I have done everything right:
    <li>I have created a message mapping where target message has an occurrence of u201C0..undboundedu201D.  When I test the message mapping it works 100% and produces multiple messages.</li>
    <li>I have created an interface mapping where the target interface also has an occurrence of u201C0..unboundedu201D.  I have tested it and it also works 100%.</li>
    <li>In my ccBPM I have two container elements, one representing the source message and a second container that has the correct abstract interface and which is marked as a multiline container.</li>
    However, if the message is processed in the ccBPM, I can see in the workflow log that the target message is empty in the transformation step.
    Can anyone tell me what I could have done wrong or how I can debug it further to tell what the source of the problem is?

    Hi Everyone
    I found out what the problem was.  When one tests the mapping in the graphical mapping tool, you will notice that SAP automatically puts your message inside two tags: <messages><message1></message1></messages>.  These tags make sense of course, but the problem was that I put my message inside these tags manually before sending it to the transform.  The result was that my message that had already contained the message tags was put inside yet another set of message tags.  That is why my transform did not work.
    I hope this will help you solve your problem if you encounter a problem similar to mine.

  • Target message based on the city name

    hi my source message schema is like this.based on the city name the target file will be created at the same time records to that particular city only.
    <Record>
          <person>ramesh</person>
          <City>xx</City>
          <Address>xyz</Address>
       </Record>
       <Record>
          <person>suresh</person>
          <City>yy</City>
          <Address>abc</Address>
       </Record>
       <Record>
          <person>ajay</person>
          <City>yy</City>
          <Address>def</Address>
       </Record>
       <Record>
          <person>kirshna</person>
          <City>xx</City>
          <Address>ghi</Address>
       </Record>
    target message schema will be like this.
    <City>
    <Record>
    <person>ramesh</person>
    <Address>xyz</Address>
    </Record>
    <Record>
    <person>kirshna</person>
    <Address>ghi</Address>
    </Record>
    </City>
    <City>
    <Record>
    <person>suresh</person>
    <Address>abc</Address>
    </Record>
    <Record>
    <person>ajay</person>
    <Address>def</Address>
    </Record>
    </City>
    iam getting correct only when same city records giving together.its creating another city record if i gives differently...how to achieve this

    hi for my above source schema..when iam doing mapping iam gettin like this
    <City>
    <Record>
    <person>ramesh</person>
    <Address>xyz</Address>
    </Record>
    </City>
    <City>
    <Record>
    <person>suresh</person>
    <Address>abc</Address>
    </Record>
    <Record>
    <person>ajay</person>
    <Address>def</Address>
    </Record>
    </City>
    <City>
    <Record>
    <person>kiran</person>
    <Address>ghi</Address>
    </Record>
    </City>
    here 3 city header files are creating with city name instead of two header files..here source side Iam using only two city names...so i want two header files target side...

  • Split source message into multiple target messages

    Hi Experts,
    I have a scenario where a source message needs to be split up into multiple messages for the corresponding target systems.
    One source system and three target systems.
    Source system is a .Net application
    Target systems - SAP R/3, Two webservices on different application systems
    Can i implement the scenario above using BPM in the following manner?
    Source->WS Adapter->PI-->RFC Adapter->SAP R/3
    Source->WS Adapter->PI-->WS Adapter->Target 2
    Source->WS Adapter->PI-->WS Adapter->Target 3
    I could have a webservice at the source which would be called by the .Net Application
    Webservice request would be passed to an integration process which would split the message for the three target systems specified.
    Correct me if am wrong.
    Also please get back to me if you need more inputs
    Regards,
    Kalyan

    Hi,
          You can implement the same with out using the BPM itself...
    you can use either of the below options
    1. if target messages are optional like based on certain conditions if you need to route the message to the particular targets
    then you can use multimappings for the same which generates the mappings based on the condition for the particular target.
    2. if each incoming message needs to be routed to the three receivers each time then configure the three receivers at the receiver determinations one for each target...
    3. if you are using the same business system for all the three receivers then create the three interface mappings and configure the same at the interface determination level so that for each message three target messages will be generated and send to target...
    HTH
    Rajesh

  • Problem in creation of target with the generated target message

    Hi,
    I’m doing File-to-File content conversion scenario.
    I’m able to see successful message in SXMB_MONI. Target message also created (Request Message Mapping) according the requirement.
    I’m using lastfieldOptional option in source content conversion.
    Adapters are running fine without content conversion failure..
    But the target file is not created.
    Could you pls anyone gives the reason or suggest any other things I need to verify.
    Thanks,
    Venu.

    Hi,
    do you see any errors in adapter <b>message</b> monitor:
    http://hostname:portnumber/MessagingSystem/monitor/monitor.jsp
    Regards,
    michal

  • Getting the Source File name Info into Target Message

    Hi all,
    I want to get the Source file name Info into Target message of one of the fields.
    i followed Michal BLOG /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Requirement :
    1) I am able to get the Target file name as same as the source file name when i check the ASMA in Sender & Receiver Adapter , with out any UDF...............this thing is OK
    2) I took One field extra in the target structure Like "FileName" & I mapped it Like
                              Constant(" " )--UDF-----FileName
    I Checked the Option ASMA in Both Sender & Receiver Adapters
    Here iam getting the Target File name as same as Source file name + Source File name Info in the Target Field " FileName".
    I Dont want to get the Target File name as same as Source file name. I want like Out.xml as Target file name.
    If i de-select the Option ASMA in Adapters means it is showing " null" value in the target field "FileName".
    Please Provide the Solution for this
    Regards
    Bopanna

    Hi All,
    Iam able to do this by checking the Option ASMA in only sender adapter itself
    Regards
    Bopanna

  • Add file name to the element in target message

    Hi all!
    I try to configure scenario:
    Get all files from directory (it will not be the same number of file every time) and mapping this file to the ERP system. I use File adapter to do this. But what Is necessary I need to mapp the file name to the element in target message.
    I mean: When I have got the RFC structure imprted from ERP and there I have got the element "filename". I would like to put the file name of file which I mapping to this element. Next put the all file contents with file name to the ERP table.
    It is possible to do that??
    I found in sap help that I can keep file name in the message header to get the same target file name, but I wont to put file contents (with file name) to the ERP table not to another file.
    THX for all your opinions.

    The DynamicConfiguration fin inbound message:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="Directory">/usr/sap/PXD/put/archive</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileEncoding">ISO646-US</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileTimestamp">20061212T121622Z</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileType">txt</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">200610.TXT</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileSize">124</SAP:Record>
      </SAP:DynamicConfiguration>
    and for Response:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Response
      -->
    - <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileSize">124</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileType">txt</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileTimestamp">20061212T121622Z</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileEncoding">ISO646-US</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">200610.TXT</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="Directory">/usr/sap/PXD/put/archive</SAP:Record>
      </SAP:DynamicConfiguration>

  • Error in Message Mapping "Target message IDOC: ORDRSP.ORDERS02 does not exi

    Hi,
    I have joined newly to the team.
    When I tried to open one message mapping it throwinf follwing error...
    "Target message IDOC: ORDRSP.ORDERS02 does not exist in software component version ID: 44423362454456485465..
    Check whether the software component version ID: 44423362454456485465 is in Enterprise Service Repository. Import this version if necessary"
    Is there any impact because of which in the message flow?
    In my case some of the messages are failing with mapping error "runtime exception occured during application mapping com/sap/xi/tf/_SUS2MMOrderResponse_; java.lang.NullPointerException: while trying to invoke the method java.util.Map.get(java.lang.Object) of an object loaded from field com.sap.aii.map`"
    And some of the messages are processed sucessfully and they also using the same mapping program 'SUS2MMOrderResponse'.
    Could someone tell me is there any relation for the above error in XML messages and to the message mapping?
    Regards
    Baskaran K

    Could someone tell me is there any relation for the above error in XML messages and to the message mapping?
    The error mentions that you have used an IDOC in your mapping program which is not found in the ESR....you need to check if the IDOC is present in the ESR and is present under the correct SWCV.
    Once you have done the check do some dummy change to the mapping and activate it (if in DEV) and then check the CACHE.

  • I have registered Adobe CS, and every two/three weeks i get a message that I am using a trial version.  I provide my registration key, and the fun starts over in two/three weeks.  What is going on?

    I have registered Adobe CS, and every two/three weeks i get a message that I am using a trial version.  I provide my registration key, and the fun starts over in two/three weeks.  What is going on?

    I'm not sure what's happening. See if you can get some help from Web Chat here:
    Serial number and activation support

  • Searching a Field In Source or Target Message in Message Mapping

    Hey Guys,
                      I  came accross this peculiar behaviour and it keeps bugging me , I could search any field in source or target message in message mapping in PI 7.0 by copying the path( /ns1:MaestroAcreedores/Acreedores/ClaveDeGrupo or any idoc field /FIDCCP02/IDOC/E1FIKPF/BUDAT  ) but in PI 7.1 i cant , its giving me an error String /ns1:MaestroAcreedores/Acreedores/ClaveDeGrupo not found  , i can only search the field independently.Can anyone please help me out in this.

    Hi
    I am not sure whether it worked in 7.0 or not, but having checked myself i can confirm that it is not working in 7.1 in my system also.
    For alternative, you can check by changing into source text view where it will display as xml.  Here when you search the keyword, it would display you the hierarchy better than normal view.
    I dont think there is any other alternative. although I would say in the worst case scenario you would not have more than 10-15 occurrences of same element in an idoc.
    Regards
    Krish

  • Target Message for generation HTML email?? : Michal's Blog (2718)

    hey folks,
    I'm trying out the scenario described in Michal's blog <a href="/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter">XI: HTML e-mails from the receiver mail adapter ?</a>
    What should be the target message type/interface which is generated by XSLT mapping? If it is an message type containing relevant HTML tags (HTML, BODY, P, OL etc), is there any standard XSD/DTD for HTML tags..something similar to XSD for mail package?
    The XSLT mapping seems to generate a HTML code w/o any XML header (<?xml version="1.0" encoding="UTF-8"?>). Is an XML message w/o this header valid?
    I appreciate your help/inputs
    thx in adv
    praveen

    Praveen,
    it can be anything
    Reason is that the output of your XSL mapping will not be validated against the target XSD and so you can create a dummy messagetype or use the source itself as the target message type etc.
    Regards
    Bhavesh

  • No namespace tag in target message (Test Interface mapping)

    Hi,
    I'm doing a <b>IDoc to file</b> scenario, and I'm using <b>external definitions</b> and a XSLT mapping. When I try to test the mapping in Interface Mapping he maps it but I <b>can't see the tree view</b>, I only get the source code...
    <?xml version="1.0" encoding="utf-8"?>
    <SenderID/><ReceiverID/><DocumentDate>20051028090653</DocumentDate>
    <DocumentNumber>456184</DocumentNumber><TestIndicator>     P</TestIndicator>
    <Version>1.0/SSCC</Version>
    <Desadv><MessageReferenceNumber>81749973</MessageReferenceNumber></Desadv>
    I presume that there is a <b>namespace</b> tag <b>needed</b> like
    <ns:Desadv xmlns:ns="http://www.certione.com/RFDesadv/Schema">
    but I don't know what to do to have it added to the target message which is external definition Desadv with namespace http://www.certione.com/RFDesadv/Schema in the XSD...
    Any help would be appreciated!
    Kind regards..
    Message was edited by: Bart De Saedeleer

    Hello,
    Could you put your XSD definition ?
    And check your mapping because it seems that you don't have a root node in output.
    <?xml version="1.0" encoding="utf-8"?>
    <b><MYROOTNODE></b>
    <SenderID/><ReceiverID/><DocumentDate>20051028090653</DocumentDate>
    <DocumentNumber>456184</DocumentNumber><TestIndicator>     P</TestIndicator>
    <Version>1.0/SSCC</Version>
    <Desadv><MessageReferenceNumber>81749973</MessageReferenceNumber></Desadv>
    <b></MYROOTNODE></b>
    Regards,
    Chris
    Message was edited by: Christophe DUMONT

  • Multi-Mapping, only want to create target messages sometimes.

    Hi,
    I have a Multi-Mapping interface which maps a single incoming message to 3 target messages.
    Based on the contents of the incoming message I only want to create a single instance of the outgoing messages.
    The incoming message can have a repeating node of 3 types A, B or C. If there are multiple nodes of Type A then i need to create a single instance of one of the target messages and map the data in node A to this message, likewise for node B and node C.
    I cant figure out how to do this. If I map a constant to the MT level of the target message and there are no type C nodes then the message type for this is created blank. But if I try and use the CreateIf tool then I get a MT created for each type C node.
    Can anyone help with this?
    If this isn't clear I will try to explain more.
    Thanks

    Hi,
    Thanks for your answer, I tried what you suggested and while it is creating the MT for type A nodes correctly it is not creating the MT for type B or C nodes. I have tried messing with the context on the incoming field and not getting anywhere.
    I always seem to get almost there with this mapping but never what I am looking for.
    Gareth

  • Multiple target messages

    Hello,
    for our business process, we need to map a single source message to multiple target messages (of different message types).
    The (ABAP)mapping takes care of this mapping, so I put a transformation step after my receiver step, that invokes this mapping.
    What do I have to define after the transformation step: do I use a fork or a send-for-each-block or ... ? Since we're on SP15, can we use the "extended" option in the interface determination to facilitate our process ?
    Thanks for your answers !
    Kind regards,
    Frederik

    Hi,
    What is the SP that you are using. If it is XI 3.0 and SP less than 14 then it is not possible. You need to use Abstract interface.
    And why do you need Multimapping in the first place. You can do a simple mapping and in the receiver determination you can add more Business Server/System. Each Service/System you will have seprate IB interface and a separate Interface mapping.
    Hope this solves your problem.
    Thanks,
    Prakash

  • How to change the order of target message? kindly help

    Hi Experts,
              I have a source message with fields EmpNo, EmpName, Dept and joining date. The target message has the same structure but fields are in different order. That is, EmpName, Dept, EmpNo and joiningdate.
    How to achive the target message with message mapping and without using a different message type for target?
    Kindly help
    Thanks
    Gopal

    Hi Gopal,
    Try this one.
    1. Create Only one message type of target type.
    2. Go to XSD tab and export the "XSD" of the message type.
    3. Change the <xsd:sequence> element to <xsd:all>
    4. Then import the "xsd" in external definitions.
    5. Use the imported "xsd" and create Message mapping. Give both source and target the same message type from XSD.
    6. just Map one to one.
    Now you can get ur required target structure. Since it is <xsd:all> it will accept ur input file.
    Regards,
    P.Venkat

Maybe you are looking for

  • What is the datatype to store the value of variable of  UTL_HTTP.resp

    Hello, I am using Oracle 11g R2 SOE. I have table Called SMS consists of two columns (TEXT , RESPONSE) to store the value of variable of type UTL_HTTP.resp the datatype of TEXT column is varchar2. What should be the datatype of the column RESPONSE th

  • Problem with Caller ID N95

    After upgrading my N95 software to v12.0.013 then i got problem that the number appeare instead of the name which is stored in the cotact list . Anybody can help ?

  • 2.1 EA2: Date columns displayed wrong in Grid

    Hello Forum, I have an issue displaying the values of DATE columns. I have set NLS_DATE_FORMAT to "DD.MM.YYYY HH24:MI:SS" but every time information is displayed as 00:00:00 but only in the grid view. When I do a select sysdate from dual; and press F

  • HOW DO I FIX THIS ISSUE??

    I am trying to open a document on my Macbook Pro with Adobe Acrobat Pro from my teacher and it is a PDF file with videos within it. The videos are not loading and I do not know why! Can someone PLEASE PLEASE help me ASAP because I need to do my homew

  • SRM Contract status problem

    HI All,    I have created a contract in SRM. It was approved and showing the correct status in the SAP back end but in front end status showing as 'awaiting for approval'. Could any one let me know why status showing different and the solution. Regar