*&---------------------------------------------------------------------*
*& Report ZPPR0024
**&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
*&程序名称:工厂日生产计划待排维护
*&--------------------------------------------------------------------
REPORT zppr0024.
TABLES: ztpp_dpp_pool1.
DATA:edit(1) VALUE ''."ALV是否处于可编辑状态
FIELD-SYMBOLS: <f1>, <f2>, <f3>.
TYPES:BEGIN OF ty_zz.
INCLUDE TYPE ztpp_dpp_pool1.
TYPES:menge_x LIKE fieud_goods_sum-totqty, "修改数量
matnr_txt LIKE makt-maktx, "物料描述
extwg_txt LIKE twewt-ewbez, "外部物料组描述
vstel_txt LIKE tvstt-vtext, "装运点描述
zline_txt LIKE ztpp_line-ltext, "生产线描述
werks_txt LIKE t001w-name1, "工厂名称
style TYPE lvc_t_styl. "设置隐藏标识
TYPES: END OF ty_zz.
DATA: ls_edit TYPE lvc_s_styl,
lt_edit TYPE lvc_t_styl.
DATA: ls_outtab TYPE ty_zz.
DATA :gt_zz TYPE STANDARD TABLE OF ty_zz .
DATA:wa_zz TYPE ty_zz.
DATA: excel TYPE ole2_object,
workbook TYPE ole2_object,
sheet TYPE ole2_object,
cell TYPE ole2_object,
row TYPE ole2_object.
DATA: gs_fcat TYPE lvc_s_fcat,
gt_fcat TYPE lvc_t_fcat,
gs_layo TYPE lvc_s_layo,
gs_grid TYPE lvc_s_glay.
DATA: gt_event TYPE slis_t_event WITH HEADER LINE,
gt_event_exit TYPE slis_t_event_exit WITH HEADER LINE.
DATA: ref_grid TYPE REF TO cl_gui_alv_grid .
"parameters: p_ds type c as checkbox.
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
PARAMETERS: r1 RADIOBUTTON GROUP gr1 DEFAULT 'X' USER-COMMAND radio.
PARAMETERS: r2 RADIOBUTTON GROUP gr1.
SELECTION-SCREEN END OF BLOCK blk2.
DATA: filepath LIKE rlgrap-filename .
DATA: file LIKE rlgrap-filename.
START-OF-SELECTION.
SELECT-OPTIONS: p_btype FOR ztpp_dpp_pool1-btype NO-EXTENSION NO INTERVALS,
p_matnr FOR ztpp_dpp_pool1-matnr .
IF r1 EQ 'X'.
PERFORM get_data.
PERFORM show_data_to_alv.
ELSEIF r2 EQ 'X'.
PERFORM frm_path_selected CHANGING filepath.
CONCATENATE filepath '\模板.XLS' INTO file.
PERFORM frm_download_template USING file.
ENDIF.
*START-OF-SELECTION.
* PERFORM get_data.
* PERFORM show_data_to_alv.
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS handle_modify
FOR EVENT data_changed_finished OF cl_gui_alv_grid
IMPORTING e_modified et_good_cells.
METHODS data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_modify.
* PERFORM refresh.
DATA stbl TYPE lvc_s_stbl.
stbl-row
转载于:https://www.cnblogs.com/eagle-dtq/p/5266464.html