2009 Jan 07 10:19 AM
Hi there,
Iu2019ve created a program to generate a xml file, using SDIXML_DATA_TO_DOM function. However it seems that is not working correctly because it generates an extra tag, that is called ITEM, whenever there is a table. However, every program example's that use that function, also generates that tag. Is it possible, somehow, remove it?
Many thanks,
Helena
Hi there,
Iu2019ve created a program to generate a xml file, using SDIXML_DATA_TO_DOM function. However it seems that is not working correctly because it generates an extra tag, that is called ITEM, whenever there is a table. However, every program example's that use that function, also generates that tag. Is it possible, somehow, remove it?
Many thanks,
Helena
2009 Jan 07 10:38 AM
2009 Jan 07 3:27 PM
Hi, Rimpa,
First of all, thank you for your interest
What I have is this:
<DOCID>
<ITEM>
<TYPE>AR</TYPE>
<NUMBER>1236544</NUMBER>
</ITEM>
<ITEM>
<TYPE>BI</TYPE>
<NUMBER>1254666</NUMBER>
</ITEM>
</DOCID>
And what I want is this:
<DOCID>
<TYPE>AR</TYPE>
<NUMBER>1236544</NUMBER>
</DOCID>
<DOCID>
<TYPE>BI</TYPE>
<NUMBER>1254666</NUMBER>
</DOCID>
I have a table DOCID with two fields: TYPE and NUMBER.
How must I define it to present the information as I wish.
My program is totally in ABAP and not in JAVA.
Thank you for your help,
Helena
2009 Jan 07 3:30 PM
Rimpa:
Small question...Why did you post ActionScript forums when this is an ABAP forum?
Greetings,
Blag.
2009 Jan 07 3:34 PM
Helena:
Actually I don't think it's wrong...
<DOCID>
<ITEM>
<TYPE>AR</TYPE>
<NUMBER>1236544</NUMBER>
</ITEM>
<ITEM>
<TYPE>BI</TYPE>
<NUMBER>1254666</NUMBER>
</ITEM>
</DOCID>
Here, <ITEM></ITEM> is being used to clearly separate <TYPE> and <NUMBER> by grouping them...<DOCID> is the main parent tag, so you can't have what you want...You should generate separate XML files for each group...Like...
<DOCID>
<TYPE>AR</TYPE>
<NUMBER>1236544</NUMBER>
</DOCID>
<DOCID>
<TYPE>BI</TYPE>
<NUMBER>1254666</NUMBER>
</DOCID>
Greetings,
Blag.
2009 Jan 07 5:17 PM
Hi, Alvaro,
I understand your point of view, but this xml file is not for our internal use, is to be send out to another enterprise, that does not want that tag.
However, we've already found a solution for our problem: instead of using the SDIXML_DATA_TO_DOM function, we use a xslt transformation.
See the next link:
[http://www.heidoc.net/joomla/content/view/15/31/]
Thank you for your interest,
Helena
2009 Jan 07 5:20 PM
Thank you for your interest
Not a problem -:) I'm glad you find a solution...BTW...Welcome to SCN! -;)
Greetings,
Blag.
2009 Jan 07 5:20 PM
Almost forgot...Please don't forget to mark your question as answered.
Greetings,
Blag.
2010 Mar 30 11:00 AM
Hi Helena,
I have the same problem. Iu2019ve tried to access to the link but itu2019s not work.
Please explain me how you can solved the problem.
Thanks in advance.
Regards.
Rosa.
2011 Jul 15 9:47 AM
2023 May 18 8:07 AM
Here is another solution,
Hex value for string <item> is '3C6974656D3E'
and for string </item> is '3C2F6974656D3E'
with trailing new line hex value is '0A'.
Some changes in this loop
LOOP AT it_xml INTO xml_tab-d.
REPLACE ALL OCCURRENCES OF '3C6974656D3E0A' IN xml_tab-d WITH ' '.
REPLACE ALL OCCURRENCES OF '3C2F6974656D3E0A' IN xml_tab-d WITH ' '.
APPEND xml_tab.
ENDLOOP.
Hope this helps,
Thanks
Sitesh Sawant.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |