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

How to convert internal table data to specific XML format

Former Member
0 Likes
535

Dear All ,

I have used FM's ''SDIXML_DATA_TO_DOM' and 'SDIXML_DOM_TO_XML' to convert my internal table data as XML format. But I need specific XML output format. Please let me know what to do to get required specific XML output format.

Please let me know do we need to create custom transformations? If yes, pleae guide me how to create it as I ignorant in XML coding. I am verymuch thankful for your help. <removed by moderator>

Thanks

P.

Edited by: Thomas Zloch on Aug 17, 2010 5:26 PM - please do not offer p...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
464

Hi,

which netwaver release you have? With 7.0 (ERP 6.0) you are able to define so called SAP simple transformations. In ABAP it is called with CALL TRANSFORMATION. Look into the online help of this ABAP statement.

Here is also some sample code:

CONSTANTS:

c_tname_st TYPE string VALUE 'ZMB_TRANS1'.

CALL FUNCTION 'BAPI_MATERIAL_GET_DETAIL'

EXPORTING

material = matnr

IMPORTING

material_general_data = gwa_matgendata

return = gfd_return.

MOVE-CORRESPONDING gwa_matgendata TO gwa_matdetails.

gwa_matdetails-matnr = matnr.

APPEND gwa_matdetails TO git_matdetails.

CALL TRANSFORMATION (c_tname_st)

SOURCE material_list = git_matdetails

RESULT XML gfd_xstr.

IF display = 'X'.

CALL FUNCTION 'DISPLAY_XML_STRING'

EXPORTING

xml_string = gfd_xstr.

ENDIF.

The transformation can be defined in SE80 as well.

Kind Regards

Michael

Dear All ,

I have used FM's ''SDIXML_DATA_TO_DOM' and 'SDIXML_DOM_TO_XML' to convert my internal table data as XML format. But I need specific XML output format. Please let me know what to do to get required specific XML output format.

Please let me know do we need to create custom transformations? If yes, pleae guide me how to create it as I ignorant in XML coding. I am verymuch thankful for your help. <removed by moderator>

Thanks

P.

Edited by: Thomas Zloch on Aug 17, 2010 5:26 PM - please do not offer p...

1 REPLY 1
Read only

Former Member
0 Likes
465

Hi,

which netwaver release you have? With 7.0 (ERP 6.0) you are able to define so called SAP simple transformations. In ABAP it is called with CALL TRANSFORMATION. Look into the online help of this ABAP statement.

Here is also some sample code:

CONSTANTS:

c_tname_st TYPE string VALUE 'ZMB_TRANS1'.

CALL FUNCTION 'BAPI_MATERIAL_GET_DETAIL'

EXPORTING

material = matnr

IMPORTING

material_general_data = gwa_matgendata

return = gfd_return.

MOVE-CORRESPONDING gwa_matgendata TO gwa_matdetails.

gwa_matdetails-matnr = matnr.

APPEND gwa_matdetails TO git_matdetails.

CALL TRANSFORMATION (c_tname_st)

SOURCE material_list = git_matdetails

RESULT XML gfd_xstr.

IF display = 'X'.

CALL FUNCTION 'DISPLAY_XML_STRING'

EXPORTING

xml_string = gfd_xstr.

ENDIF.

The transformation can be defined in SE80 as well.

Kind Regards

Michael