Google Search - Blog...........

ABAP - Upload Data From Excel Sheet To Internal Table Using FM ALSM_EXCEL_TO_INTERNAL_TABLE.

REPORT ZTESTPROG.

TYPES: BEGIN OF ty_upload,
matnr like mara-matnr,
meins like mara-meins,
mtart like mara-mtart,
mbrsh like mara-mbrsh,
END OF ty_upload.

DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH header line.

DATA wa_upload TYPE ty_upload.

DATA: itab TYPE STANDARD TABLE OF alsmex_tabline WITH header line.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = 'C:\Documents and Settings\venkatapp\Desktop\venkat.xls'
i_begin_col = 1
i_begin_row = 1
i_end_col = 4
i_end_row = 65535
TABLES
intern = itab.

if not itab[] is initial.

loop at itab .

case itab-col.
when '0001'.
it_upload-matnr = itab-value.
when '0002'.
it_upload-meins = itab-value.
when '0003'.
it_upload-mtart = itab-value.
when '0004'.
it_upload-mbrsh = itab-value.
append it_upload.
clear it_upload.
clear itab.
endcase.

endloop.
endif.


ALSO READ:


RETURN TO MAIN INDEX


3 comments:

  1. Gracias Boli, me has salvado la vida con tu super molón blog.

    The Lion King

    ReplyDelete
  2. IN COMPLEX REPORTS HOW WE CAN NOT DISPLAY REDUNDANT DATA SIR

    ReplyDelete