TYPES: BEGIN OF ts_tab,
matnr TYPE matnr,
maktx TYPE maktx,
meins TYPE meins,
END OF ts_tab.
TYPES: tt_tab TYPE STANDARD
TABLE OF ts_tab.
DATA: gs_tab TYPE ts_tab,
gt_tab TYPE tt_tab,
gt_exe TYPE STANDARD
TABLE OF alsmex_tabline,
gs_exe TYPE alsmex_tabline.
DATA: v_file TYPE ibipparms-path.
PARAMETERS: p_file TYPE string,
p_file2 TYPE string,
p_file3 TYPE string.
AT SELECTION-SCREEN ON
VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'P_FILE'
IMPORTING
file_name = v_file.
p_file = v_file.
START-OF-SELECTION.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1
i_begin_row = 1
i_end_col = 3
i_end_row = 3
TABLES
intern = gt_exe
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc EQ 0.
LOOP AT gt_exe INTO gs_exe.
CASE gs_exe-col.
WHEN 1.
gs_tab-matnr = gs_exe-value.
WHEN 2.
gs_tab-maktx = gs_exe-value.
WHEN 3.
gs_tab-meins = gs_exe-value.
ENDCASE.
AT END OF row.
APPEND gs_tab TO gt_tab.
CLEAR: gs_tab,gs_exe.
ENDAT.
ENDLOOP.
ENDIF.
LOOP AT gt_tab INTO gs_tab.
WRITE:/ gs_tab-matnr,gs_tab-maktx,
gs_tab-meins.
ENDLOOP.
matnr TYPE matnr,
maktx TYPE maktx,
meins TYPE meins,
END OF ts_tab.
TYPES: tt_tab TYPE STANDARD
TABLE OF ts_tab.
DATA: gs_tab TYPE ts_tab,
gt_tab TYPE tt_tab,
gt_exe TYPE STANDARD
TABLE OF alsmex_tabline,
gs_exe TYPE alsmex_tabline.
DATA: v_file TYPE ibipparms-path.
PARAMETERS: p_file TYPE string,
p_file2 TYPE string,
p_file3 TYPE string.
AT SELECTION-SCREEN ON
VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'P_FILE'
IMPORTING
file_name = v_file.
p_file = v_file.
START-OF-SELECTION.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1
i_begin_row = 1
i_end_col = 3
i_end_row = 3
TABLES
intern = gt_exe
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc EQ 0.
LOOP AT gt_exe INTO gs_exe.
CASE gs_exe-col.
WHEN 1.
gs_tab-matnr = gs_exe-value.
WHEN 2.
gs_tab-maktx = gs_exe-value.
WHEN 3.
gs_tab-meins = gs_exe-value.
ENDCASE.
AT END OF row.
APPEND gs_tab TO gt_tab.
CLEAR: gs_tab,gs_exe.
ENDAT.
ENDLOOP.
ENDIF.
LOOP AT gt_tab INTO gs_tab.
WRITE:/ gs_tab-matnr,gs_tab-maktx,
gs_tab-meins.
ENDLOOP.
No comments:
Post a Comment