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

Create XML file

former_member384574
Active Participant
0 Likes
3,398

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
Read only

geert-janklaps
SAP Mentor
SAP Mentor
3,126

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
Read only

geert-janklaps
SAP Mentor
SAP Mentor
3,127

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

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,126

It depends how it looks like, etc.

Read only

ziolkowskib
Active Contributor
3,126

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

Read only

former_member384574
Active Participant
0 Likes
3,126

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

Read only

0 Likes
3,126

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.