Message Mapping - same structure
I have the Source and Target Structures are the SAME XML format.
Should I need a Message Mapping?
Should I need an Interface Mapping?
Please help me.
Thanks.
Bhavesh, to be precise the Source and Target Structures are cXML(We are doing this for a testing purpose). The cXML has been imported into the External Definitions.
>> Rohini, if your idea is just to sent the same file to the target system, i guess your solution is the same as the approach i have followed in this weblog.
it doesnt even mattter if you have imported your XSD, any dummy type created will do.
Ref:
/people/shabarish.vijayakumar/blog/2006/04/03/xi-in-the-role-of-a-ftp
Similar Messages
-
Message Mapping RFC structure to deep XML structure
Hello,
I have a message mapping I am struggling with. The outbound interface is an RFC with structure like this:
RFC_send_material
-material (1..unbounded)
--matnr
--meins
--brgew
-description (1..unbounded)
--matnr
--vkorg
--text
The inbound interface should look like this:
Materials_from_SAP
-material (1..unbounded)
--matnr
--meins
--brgew
--description (0..unbounded)
---vkorg
---text
My problem is to get all the description connected to the matnr together.
Examples with data:
Outbound rfc:
<RFC_send_material>
<material>
<matnr>100</matnr>
<meins>c1</code1>
<brgew>c2</code2>
</material>
<material>
<matnr>101</matnr>
<meins>c1a</code1>
<brgew>c2a</code2>
</material>
<material>
<matnr>102</matnr>
<meins>bv102</code1>
<brgew>addd102</code2>
</material>
<description>
<matnr>100</matnr>
<vkorg>NO10</sales_org>
<text>testing100</text>
</description>
<description>
<matnr>102</matnr>
<vkorg>SE10</sales_org>
<text>testing102</text>
</description>
<description>
<matnr>102</matnr>
<vkorg>DK10</sales_org>
<text>testing103</text>
</description>
</RFC_send_material>
The inbound file structure should then look like this:
<Materials_from_SAP>
<material>
<matnr>100</matnr>
<meins>c1</meins>
<brgew>c2</brgew>
<description>
<vkorg>NO10</vkorg>
<text>testing100</text>
</description>
</material>
<material>
<matnr>101</matnr>
<meins>c1a</meins>
<brgew>c2a</brgew>
</material>
<material>
<matnr>102</matnr>
<meins>bv102</meins>
<brgew>addd102</brgew>
<description>
<vkorg>SE10</vkorg>
<text>testing102</text>
</description>
<description>
<vkorg>DK10</sales_org>
<text>testing103</text>
</description>
</material>
</Materials_from_SAP>
So as you see, my problem is to get the correct description belonging to the material. Hope anybody can help with doing this in Message Mapping.
Regards,
PerHi PRW,
As Michal said correctly, it is hard to describe in words, so here are some pictures which I think is the solution of your problem.
Description mapping : http://www.flickr.com/photos/23639237@N02/3220030016/sizes/o/
VKORG mapping : http://www.flickr.com/photos/23639237@N02/3219181675/sizes/o/
Text mapping : http://www.flickr.com/photos/23639237@N02/3219182919/sizes/o/
UDF CODE : http://www.flickr.com/photos/23639237@N02/3219184005/sizes/o/
And the Final Reslut : http://www.flickr.com/photos/23639237@N02/3220035356/sizes/o/
Regards,
Sarvesh -
Please excuse me, this seems to be a very simple issue but being resonably new to message mapping I am having issues solving it.
Ok each field maps to a repeating structure in the target IDOC, I ahve duplicated the subtree in the Structure and mapped each of the fields.
_Source_ _Desired_ _Actual_
<header> <header> <header>
<line1> <line1> <line1>
<Field1> <Field1> <Field1>
<Field2> Message <Field2> <Field2>
<Field3> Mapping <Field3> <Field3>
<line2> ------> <line2> <Field4>
<Field4> <Field4> <Field5>
<Field5> <Field5> <Field6>
<Field6> <Field6> <line2>
Each lineNode has been mapped across, and the FieldNode's have been mapped to the line as well. I have had to map the lineNode to the fieldNode as well as I am duplicating the subtree for the fieldNode which is 1..N range.
My issue is all the fields are mapping into the first node and not maintaining their structure. The value in the fields is coming through correctly in the repeating structure but the node itself is misplaced.Thought it was solved ... it isnt...
To clafiry...
There are fields in the incoming structure that map into Nodes in the target structure ...
So Field1 in Line1 .... will actually become Field1Node in the target. To add addition complexity the target node is a repeating node, so used the copt subtree feature but I think it is loosing context.
So...
<lineNode1> -
> <lineNode1>
<field1> -
> <FieldNode1>
<field1 value>
<field1 constant> --- provided by PI
<field2> -
> <FieldNode2>
and so on .... basically the fields in the originating message and creating a bunch of nodes in the user exit, With some small constants to hardcoded in PI to add context to the value in the field.
A real example ...
<saleLine1> <saleLine1>
<saleValue>100</saleValue> <userExitGenericNode>
</saleLine1> <Value>100</Value>
<ID>SaleValue</ID>
</userExitGenericNode>
</saleLine1> -
Message Mapping Nested Structure to key node in JDBC XML SQL Structure
Hello everybody,
I'm facing the next problem, I have the following nested structure
<ns0:MT_Irdoc_ArchivoNested xmlns:ns0="http://ref.pemex.com/PI/FI/ArchivoIrdoc">
<Header id_consecutivo="">
<Transaction/>
<Header2/>
<Header3/>
<Header4/>
<Header5/>
<Detail>
<Transaction/>
<Detail2/>
<Detail3/>
<Detail4/>
<Detail5/>
</Detail>
</Header>
<NombreArchivo/>
</ns0:MT_Irdoc_ArchivoNested>
as you can see, Detail is a nested Node from Header Node, and Detail is with occurrence 0...unbounded, I need to generate a SELECT XML SQL Structure as follows
<StatementName>
<dbTableName action=u201DSELECTu201D>
<table>realDbTableName</table>
<access>
<col1/>
<col2/>
<col3/>
</access>
<key1>
<col4>val4</col4>
<col5>val5</col5>
<col6>val6</col6>
</key1>
</dbTableName>
</StatementName>
now my problem is that col4 and col6 are values mapped from Header fields values, and col5 mus be mapped from Detail2 field of Detail Nested Structure, and Detail is 0...unbounded so it can contain any number of values and must included in the key structure, I tried by mapping the Detail Node to the key1 node, so it will generate n numbers of key1 nodes to include in the query, and the Detail number of nodes are not constant so I can't generate key2, key3, keyn...., so what I need is to create n numbers of instances of key1 node, but the problem is that when the mapping try to generate the second instance of key1 node it gives an error in the fields that comes from Header structure, maybe I'm trying to solve my problem wrong, could anyone give some advices or direction?, thanks in advance.
Regards,
Julio CesarJulio,
After placing the below logic in the mapping editor
Details2 > SplitByValue> col5
Right click on the Details2 node and choose Context. By Default you will see Details, because Details2 is the child of Details node. I want you to choose the Parent of Details node, I believe that would be HeaderID, am I right?
If you don't want to do that then,
Details2 ---> Remove Context > SplitByvalue> col5 will do the trick!
raj. -
Message Mapping - Flat structure to more complex structure
Hi,
Whats the best approach to map from
<resultset>
<row>
<CONTENTS>H1xxx</CONTENTS>
</row>
<row>
<CONTENTS>P1-1xxx</CONTENTS>
</row>
<row>
<CONTENTS>P1-2xxx</CONTENTS>
</row>
<row>
<CONTENTS>H2xxx</CONTENTS>
</row>
<row>
<CONTENTS>P2-1xxx</CONTENTS>
</row>
</resultset>
to
<Payment>
<header>
<CONTENTS>H1xxx</CONTENTS>
</header>
<items>
<CONTENTS>P1-1xxx</CONTENTS>
<CONTENTS>P1-2xxx</CONTENTS>
</items>
</Payment>
<Payment>
<header>
<CONTENTS>H2xxx</CONTENTS>
</header>
<items>
<CONTENTS>P2-1xxx</CONTENTS>
</items>
</Payment>
i.e. map Contents to header if it starts with H, to item if it starts with P
Payment consists of one header plus the items that follow it.
I can't seem to get the contexts in the target message correctThanks for all responses.
Hi Baz!
Yes, I've looked at SplitByValue, could never get exactly what I wanted though.
Praveen, I'll give XSLT a go then.
Stefan, Unfortunately the source message is coming through the JDBC not the file adapter. I agree, a file would be much easier to handle with the advantage of the FCC options -
I have a message mapping scenario. I am trying to test something and for this I have the following Getpending Response as source and Target in message mapping.
When I try to test this in the Repository I am getting some error(listed below)
Note : I imported the below cXML into my respository in the external definition as an XSD(I used Altova XML spy to convert the XML into an XSD)
In the occurence I have given both source and target as 1.
Your assistance is greatly appreciated. Thanks lot.
Getpending Response cXML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">
<cXML timestamp="2005-01-12T16:00:18-08:00" payloadID="[email protected]">
<Response>
<Status code="200" text="OK"/>
<GetPendingResponse>
<cXML timestamp="2005-01-12T16:00:18-08:00"
payloadID="[email protected]">
<Header>
<From>
<Credential domain="NetworkId">
<Identity>AN01000000001</Identity>
</Credential>
</From>
<To>
<Credential domain="NetworkId">
<Identity>AN13000000259</Identity>
</Credential>
</To>
<Sender>
<Credential domain="NetworkId">
<Identity>AN01000000001</Identity>
</Credential>
<UserAgent>ANCXMLDispatcher</UserAgent>
</Sender>
</Header>
<Message>
<DataAvailableMessage>
<InternalID domain="PendingMessages">3738</InternalID>
</DataAvailableMessage>
</Message>
</cXML>
</GetPendingResponse>
</Response>
</cXML>
I am getting the following error
Start of test
Compilation of GetPendingResponse_DataREquest_MM successful
Document start
Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.ConnectException: Connection timed out (errno:238) com.sap.aii.utilxi.misc.api.BaseRuntimeException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.ConnectException: Connection timed out (errno:238) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:130) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68) Root Cause: java.io.IOException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.ConnectException: Connection timed out (errno:238) at com.sap.engine.lib.xml.parser.URLLoaderBase.resolveEntity(URLLoaderBase.java:148) at com.sap.engine.lib.xml.parser.XMLParser.scanDTD(XMLParser.java:1212) at com.sap.engine.lib.xml.parser.XMLParser.scanProlog(XMLParser.java:2678) at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2713) at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:162) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:132) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:142) at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:245) at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:276) at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:338) at com.sap.engine.lib.xml.parser.SAXParser.parse(SAXParser.java:125) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at com.sap.aii.mappingtool.tf3.rt.xparser.MTSaxHandler.run(MTSaxHandler.java:128) at com.sap.aii.mappingtool.tf3.rt.xparser.XParser.run(XParser.java:68) Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.net.ConnectException: Connection timed out (errno:238)
End of testHi Jenni,
This might help
Message Mapping - same structure
/people/shabarish.vijayakumar/blog/2006/04/03/xi-in-the-role-of-a-ftp
http://www.cxml.org/files/downloads.cfm
Thanks & Regards
Agasthuri Doss
Message was edited by: Agasthuri Doss Baladandapani -
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 appreciaHi,
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 -
Message mapping problem / experts needed / UDF?
Hello experts,
I have the following problem in a message mapping:
Source structure is as follows:
- Node a (min 1, max 999)
- Subnode b (min 0, max 999)
- Each Subnode b has the element "number" (1,1)
This structure must be mapped to the following target structure:
- Node c (1,999)
- Subnode d (0,999)
- Each subnode d has the following elements:
- e1
- e2
- e3
- e11
1 Source node a should create 1 target node c.
All numbers in all subnodes b of one source node a should be mapped to the e1, e2,...e11 elements of the target structure. As one target node d can only contain up to eleven numbers, there must be several d nodes.
I have already tried to create a UDF, but it does not work.
Any experts who would like to share their knowledge?
Thanks in advance.
CHRISTOPH
Edited by: Christoph G. on Apr 23, 2008 10:46 PMHello again,
meanwhile I have worked hard on it and I have found the solution (just one UDF (queue function) which gets the article numbers as well as constant(targetField). So the UDF covers the creation of the "groups" as well as the mapping of the article numbers.
It was really interesting and it made me ambitious to find the solution myself I do not have access to the system today, but I will post my solution as far as I have access again. Maybe you still want to search for a solution? It really may be fun, just like some kind of a puzzle game.
In order to make it more clear, here comes the source and target structure with an example. Let me once more explain it: In the source, there are positions, each with unlimited article numbers. Each position will create a targetPosition. The node "targetPosition" has the subNode "articlenrs" (unbounded). Articlenrs has 11 differnet elements, calles a1, a2, a3, ..., a11. That means, all article numbers from a source postion should be mapped to "groups of 11 target article numbers". Please be aware the there are 11 differnet target fields for article numbers: a1, a2, ... a11.
I think that' why the solution of Liang Ji and Rohit Kalugade will not work...
SOURCE
<position>
<articlenr> 123 </articlenr>
<articlenr> 456 </articlenr>
<articlenr> 4783 </articlenr>
<articlenr> 123 </articlenr>
<articlenr> 456 </articlenr>
<articlenr> 4783 </articlenr>
<articlenr> 123 </articlenr>
<articlenr> 456 </articlenr>
<articlenr> 4783 </articlenr>
<articlenr> 123 </articlenr>
<articlenr> 496 </articlenr>
<articlenr> 4783 </articlenr>
. (unbounded)
</positon>
<position>
<articlenr> 543 </articlenr>
<articlenr> 865 </articlenr>
<articlenr> 643 </articlenr>
</positon>
TARGET
<targetPosition>
<articlenrs>
<a1> 123 </a1>
<a2> 456 </a2>
<a3> 4783 </a3>
<a11> 496 </a11>
<articlenrs>
<articlenrs>
<a1>4783 </a1>
</articlenrs>
</targetPosition>
<targetPosition>
<articlenrs>
<a1> 543 </a1>
<a2> 865 </a2>
<a3> 643 </a3>
</articlenrs>
</targetPosition>
Thanks,
Christoph
Edited by: Christoph G. on Apr 30, 2008 10:20 AM -
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 appreciated.
Thanks,
Anitha.Hi bavesh...
thank you so much for very your quick responses..
i got xsd as source..based on xsd i created external definition for source xsd and i created outbound interface based on source external deifinition <b>MI_OUT_WearUnits</b>.
and i imported Idoc and exported as xsd and changed occurance to unbounded and again imported as external definition.
i did mapping between these two external definitions.
and i selected standard idoc for source and target interface for interface mapping and given message mapping of previous step.
In ID
sender agreement :
sender service :BS_external
sender interface :<b>MI_OUT_WearUnits</b>
receiver agreement:
receiver service :R/3
receiver interface : standard Idoc
Interface determination:
sender service :BS_external
sender interface :<b>MI_OUT_WearUnits</b>
reciever service :R/3
and clicked create
inbound interface : Standard IDOc
i am not getting Interface mapping which i created in IR.
i tried Enhance interface determination also..
please guide me....
waiting for your help.
regards
ram -
Message Mapping: button "map fields of same structure" is inactive
Hi!
Can some one please explain why the option within message mapping "map the same structure..." is inactive in my case?
Is that a bug?
I am on SAP NetWeaver 7.0 SP 14 .
Thank you!Hi,
It is because your JAVA jdk version.
Install jdk 1.4.17.
Carlos -
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. -
No mapping for Same structure in source and target
Hi Experts,
I want to transfer the source structure to two receivers . Here source and target structures are same so i dont need mapping.
My question is how many DT,MT and MI required .. mapping required or not.
Thanks in Advance
CShi CS,
here in your scenario as u have told that source and reciver are of same structure . definitely you didn't need any mapping . and you have to create two data type(one for sender and one for receiver) , two message types(one for sender and one for receiver)) , and two message interfaces(one for sender and one for receiver).
while creating message types it asks for data type and while creating message interface it asks for message type only . as the structures of sender and receiver are same then inspite of having two receivers we have to create ony one message interface on sender side . later the adapter will take care of further proceedings
but in case of configuration you have to import three business systems . one for sender and two for receiver systems . and you have to configure the communications channels accordingly. as per the receivers accepting the structures you have to use the relevant adaptors . -
Different Message Type, Different Namespace, same structure
Hi,
we have the scenario:
We have a message type (with our namespace) in a regular file-tofile scenario.
The sender is sending us an xml-file from his PI that has exactly the same structure and same xsd.
Except, that his message type name and namespace are different.
What is the scenario to get his message type and namespace mapped to my message type and namespace in a regular file-to-file scenario?
Thanks
hsHi, you could also remove namespaces with XMLAnonymizerBean, then you only need to adapt the message type.
Alternatively you can import the external definition of the message and create a mapping for that. You can reuse your existing message mapping, just do a copy and change the message type in the signature. Then you can correct structural inconsistencies automatically in order to adjust the mapping to the changed namespace and message type. Or even better, create a mapping template for the structure which you use in both message mappings. Like this, you have a separate interface and mapping for the file and thus a clear separation of message flow.
Regards, Martin -
Error while forming Structur in Message Mapping.
Hi ,
I have taken source payload from Moni and tried to test the Message mapping.
When i paste the Pay load in Test tab,under XML, my structure is getting well formed., But 3 feilds from structure is showing in Red color.
Please advice
Regards
DineshHi Dinesh,
Please cross check with filling the values into the test tab and display it in source xml format and copy in notepad and compare with the payload data there must be some tag problem.
Thanks!
Edited by: Sudhir Tiwari on Nov 25, 2008 2:20 PM -
SOAP Scenario-Sender and receiver having same structure- Mapping Required?
Hi,
We are having a SOAP to SOAP scenario. In that the sender and receiver are having same structure. Is it possible to by-pass mapping and just do the configuration from ID
Thanks and regards,
Siji AnupHi Siji,
AFAIK you can skip ESR development. Check the example in this blog When and how to create an scenario in SAP PI without mapping objects.
Regards.
Maybe you are looking for
-
Is there a risk that when I make a backup from one device, it overwrites the stored data from thoe other device? If I want to restore my iPhone and my iPad from the iCloud, will they be restored from the same stored data or from separate data?
-
List of Purchase Orders by Conditon Type
Hi, Does anyone know if there is a sap standard list where one can see purchase orders by condition type (at header and/or item level)? I don't see this field in t-codes ME2W or ME2N. Thanks in advance. Best Regards, Pedro Mariano
-
I am using Lookout 6.0.2 on a new Win XP desktop. The Lookout OPC client object is used for communications via Rockwell Software RSLinx's (Professional Rev 2.43.01.23) OPC server to ControlLogix PLC's over ethernet. In other words, the Lookout comm
-
Vendor partner function is overriding my output determination for PO email
I'm trying to get a PO emailed to the user who created the PO based on purchasing group. I configured output determination so that a message is correctly getting generated -- in MN05 I've got the purchasing group tied to the VU (user responsible) par
-
CMFCToolbar and CMFCMenubar displaying wrong tooltips
Quastion asked also on http://stackoverflow.com/questions/29800791/cmfctoolbar-and-cmfcmenubar-displaying-wrong-tooltips Hello. I am using Visual Studio 2010, but I suspect the bug is still present on the 2013 version, as I compared the winfrm.cpp fi