1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
REPORT zmm_download_rule_nga. TABLES: ZRULE_NGA. PARAMETERS: p_upload TYPE rlgrap-filename. PARAMETERS: test TYPE flag AS CHECKBOX DEFAULT 'X'. TYPES BEGIN OF nga. TYPES asort TYPE zrule_nga-asort. TYPES class TYPE zrule_nga-class. TYPES rule_nga TYPE zrule_nga-rule_nga. TYPES END OF nga. DATA t_excel TYPE STANDARD TABLE OF nga WITH HEADER LINE. AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_upload. CALL FUNCTION 'F4_FILENAME' IMPORTING file_name = p_upload. START-OF-SELECTION. DATA: lt_raw TYPE truxs_t_text_data. CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP' EXPORTING * I_FIELD_SEPERATOR = * I_LINE_HEADER = i_tab_raw_data = lt_raw i_filename = p_upload TABLES i_tab_converted_data = t_excel EXCEPTIONS conversion_failed = 1 OTHERS = 2. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. LOOP AT t_excel. ZRULE_NGA-asort = t_excel-asort. ZRULE_NGA-class = t_excel-class. ZRULE_NGA-rule_nga = t_excel-rule_nga. MODIFY ZRULE_NGA. ENDLOOP. IF test IS INITIAL. COMMIT WORK AND WAIT. ELSE. ROLLBACK WORK. ENDIF. *MODIFY ZRULE_NGA FROM TABLE t_excel . |