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

Mapp Xml file to abap structure

Former Member
0 Likes
1,441

Hi All ,

i have XML file and i want map it to abap structure ,

how can i do so ?

Best Regards

Joy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
985

Hi Joy,

U need to create a separate transformation program for that XML file using tcode STRANS.

Once u have created use it in ur program using statement CALL TRANSFORMATION.

Also go thru this documentation

.http://help.sap.com/erp2005_ehp_04/helpdata/EN/d4/eb703f781d4a18e10000000a114084/frameset.htm

Regards,

Lakshman.

Hi All ,

i have XML file and i want map it to abap structure ,

how can i do so ?

Best Regards

Joy

5 REPLIES 5
Read only

Former Member
0 Likes
986

Hi Joy,

U need to create a separate transformation program for that XML file using tcode STRANS.

Once u have created use it in ur program using statement CALL TRANSFORMATION.

Also go thru this documentation

.http://help.sap.com/erp2005_ehp_04/helpdata/EN/d4/eb703f781d4a18e10000000a114084/frameset.htm

Regards,

Lakshman.

Read only

Former Member
0 Likes
985

Hi,

try like this.

TYPES: BEGIN OF day,

name TYPE string,

work(1) TYPE c,

END OF day.

DATA: BEGIN OF week,

day1 TYPE day,

day2 TYPE day,

day3 TYPE day,

day4 TYPE day,

day5 TYPE day,

day6 TYPE day,

day7 TYPE day,

END OF week.

DATA xml_string TYPE string.

DATA result LIKE week.

week-day1-name = 'Monday'. week-day1-work = 'X'.

week-day2-name = 'Tuesday'. week-day2-work = 'X'.

week-day3-name = 'Wednesday'. week-day3-work = 'X'.

week-day4-name = 'Thursday'. week-day4-work = 'X'.

week-day5-name = 'Friday'. week-day5-work = 'X'.

week-day6-name = 'Saturday'. week-day6-work = ' '.

week-day7-name = 'Sunday'. week-day7-work = ' '.

CALL TRANSFORMATION ...

SOURCE root = week

RESULT XML xml_string.

CALL TRANSFORMATION ...

SOURCE XML xml_string

RESULT root = result.

Regards,

Vijay

Read only

abapdeveloper20
Contributor
0 Likes
985

Hi Joy,

Check this beauty.....

http://yiduanguang.itpub.net/category/538/57327

Thanks..

Read only

0 Likes
985

hi Lakshmiraj ,

Thanks this is very helpful link ,

there is principle how to build the XSLT file which i need to put in transaction STRANS .

(how to derive the XSLT from the XML file which i get - this can help when i get complex XML file ).

Best Regards

Joy

Edited by: Joy Stpr on Jul 21, 2009 12:56 PM

Read only

Former Member
0 Likes
985

Hi,

Please go through following link,

Thanjks and regards,

ShreeMohan