Application Development 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: 

Create XML file

former_member384574
Active Participant
0 Kudos

Hi experts

For an interface,we need to create an XML file and save it locally. My question is: which will be the best way for the XML creation? Using xlst_tool or doing completely the file by hand?

Could you please help me?

Thanks in advance!

Regards

Rebeca

1 ACCEPTED SOLUTION

geert-janklaps
Active Contributor

Hi,

Personally I always use simple transformations or xsl based transformations. Creating an XML by hand is something I only had to resort to in a few special cases. (Dynamic format of XML file, but even in these cases it was not completely impossible to do it with transformations)

Best regards,

Geert-Jan Klaps

5 REPLIES 5

geert-janklaps
Active Contributor

Hi,

Personally I always use simple transformations or xsl based transformations. Creating an XML by hand is something I only had to resort to in a few special cases. (Dynamic format of XML file, but even in these cases it was not completely impossible to do it with transformations)

Best regards,

Geert-Jan Klaps

Sandra_Rossi
Active Contributor
0 Kudos

It depends how it looks like, etc.

ziolkowskib
Active Contributor

Hi rebeca,
As mentioned by Geert-Jan try to go for XSLT as often as possible as this is much clearer and more readable way than creating XML file "by hand" in ABAP. That said I admit there are cases in which you need to create a very simple XML wrapper with few tags only and at those occasions it is not a crime against ABAP society to create an XML "by hand" (at least IMHO).

Regards,
Bartosz

former_member384574
Active Participant
0 Kudos

Hello experts,

Thanks a lot for your support! I'm completely new working with xslt_tool, so I'm a bit lost... I've created all the structures and the final structures. When I check it in sourceCode tab, it seems to be good. But now I'm executing the program and it returns the following message "Invalid XML source". Should I need to create the report now? and how can I use this for the XML grneration? Thanks!!!

Regards,

Rebeca

0 Kudos

Please show your code.

Create the transformation with STRANS (XSLT_TOOL is the old name, I don't recommend it because it's misleading and incite people to choose XSLT instead of Simple Transformation which is less powerful but much faster). Call it with CALL TRANSFORMATION.

Please use the COMMENT button for comments, questions, adding details, replying to OP comment, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.