2017-11-12 2 views

答えて

2

フォアグラウンドでExcelをアップロードする場合は、クラスcl_mass_spreadsheet_serviceを使用できます。

DATA: 
    lv_file  TYPE if_mass_spreadsheet_types=>file_name, 
    lt_result TYPE STANDARD TABLE OF zsd_salesorder_create. "your result table 

lv_file = 'C:\some_file.xlsx'. 

cl_mass_spreadsheet_service=>fill_table(
    EXPORTING 
     iv_file      = lv_file "full path+name of file. See method navigate_to_file below 
     iv_from_file    = abap_true "use to upload from excel/CSV 
     iv_from_clipboard   = abap_false "use to copy directly from clipbiard 
     iv_tabname     = 'Order_Create' "can be whatever 
    CHANGING 
     ct_table     = lt_result "if ct_table have the same column names as the excel file, the order of the columns does not matter 
). 
+0

このクラスはDDIC構造を必要とするため、これは完全に動的な構造ソリューションではありませんが、とにかく機能的です。私がこれまでに見たことがうまくいった、歓声! – Suncatcher

+0

このクラスは7.40以降しか現れず、7.31以前のシステムには存在しません。 – Suncatcher

1

FM ALSM_EXCEL_TO_INTERNAL_TABLEを使用してデータをアップロードすると、このFMが使用する内部テーブル(前述の行、列、値を持つテーブル)をループして、内部シート(Excelシート)それに応じて。

関連する問題