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

regarding the data from xml files

Former Member
0 Likes
397

dear experts,

i need to uploads the time machine recording data from xml file to the sap for this let me know the best way means which BAPI sud i use to fetch the data from xml file or i have to use report program for this ,after fetching the data in my own internal table will i use "HR_INFOTYPE_OPERATION" FOR updating the infotype 2011...or i have to go to in a different ways,,,,,plz help me ...

dear experts,

i need to uploads the time machine recording data from xml file to the sap for this let me know the best way means which BAPI sud i use to fetch the data from xml file or i have to use report program for this ,after fetching the data in my own internal table will i use "HR_INFOTYPE_OPERATION" FOR updating the infotype 2011...or i have to go to in a different ways,,,,,plz help me ...

2 REPLIES 2
Read only

Former Member
0 Likes
378

One easy way to upload XML data into an internal table:

types: begin of t_tabup,

  • insert structure for upload table here

end of t_tabup.

DATA: x_tabup TYPE STANDARD TABLE OF t_tabup INITIAL SIZE 0.

DATA: lv_xml_string TYPE string.

TYPES: t_xmltab(5602) TYPE c.

DATA: lx_xmltab TYPE TABLE OF t_xmltab,

lw_xmltab TYPE t_xmltab.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = w_fname

filetype = 'BIN'

has_field_separator = ' '

TABLES

data_tab = lx_xmltab

EXCEPTIONS...

IF sy-subrc <> 0.

" Display error message and abort processing

ENDIF.

  • Transform to internal table

LOOP AT lx_xmltab INTO lw_xmltab.

CONCATENATE lv_xml_string lw_xmltab INTO lv_xml_string.

ENDLOOP.

CALL TRANSFORMATION ('ID')

SOURCE XML lv_xml_string

RESULT tab = x_tabup[].

Hope this helps.

Read only

Former Member
0 Likes
378

SOLVED BY OWN