2009 Jul 20 11:45 AM
Hi All ,
i have XML file and i want map it to abap structure ,
how can i do so ?
Best Regards
Joy
2009 Jul 20 11:48 AM
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
2009 Jul 20 11:48 AM
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.
2009 Jul 20 11:50 AM
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
2009 Jul 20 11:54 AM
2009 Jul 20 9:43 PM
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
2009 Jul 21 12:29 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |