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

Internal table conver to XML file problem ?

Former Member
0 Likes
587

Hi, I used to http://www.sapdb.info/abap-programs-upload-excel-to-internal-table/ example code

XML output file

<Subscriber>

u2212

<item>

u2212

<CUSTOMERBIS>

<CUSTOMER_ID>ornek data 1</CUSTOMER_ID>

<EXTERNAL_ID>ornek data 2</EXTERNAL_ID>

<NAME>ornek data 3</NAME>

<ADDRESS>ornek data 4</ADDRESS>

<TOWN>ornek data 5</TOWN>

<POSTCODE>ornek data 6</POSTCODE>

<STATE>ornek data 7</STATE>

<CONTACT_NAME>ornek data 8</CONTACT_NAME>

<CONTACT_PHONE>ornek data 9</CONTACT_PHONE>

<CONTACT_POSN>ornek data 10</CONTACT_POSN>

<CONTACT_EMAIL>ornek data 11</CONTACT_EMAIL>

...........

.............

................

.............

Howto delete <item> </item> tag

Edited by: Burhan KARADERE on Feb 22, 2010 1:47 PM

Edited by: Burhan KARADERE on Feb 22, 2010 1:48 PM

Hi, I used to http://www.sapdb.info/abap-programs-upload-excel-to-internal-table/ example code

XML output file

<Subscriber>

u2212

<item>

u2212

<CUSTOMERBIS>

<CUSTOMER_ID>ornek data 1</CUSTOMER_ID>

<EXTERNAL_ID>ornek data 2</EXTERNAL_ID>

<NAME>ornek data 3</NAME>

<ADDRESS>ornek data 4</ADDRESS>

<TOWN>ornek data 5</TOWN>

<POSTCODE>ornek data 6</POSTCODE>

<STATE>ornek data 7</STATE>

<CONTACT_NAME>ornek data 8</CONTACT_NAME>

<CONTACT_PHONE>ornek data 9</CONTACT_PHONE>

<CONTACT_POSN>ornek data 10</CONTACT_POSN>

<CONTACT_EMAIL>ornek data 11</CONTACT_EMAIL>

...........

.............

................

.............

Howto delete <item> </item> tag

Edited by: Burhan KARADERE on Feb 22, 2010 1:47 PM

Edited by: Burhan KARADERE on Feb 22, 2010 1:48 PM

3 REPLIES 3
Read only

rainer_hbenthal
Active Contributor
0 Likes
536

Use call transformation, and instead of literal ID create your own XSLT.

Read only

Former Member
0 Likes
536

Si yo fuera tu haría la conversión talcomo la estás haciendo y luego haría un ciclo "LOOP AT it_datatab INTO wa_datatab." dentro del cual con un IF verifico la condición que me interesa, en este caso que al linea sea , y en ese IF hago DELETE it_datatab INDEX sy-tabix.

Espero te sirva de ayuda.

Saludos,

Dimas Salazar

Caracas-Venezuela

Read only

Former Member
0 Likes
536

I would do the same you are doing and after taht I would do "LOOP AT it_datatab INTO wa_datatab." and inside of it a sentence IF to verify what I want, in that case that line is equal to <item> or </item>, if taht's true I can doo DELETE it_datatab INDEX sy-tabix.

I hope it helps.

greetings,

Dimas Salazar

Caracas-Venezuela

P.S.: Excuse me, I wrote in spanish first that is my mother language.