cancel
Showing results for 
Search instead for 
Did you mean: 

Hello all,

Former Member
0 Kudos

I am having a complete XML in one source field and now I want to assign fields from that field to IDOC fields , can anybody give me suggestion for how to do this.

Regards,

keith

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

>>I am having a complete XML in one source field

How did you manage this? This is not possible in standard.

Do you have the input like

<b><?xml version="1.0" encoding="utf-8" ?>

<ns:MT_File xmlns:ns="http://sap.com">

<a>

<?xml version="1.0" encoding="utf-8" ?>

complete idoc in XML tags...

</a>

</ns:MT_File></b>

If this is the case, then the input is <b>not a valid XML</b>.

To solve this, you need to go for Java/ABAP mapping and create the XML structure. Msg mapping can not be applied here.

Regards,

Jai Shankar

Former Member
0 Kudos

Hello ,

Thanks everyone for all replies .

My source stucture will be :

Messagetypename

InFile(this will have complete XML file as a string)

/Messagetype

Can u people please suggest me how can I go for a java mapping . is it possible to ignore the first XML header which I will be getting .

Regards,

Keith

Former Member
0 Kudos

Hi,

if i understand correctly, u want to map the fields from a file to idoc fields.

ifso, create a datatype in IR with the fields of idoc, import the corresponding idoc to IR, in message mapping do one to one mapping. do ID configuration accordingly.

while testing the scenario give this xml file as input.

Ravi.

Former Member
0 Kudos

hello ,

I am having complete XML in <b>one source field</b>.

prateek
Active Contributor
0 Kudos

Just a suggestion.

U may parse the input structure using Java DOM or SAX parser. This could be done inside UDF. Then the output of the UDF can be mapped to various field of IDOC.

Or u may opt for Java Mapping

Regards,

Prateek

Former Member
0 Kudos

Prateek,

Another option would be to create an adapter module that replaces the original XML document with the contents of that field.

For an example on module development, see /people/francesco.bersani/blog/2007/03/27/rename-attachment-adapter-module

Kind regards,

Koen

Former Member
0 Kudos

Hi ,

there is one more option create a UDF and in that UDF separate the source string into various golobal container fields as per your requirement .Now Call this UDF for mapping first field in your target node . And for second node onwards you can directly refer to the global container where you have stored the values .

Thanks ,

Suvarna

Award pts if it helps .