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.
Similar Messages
-
Message Mapping activation error-Source code has syntax errors in UDF
Hi all,
I wrote a small UDF for sum of 2 numbers:
import
udf.*
public String getsum(String a, String b, Container container) throws StreamTransformationException{
int c = Integer.parseInt(a);
int d = Integer.parseInt(b);
int e = packageDemo.getSum(c,d);
return e+"";}
In imported archives, i imported pack.jar
In D:\udf , I have packageDemo.java, packageDemo.class, aii_map_api.jar, pack.jar(has the other 3)
packageDemo.java :-
package udf;
public class packageDemo{
public static int getSum(int a,int b)
int c= a+b;
return c;
Did i miss anything?? Icant activate message mapping for 2 errors:-
1.package udf does not exist
2.Function getsum, Line 3:
cannot find symbol symbol : variable packageDemo location: class com.sap.xi.tf._xml_mm_int e = packageDemo.getSum(c,d); ^Note: /usr/sap/P7R/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd4214d3099dc11dd9470001d090e4bbe/source/com/sap/xi/tf/_xml_mm_.java uses or overrides a deprecated API.Note: Recompile with -Xlint:deprecation for details.Note: /usr/sap/P7R/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd4214d3099dc11dd9470001d090e4bbe/source/com/sap/xi/tf/_xml_mm_.java uses unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.2 errors
Edited by: NagaDurga Nannapaneni on Oct 16, 2008 1:07 PMHi ,
Think the error is coming because the content in imported archive is not being taken into message mapping at all...so package, class, method ..nothing is identified.
Can anyone suggest the solution..
Thanks,
Durga -
Hi,
The value coming from Idoc at source side is 6,999,432.08.
I want the value to be passed at target side as 6,999,432
I do not want .08
How i will do the message mapping. Can someone help me out.
Thanks,Ashish,
I have tested this and all works as you expect. I have also provided two examples due to confusion as to whether you want the decimal places. You stated in an earlier post 'I do not want .08, i want .00' but in your last post that 'Source Value be 22345.45 or 22345.78 or 22345.99.........target value should be 22345'
Two decimal places .00
LHS field_in --> floor (arithmetic function) to give you the integer value required (rounded down) --> format number (second arithmetic function and indicate a format of 0.00 to represent two decimal places) --> RHS field_out
Source Target
22345.45 22345.00
22345.78 22345.00
22345.99 22345.00
No decimal places (integer)
LHS field_in --> floor (arithmetic function) to give you the integer value required (rounded down) --> RHS field_out
Source Target
22345.45 22345
22345.78 22345
22345.99 22345
I hope this clears up your issue
Regards,
Mike -
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.
DrumiBut 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 -
Mapping problem with source structures in LSMW thru idoc
Hello,
I am using crmxif for bp saving. I have flat file with one line. But it has many segments. do i need to mapp all segments with different source structures.
Even for any other transactions with crm xifs, how to fill the segments . do i need to create source structures for all the segments.
do i need to create different flat files for all the segments filling. plz suggest with flat file, and source sturctures.
thanks
ramHi RAM,
Please refer notes 554635 and see if this helps.
regards,
Muralidhar Prasad Chatna -
Message mapping with dynamic node
Hi,
I am doing message mapping where my source structure is
<root>
<EmpCount>2</EmpCount>
<Emp>
<item>
<code>1</code>
<name>ABC</name>
</item>
<item>
<code>2</code>
<name>PQR</name>
</item>
</Emp>
<root>
If EmpCount is having value 2 then Emp node will have only 2 items
Target structure is flat structure like (something like fix file format)
<root>
<EmpData>EmpDetails</EmpData> occurrences 0...unbounded
</root>
With above sources data following is expected target sturcure
<root>
<EmpData>2ABC</EmpData>
<EmpData>3PQR</EmpData>
</root>
Here my query is how I can create more than one node to target structure with employee details.
I already tried with following Re: how to create target node a constant number of times
This help to get all 2 nodes of EmpData in target structure but it is showing only First value in both nodes. Following is output I am getting
<root>
<EmpData>2ABC</EmpData>
<EmpData>2ABC</EmpData>
</root>Sunil,
Please see the sample i/p and o/p payload. Also please let me know , is this the same u are looking for
I/P
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_Check xmlns:ns0="urn:hdmc:samplescenarios">
<EmpCount>2</EmpCount>
<Emp>
<Item>
<Code>1</Code>
<Name>A</Name>
</Item>
<Item>
<Code>1</Code>
<Name>B</Name>
</Item>
</Emp>
</ns0:MT_Check>
O/P
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_Check_Out xmlns:ns0="urn:hdmc:samplescenarios">
<Root>
<EmpData>2A</EmpData>
<EmpData>2B</EmpData>
</Root>
</ns0:MT_Check_Out>
Best regards,
raj. -
Message Mapping Logical Problem
Hi there I have an issue with my message mapping. My source structure looks like this.
IDOC
-Seg1
---Element1
---Element2
---Seg2
ElementA
ElementB
Ok so I have to map the IDOC to a flat file. Seg 1 is the Header and Seg2 is the Details. For each flat file there will only be 1 Seg1 but there can be X amount of Seg2s' in the flat file. My problem is mapping Element 1 to Element A. Element A has the value of Element 1 and 2 combined. It appears I cannot map a lower hierarchy to an higher hierarchy? I tried changing the context but with no luck.
Any idea?
Thanx,
JanMy problem is mapping Element 1 to Element A.
What do you mean by this? I guess you want the Element1 to appear with each Segment occurrence. If yes, you may use standard function useOneAsMany as shown.
/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
Regards,
Prateek -
Unable to test in message mapping test tab
hi all,
below is my message mapping test tab structure
and my xml file looks like below
I am unable to test this data in test tab of message mapping and my source structure becomes redHi Hareesh,
I tried what you said but not working -
Problem in Graphical message mapping
Hi all,
I am doing an HR file to file interface.I am struck in message mapping.Actually my source message type contain four structures i.e infotype00 ;infotype01;infotype02;infotype05;every infotype has one PERNNO,BEGDA&ENDDA along with other fields.in target i have to extact employee recors from these 4infotypes.Target structre is :EMPLOYEE
fields...
Now I had to generate as many employee as many unique PERNNO i.e if all four infotype has same PERNN then it is considered detail of one employee if any infotype has diff.PERNNO then we have to create one more employee record for that infotype.I used a custom functionUNIQUE and get all unique infotype then on the basis i was creating employee.i.e if 3 unique PERNNO then 3 employee record has to be created.It was working fine,But one new requirement came that I have to compare BEGDA of all infotype and if any infotype has BEGDA more than current date then for that PERNNO i dont have to create Employee records.i.e suppose for PERNNO 8 infotype0 has BEGDA more than current date then i dont have to create employeerecord for PERNO 8.This new requirement i am unable to implement.please guide me how to proceed further i.e after getting the unique PERNO.Please do the needful as its very urgent.
regards,
SaurabhHey saurabh,
once you are able to obtain unique PERNNO,
you need to use two date functions.
CurrentDate: It will return the system date(todays date).
CompareDate: It will take as input two values(as dates) and gives output based on their values.
output of comparedate funtion will be:
-1 if second value is greater than 1st value.
0 if second value is equal to the first.
1 if second value is less than the first value.
what you can do is take currentdate function as first input for comparedate.
BEGDA as second input for comparedate.
if the value is -1(i.e BEGDA is greater than current date SUPPRESS the node or else create the node)
make sure the format of current date and BEGDA are same. -
Message Mapping for multiple item levels
Hi,
My query is regarding message mapping
Example of source data structure & Target data structure
Source data Structure
<item>
--<no>1</no>
--<address/>
--<ITEMS>
----<item>
------<Name>a</Name>
----<item>
------<Name>b</Name>
<item>
--<no>2</no>
--<address/>
--<ITEMS>
----<item>
------<Name>c</Name>
----<item>
------<Name>d</Name>
Expected Target data structure
<Item>
-- <no>1</no>
-- <name>a</name>
<Item>
-- <no>1</no>
-- <name>b</name>
<Item>
-- <no>2</no>
-- <name>c</name>
<Item>
-- <no>2</no>
-- <name>d</name>
How I can map the '<no>' field to target '<no>' field to repeat value until to second sub item level occurance complete ?
Thank you
SateeshHi Sateesh,
Please see the solution below.
The are 2 contect changes you need to do on field level. Right click and go to context and select your context you need.
Context on ITEMS - Should be on Root Structure(In my mapping it is MT_Multiple_Item_Level_Source)
Context on Name - Should be on Item (The first Item Tag)
Good Luck.
Regards,
Jannus Botha -
Hello,
In my scenario I will do the following mapping with an source structure to an ORDERS05 Idoc:
file structure:
#E1EDP01|10|33|ST
#E1EDP20|33|20050823
inbound message:
<?xml version="1.0" encoding="utf-8" ?>
<ns:MT_ORDERS_OUT xmlns:ns="http:/ /ORDERS">
<E1EDP01>
<IDENTIFIER>#E1EDP01</IDENTIFIER>
<POSEX>10</POSEX>
<MENGE>33</MENGE>
<MENEE>ST</MENEE>
</E1EDP01>
<E1EDP20>
<IDENTIFIER>#E1EDP20</IDENTIFIER>
<WMENG>33</WMENG>
<EDATU>20050823</EDATU>
</E1EDP20>
</ns:MT_ORDERS_OUT>
MT_ORDERS_OUT to IDOC ORDERS05 :
E1EDP01 ___> E1EDP01
POSEX ____> - POSEX
MENGE ____> - MENGE
MENEE ____> - MENEE
E1EDP20 ______> E1EDP20
WMENG ________> - WMENG
EDATU _________> - EDATU
configuration of the file adapter:
recordsetstructure: E1EDP01,,E1EDP20,
keyfield: IDENTIFIER
E1EDP01.keyFieldValue = #E1EDP01
E1EDP01.endSeparator = 'nl'
E1EDP01.fieldSeparator = |
E1EDP01.fieldNames = IDENTIFIER,POSEX,MENGE,MENEE
E1EDP20.keyFieldValue = #E1EDP20
E1EDP20.endSeparator = 'nl'
E1EDP20.fieldSeparator = |
E1EDP20.fieldNames = IDENTIFIER,WMENG,EDATU
With this configuration, the result is only a mapping of the E1EDP01 fields.
I can't see the E1EDP20 fields in the IDoc.
Did I something wrong?
Regards
ChristophHello Shravan,
I guess my file adapter is not doing the correct conversion.
The payload of the inbound message must look as follow:
<E1EDP01>
<IDENTIFIER>#E1EDP01</IDENTIFIER>
<POSEX>10</POSEX>
<MENGE>33</MENGE>
<MENEE>ST</MENEE>
<E1EDP20>
<IDENTIFIER>#E1EDP20</IDENTIFIER>
<WMENG>33</WMENG>
<EDATU>20050823</EDATU>
</E1EDP20>
</E1EDP01>
my actuel payload looks like:
<E1EDP01>
<IDENTIFIER>#E1EDP01</IDENTIFIER>
<POSEX>10</POSEX>
<MENGE>33</MENGE>
<MENEE>ST</MENEE>
</E1EDP01>
<E1EDP20>
<IDENTIFIER>#E1EDP20</IDENTIFIER>
<WMENG>33</WMENG>
<EDATU>20050823</EDATU>
</E1EDP20>
Who can help me, with the conversion?
Christoph -
Creation of CDATA with message mapping
Hello all,
Is everyone absolutely sure that a cdata string cannot be created in the middle of an xml file using message mapping?
I have tried doing the XSL map in other blogs I even tried writing a whole XSL map in xml spy - yet xi complains about not finding this class file and that class file. I'm having a hard time believing that this is so hard to do in XI - especially when Microsoft web service implementation seem to long for data crammed into a string ( in my experience ).
Any help is GREATLY appreciated.
Thank you!!!
ScottHi Scott,
Pls follow the following steps to insert XML string into a single element:
Create a xsl file with the following data:
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <i><b>NSpace</b></i>>
<xsl:template match="/">
<namespace:name1>
<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text><xsl:copy-of select="<b>//namespace:name</b>"/><xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text><xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
</namespace:name1>
</xsl:template>
</xsl:stylesheet>
In the above code I have removed xmlns:p2="http://frik.bcc.com.pl" which is not needed.
Also you have to put '<b>//</b>' before the target element from where you want to start creating XML string over here it is <b>name</b>. And <b>name1</b> is the element you want to store the XML string in.
So anything in the element <b>name</b> will be stored in <b>name1</b>
Regarding the <b>namespace:</b> To find out the namespace test your message mapping between the source and the target without adding XSLT mapping. After testing click on <b>'SCR'</b> tab present on top of the target window. There you will see <b>ns1: or ns2:</b> attached to each element. Replace <b>namespace</b> in the above code with <b>ns1: or ns2:</b>. And replace <b>NSpace</b> in the above XSL Header with the namespace in the SCR of test map.
So the final XSL file will look like that:
<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <i><b>xmlns:ns1="http://sap.com/xi/HR"</b></i>>
<xsl:template match="/">
<<b>ns1:</b>name1>
<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text><xsl:copy-of select="<b>//ns1:name</b>"/><xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text><xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
</<b>ns1:</b>name1>
</xsl:template>
</xsl:stylesheet>
Dont forget to put '//' before the target element.
This should work. Or pls put the source and target xml struct and we will assist you further.
Regards,
Ashish -
RuntimeException in Message-Mapping transformation
Hi all,
I am doing a soap2rfc scenario in that i have 2 message mappings are there
there are SUM1_MM and SUM2_MM
Message mapping test(SUM1_MM)
Source test
<?xml version="1.0" encoding="UTF-8"?>
<ns0:SUMOUT_MT xmlns:ns0="urn://web2rfcsum">
<NUM1>12</NUM1>
<NUM2>13</NUM2>
</ns0:SUMOUT_MT>
target result
<?xml version="1.0" encoding="UTF-8"?>
<ns1:ZSUM2NUMBERS xmlns:ns1="urn:sap-com:document:sap:rfc:functions"><NUM1>12</NUM1><NUM2>13</NUM2></ns1:ZSUM2NUMBERS>
But i have seen an error in sxmb_moni
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
<SAP:P1>com/sap/xi/tf/_SUM1_MM_</SAP:P1>
<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
<SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>
<SAP:P4 />
<SAP:AdditionalText />
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack>During the application mapping com/sap/xi/tf/_SUM1_MM_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>
Please solve the problem your help is memorableHi Deviprasad,
It looks like a mapping error, test your mapping in IR with the payload from SXMB_MONI. You can refer michal's weblog on <a href="/people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios to test your mapping (in real life scenarios)</a>
In other words you copy the XML message from monitoring and exectute the mapping in Integration Builder with maximal trace to get the reason.
Regards,
Abhy -
Hi,
I have a question.
In a idoc to file scenario,idoc as a sender,.If the idoc is updated in r/3 system due to some change request after we finish the mesage mapping,what steps need to be followed to ensure the correct mapping.
Do we need to change the mapping.
Regards,
HarithaHello,
if just the values of your IDoc changed you don't have to change
your message mapping.
If the structure has changed you have to reload the metadata (idx2)
and the IDoc in your Repository and then update your message mapping with reloading your IDoc.
Regards
Patrick -
Message Mapping - Turn Off dtd validation
Hi,
I would like to know how to turn off dtd validation in a message map.
The source message type is based on dtd. When testing, I get the following error
java.io.IOException: Failed to load resource from the context classloader of the current thread! Loading from classloader was caused by: java.io.FileNotFoundException: D:\usr\sap\XYZ\DVEBMGS01\j2ee\cluster\server0\abc.dtd (The system cannot find the file specified)
I understand that the map requires the dtd to be present in the application folder. But, can I change some setting not to look up this file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MessageContainer SYSTEM "abc.dtd">Sorry Arvind. Not able to understand your question.
The problem we are facing is, when the input xml file contains DocType declaration with reference to a dtd, we get an error stating the dtd is not found in the j2ee application folder.
It works fine if the dtd is saved in the location. Also, it works fine if the DocType declaration is removed from the xml file. However, we are exploring an option where declaration is used but dtd is not available.
Is there any way to achieve this?
Thanks!
Maybe you are looking for
-
Hi Friends, I have simple req'. i have one date filed in OAF page...if user has change the date filed..means if he incresed by 2 days..then i need to call one procedure..if not no need to call.... first am picking that date field to by uusing prepare
-
Importing Word docs into RH10 & auto split headers into topics
Can RH10 import a Word document and auto split the headers into separate topics? In RH7, this capability was available, but I'm not seeing it in RH10.
-
IPod Touch not travel friendly - can't connect digital camera to it.
I thought the iPod Touch would be perfect for any trip... Until I went on a trip with it. Why doesn't Apple design a USB interface for the iPod Touch that plugs into the bottom of the unit, allowing digital cameras to to connect via USB through PTP?
-
Hi Folks , i got a litle problem with creation of objects. here's the story about . iv'e created an interface intf1 with filter and also several different classes that each one of them is implement the interface intf1 . let's say C1 ...Cn those are t
-
Is my bit rate too high?!
I'm new to DVDSP but thought I'd figured it out. I'm burning a 30 minute film, with 13 chapters, to HD-DVD. The simulation works fine, and the build and format seems to go through fine, but the resulting dvd works only on my computer (that I burnt it