Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Call Transformation - how to parse multiple structures within XML --

Former Member
0 Likes
560

I have an XML string - it's basically the return XML from a PDF.

In it, I have a flat structure like LFA1 and a table like LFB1.

I've researched and have been able to bring my data back in to the LFA1 structure


  CALL TRANSFORMATION id
  SOURCE XML lv_xml_data_string
  RESULT ls_lfa1 = ls_lfa1.

However, I also have an LFB1 table in my XML string - I can see the data in the XML broswer.

How do I get that data into my LFB1 table from the XML string?

2 REPLIES 2
Read only

Former Member
0 Likes
390

Hi,

Usually, to this case I will create a deep structure including the structure of LFA1 and LFB1, and by calling SAP transformer ID, I will get LFA1 and LFB1.

BTW, you XML strucuture should also be like this:

<ROOT>

|_ <LFA1>

|_<LFB1>

Otherwise, transformer ID will not work.

On the other hand, you can use your own transformer, and you could speicfy the output parameters in the transformer.

Please check the following links also:

[http://wiki.sdn.sap.com/wiki/display/Snippets/ABAPProgramforCompressingandDe-Compressingatable|http://wiki.sdn.sap.com/wiki/display/Snippets/ABAPProgramforCompressingandDe-Compressingatable]

Cheers,

Edited by: NI SHILIANG on Mar 5, 2010 1:05 AM

Read only

mvoros
Active Contributor
0 Likes
390

Hi,

there are two standard XSL transformations (I don't have an access to any system right now and I don't remember names) which converts any data to XML and vice versa. These transformations work with tables. I don't know what format is used to encode data in your XML but I might be the same format. If it is same format then you just need to extract section with data and use these standard transformation to convert XML into data.

Cheers