Skip to Content
0
May 27, 2014 at 10:52 AM

How to upload a downloaded ALV XML

126 Views

Hi all,

in an ALV it's possible to make a local download to a XML (xmlns:alv="http://www.sap.com/ALV/2.6").

Is there a standard translation to upload this back again to an internal table?

Piece of the ALV XML:

<?xml version="1.0" encoding="UTF-8"?>

-<alv:BI_BS_XML xmlns:alv="http://www.sap.com/ALV/2.6"><VERSION>2.6</VERSION><FLAVOUR>C1F0S0S1S2R1I0</FLAVOUR><USER>BOERSS</USER><TIME>12:33:27</TIME><DATE>2014-05-27</DATE><REPORT>ZMYREPORT</REPORT><SYSTEM>DEV</SYSTEM><TITLE>My report title</TITLE>

Already able to upload it to xstring, but I specially want to know how to translate it to an internal table.

Code snippet:

REPORT zzupload.

PARAMETERS: p_file TYPE string.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

DATA: lt_filenames TYPE filetable.

DATA: lv_subrc TYPE i,

lv_lines TYPE i.

cl_gui_frontend_services=>file_open_dialog(

EXPORTING

multiselection = abap_false

file_filter = '*.xml'

default_extension = 'xml'

window_title = 'Open DBTAB file'

initial_directory = 'C:\temp\'

CHANGING

file_table = lt_filenames

rc = lv_subrc

EXCEPTIONS

file_open_dialog_failed = 1

cntl_error = 2

error_no_gui = 3

OTHERS = 4 ).

READ TABLE lt_filenames INTO p_file INDEX 1.

START-OF-SELECTION.

DATA: lt_file TYPE solix_tab.

cl_gui_frontend_services=>gui_upload(

EXPORTING

filename = p_file

filetype = 'BIN'

CHANGING

data_tab = lt_file ).

DATA lv_xml TYPE xstring.

lv_xml = cl_bcs_convert=>solix_to_xstring( lt_file ).

Thanks and best,

Sander