*&---------------------------------------------------------------------*
*& Report ZSDE4005
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZSDE4005.
TABLES SSCRFIELDS.
CLASS LCL_DND_EVENT_RECEIVER DEFINITION DEFERRED .
DATA EVENT_RECEIVER TYPE REF TO LCL_DND_EVENT_RECEIVER.
CLASS LCL_DND_EVENT_RECEIVER DEFINITION.
PUBLIC SECTION.
METHODS: HANDLE_DATA_CHANGED
FOR EVENT DATA_CHANGED OF CL_GUI_ALV_GRID
IMPORTING ER_DATA_CHANGED
E_ONF4
E_ONF4_BEFORE
E_ONF4_AFTER
E_UCOMM.
METHODS HANDLE_DATA_CHANGED_FINISHED
FOR EVENT DATA_CHANGED_FINISHED OF CL_GUI_ALV_GRID
IMPORTING E_MODIFIED
ET_GOOD_CELLS.
ENDCLASS. "lcl_dnd_event_
CLASS LCL_DND_EVENT_RECEIVER IMPLEMENTATION.
METHOD HANDLE_DATA_CHANGED.
PERFORM FRM_EVENT_DATA_CHANGED USING ER_DATA_CHANGED.
ENDMETHOD.
METHOD HANDLE_DATA_CHANGED_FINISHED.
PERFORM FRM_EVENT_CHANGED_FINISHED USING E_MODIFIED ET_GOOD_CELLS.
ENDMETHOD.
ENDCLASS..
DATA:
G_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
V_CONTAINERNAME TYPE CHAR50 VALUE 'CC_9001',
OK_CODE TYPE SY-UCOMM,
G_ALV TYPE REF TO CL_GUI_ALV_GRID,
GT_EXCLUDE_9000 TYPE UI_FUNCTIONS.
DATA ITAB TYPE REF TO CL_ABAP_TABLEDESCR.
DATA STRUCT TYPE REF TO CL_ABAP_STRUCTDESCR.
DATA STRUCT2 TYPE REF TO CL_ABAP_TABLEDESCR.
DATA TABLES_TYPE TYPE REF TO CL_ABAP_TABLEDESCR.
DATA LV_STYL TYPE FIELDNAME VALUE 'LVC_T_STYL'.
DATA:O_NEW_TABLE TYPE REF TO DATA.
DATA ELEM_TYPE TYPE REF TO CL_ABAP_ELEMDESCR.
FIELD-SYMBOLS <FS_TABLE> TYPE STANDARD TABLE.
DATA:O_NEW_LINE TYPE REF TO DATA.
DATA COM_TAB TYPE CL_ABAP_STRUCTDESCR=>COMPONENT_TABLE WITH HEADER LINE.
FIELD-SYMBOLS <FS_LINE> .
DATA:LV_SELECTION_ID TYPE RSDYNSEL-SELID,
LT_TABLE TYPE STANDARD TABLE OF RSDSTABS,
LS_TABLE TYPE RSDSTABS.
DATA: LT_FILELD_TAB TYPE STANDARD TABLE OF RSDSFIELDS,
LT_WHERE TYPE RSDS_TWHERE.
DATA T_FIELDCAT TYPE LVC_T_FCAT.
DATA LV_TABNAME TYPE DD02L-TABNAME.
SELECTION-SCREEN PUSHBUTTON 1(10) PB_PCH "获取批次号
USER-COMMAND UCOMM4.
PARAMETERS:P_FILE LIKE RLGRAP-FILENAME OBLIGATORY MEMORY ID A MODIF ID M1.
PARAMETERS P_TABLE TYPE C OBLIGATORY LENGTH 30 MEMORY ID B MODIF ID M2.
PARAMETERS P_1 TYPE C RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND F1.
PARAMETERS P_2 TYPE C RADIOBUTTON GROUP G1.
INITIALIZATION.
PB_PCH = '模版'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = P_FILE
DEF_PATH = 'C:\'
MASK = ',*.XLS,*.XLSX,*.CSV.'
MODE = 'O'
TITLE = '文件名'
IMPORTING
FILENAME = P_FILE
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.