SAP ALV 报表增删改查 及 下载模板导入文件

选择屏幕设置:

SAP ALV 报表增删改查 及 下载模板导入文件_第1张图片

SAP ALV 报表增删改查 及 下载模板导入文件_第2张图片

选择屏幕

**********************************************************************
* SELECTION-SCREEN
**********************************************************************
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P1  RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND CKB_CLICK."导入数据
PARAMETERS: P2  RADIOBUTTON GROUP G1 ."修改数据
PARAMETERS: P3  RADIOBUTTON GROUP G1 ."查询数据
SELECTION-SCREEN END OF BLOCK BLK1.

SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-002.
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME MODIF ID A. "导入摸版
PARAMETERS: P_WERKS LIKE ZMMT304-WERKS MODIF ID B. "工厂
SELECT-OPTIONS:
        S_LIFNR FOR ZMMT304-LIFNR MODIF ID B,
        S_ZYZDM FOR ZMMT304-ZYZDM MODIF ID B.
SELECTION-SCREEN END OF BLOCK BLK2.


SELECTION-SCREEN FUNCTION KEY 1.   屏幕按钮添加


AT SELECTION-SCREEN OUTPUT.   屏幕选择显示或隐藏
  IF P1 = 'X'.
    LV_HIDID = 'B'.
  ELSE.
    LV_HIDID = 'A'.
  ENDIF.
  LOOP AT SCREEN.
    IF SCREEN-GROUP1 = LV_HIDID.
      SCREEN-ACTIVE = '0'.
      SCREEN-INVISIBLE = '1'.
      MODIFY SCREEN.
    ELSE.
      SCREEN-ACTIVE = '1'.
      SCREEN-INVISIBLE = '0'.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
屏幕初始化:

*&---------------------------------------------------------------------*
*  INITIALIZATION
*&---------------------------------------------------------------------*
INITIALIZATION.
  CONCATENATE ICON_XLS
              TEXT-B02                            "模板下载
         INTO SSCRFIELDS-FUNCTXT_01.

  PERFORM FRM_AUTHORITY_CHECK.        "权限检查perform
选择屏幕的数据输入处理:

*&---------------------------------------------------------------------*
*  AT SELECTION-SCREEN
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN.
  IF SSCRFIELDS-UCOMM = CNS_FCODE_FC01.
    PERFORM FRM_DOWNLOAD_TEMPLATE.  下载模板perform逻辑
  ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
* 上传文件路径
  PERFORM FRM_FILE_INPUT.    选择文件perform
主数据处理

*&---------------------------------------------------------------------*
*  START-OF-SELECTION
*&---------------------------------------------------------------------*
START-OF-SELECTION.
* 主要处理
  PERFORM FRM_MAIN_EDIT.   数据处理perform
下载模板:

*&---------------------------------------------------------------------*
*&      Form  FRM_DOWNLOAD_TEMPLATE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_DOWNLOAD_TEMPLATE .
  DATA:
    LV_FILENAME     TYPE  STRING,
    LV_PATH         TYPE  STRING,
    LV_FULLPATH     TYPE  STRING,
    LV_WINDOW_TITLE TYPE  STRING.




  DATA: LS_NAME LIKE WWWDATATAB,
        LT_MIME LIKE W3MIME OCCURS 10.


  LV_WINDOW_TITLE = '导入模板'.   "模板标题名称


  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
    EXPORTING
      WINDOW_TITLE      = LV_WINDOW_TITLE
      DEFAULT_EXTENSION = 'XLS' "C_EXTENSION"默认的扩展名
      DEFAULT_FILE_NAME = LV_FILENAME
      FILE_FILTER       = 'Excel文件(*.XLS)|*.XLS'
    CHANGING
      FILENAME          = LV_FILENAME
      PATH              = LV_PATH
      FULLPATH          = LV_FULLPATH
    EXCEPTIONS
      CNTL_ERROR        = 1
      ERROR_NO_GUI      = 2
      OTHERS            = 3.


  IF LV_FULLPATH IS INITIAL.
    RETURN.
  ELSE.
    LS_NAME-RELID = 'MI'.
    LS_NAME-OBJID = 'ZMME304'.  " SMW0 上载的模板名称


    CALL FUNCTION 'WWWDATA_IMPORT'
      EXPORTING
        KEY  = LS_NAME
      TABLES
        MIME = LT_MIME.


    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME = LV_FULLPATH "文件名+路径
        FILETYPE = 'BIN'
      TABLES
        DATA_TAB = LT_MIME. "存储模板的表
  ENDIF.
ENDFORM.
选择文件:

*&---------------------------------------------------------------------*
*&      Form  FRM_FILE_INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_FILE_INPUT .
  DATA:LT_TAB         TYPE FILETABLE,             "存放文件名的内表
       LS_TAB         TYPE LINE OF FILETABLE,     "用来读取文件名的结构
       LV_FILE_FILTER TYPE STRING,                "file filter
       LV_RC          TYPE I.                     "函数返回值
  REFRESH:LT_TAB.
  CLEAR:LS_TAB,LV_FILE_FILTER,LV_RC.


  LV_FILE_FILTER = 'All Files (*.*)|*.*|Excel Files (*.xls)|*.xls|Excel Files (*.xlsx)|*.xlsx'.

  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    EXPORTING
      WINDOW_TITLE            = 'WINDOW_TITLE'
      FILE_FILTER             = LV_FILE_FILTER
    CHANGING
      FILE_TABLE              = LT_TAB
      RC                      = LV_RC
    EXCEPTIONS
      FILE_OPEN_DIALOG_FAILED = 1
      CNTL_ERROR              = 2
      ERROR_NO_GUI            = 3
      NOT_SUPPORTED_BY_GUI    = 4
      OTHERS                  = 5.
  IF SY-SUBRC = 0.
    READ TABLE LT_TAB INDEX 1 INTO LS_TAB.
    IF SY-SUBRC = 0.
      P_FILE = LS_TAB.
    ENDIF.
  ENDIF.
ENDFORM.
读取导入文件数据:

*&---------------------------------------------------------------------*
*&      Form  FRM_READ_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_READ_DATA .
  DATA:BEGIN OF LT_EXCEL OCCURS 0.
          INCLUDE STRUCTURE ALSMEX_TABLINE.
  DATA:END   OF LT_EXCEL .
  DATA:LS_EXCEL     LIKE LINE OF LT_EXCEL,
       LS_XLSX      TYPE TY_XLSX,
       LV_FILENAME  TYPE LOCALFILE,
       LV_BEGIN_COL TYPE I,
       LV_BEGIN_ROW TYPE I,
       LV_END_COL   TYPE I,
       LV_END_ROW   TYPE I.
  FIELD-SYMBOLS:.


  REFRESH LT_EXCEL.
  CLEAR:LV_FILENAME,LV_BEGIN_COL,LV_BEGIN_ROW,LV_END_COL,LV_END_ROW,LS_EXCEL.

* 本地文件路径
  LV_FILENAME = P_FILE.

  LV_BEGIN_COL = 1.
  LV_BEGIN_ROW = 2.
  LV_END_COL   = 7.
  LV_END_ROW   = 10000.

* 读取本地EXCEL文件数据
  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      FILENAME                = LV_FILENAME
      I_BEGIN_COL             = LV_BEGIN_COL
      I_BEGIN_ROW             = LV_BEGIN_ROW
      I_END_COL               = LV_END_COL
      I_END_ROW               = LV_END_ROW
    TABLES
      INTERN                  = LT_EXCEL
    EXCEPTIONS
      INCONSISTENT_PARAMETERS = 1
      UPLOAD_OLE              = 2
      OTHERS                  = 3.
  IF SY-SUBRC <> 0
    AND LT_EXCEL[] IS INITIAL.
    MESSAGE '上载模板数据为空!' TYPE 'S' DISPLAY LIKE 'E'.
    LEAVE LIST-PROCESSING.
  ENDIF.
  LOOP AT LT_EXCEL INTO LS_EXCEL.
    ASSIGN COMPONENT LS_EXCEL-COL OF STRUCTURE LS_XLSX TO .
     = LS_EXCEL-VALUE.
    AT END OF ROW.
      APPEND LS_XLSX TO GT_XLSX.
      CLEAR:
        LS_XLSX.
    ENDAT.
    CLEAR:LS_EXCEL.
  ENDLOOP.
ENDFORM.

增删改查处理:

SAP ALV 报表增删改查 及 下载模板导入文件_第3张图片

获取选择框

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = gv_grid.
ALV CHANGED DATA光标移动失焦触发.



LOOP AT pcl_data->mt_mod_cells INTO ls_cells.
READ TABLE gt_data INTO gs_data INDEX ls_cells-row_id.
..........

ENDLOOP.屏幕刷新函数



CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lo_grid.
lw_stable-row = 'X'.
lw_stable-col = 'X'.
lo_grid->refresh_table_display(
EXPORTING
is_stable = lw_stable
EXCEPTIONS
finished = 1
OTHERS = 2 ).

本质上是技术上的活灵活用.将多种基础内容合并在一起,这样才算是业务结合学习内容实际. 算是真实开发.

实际案例

今天的这个案例讲的是一个自建立表,我们要给他实现增加,删除,修改,查询的功能.同时,增加权限检查. 本案例会从如何自建立表及表格函数生成器到最后权限检查都讲解一遍,并加入多种基础并经常使用的技巧.如果是新手会很友好.

建表开始

我们通过SE11进行自建立表的创建.注意的是,自建立表一定要以Z或者Y开头,一般都是附加模块及号码 表示自建表顺序 .

ZSDT0015

数据准备

我们基础表建立完成后,就开始在SE38中开发程序.

"数据准备types : BEGIN OF ty_DAta ,zhh TYPE i,EKORG TYPE ZSDT0015-EKORG ,MATNR TYPE ZSDT0015-MATNR ,VKORG TYPE ZSDT0015-VKORG ,ZLSMATNR TYPE ZSDT0015-ZLSMATNR ,ERNAM TYPE ZSDT0015-ERNAM ,ERDAT TYPE ZSDT0015-ERDAT ,ERZET TYPE ZSDT0015-ERZET ,END OF ty_DAta .data : gs_data TYPE ty_DAta .data : gt_data TYPE TABLE of ty_DAta .DATA : lv_num TYPE I VALUE IS INITIAL.data : flag TYPE c.data : ls_zsdt0015 TYPE ZSDT0015 .DATA : ls_data TYPE ty_data.DATA : lt_rows TYPE lvc_t_row.DATA : GT_LSDATA TYPE TABLE OF ty_DAta ." ALV 常量 .*--------------------------------------------------------------------** ALV变量*--------------------------------------------------------------------*DATA: wa_layout TYPE lvc_s_layo.DATA:wa_fieldcat TYPE lvc_s_fcat,gt_fieldcat TYPE lvc_t_fcat.DATA gs_grid TYPE lvc_s_glay. "新DATA: gv_grid TYPE REF TO cl_gui_alv_grid.DATA:gs_glay TYPE lvc_s_glay.DATA : gv_error TYPE c.DATA : bs1 TYPE c.选择屏幕



TABLES : EKKO ,EKPO,VBAK .

SELECTION-SCREEN BEGIN OF BLOCK block WITH FRAME TITLE text-001 .

"select-OPTIONS s_EKORG for EKKO-EKORG .PARAMETERS p_EKORG TYPE EKORG OBLIGATORY .
select-OPTIONS s_MATNR for EKPO-MATNR .
"select-OPTIONS s_VKORG for VBAK-VKORG .PARAMETERS p_VKORG TYPE VKORG OBLIGATORY .

SELECTION-SCREEN END OF BLOCK block .子例程建立



*&---------------------------------------------------------------------**& 包含 ZSDR026AF*&---------------------------------------------------------------------**&---------------------------------------------------------------------**& Form get_Data
*&---------------------------------------------------------------------**& text
*&---------------------------------------------------------------------**& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*FORM get_Data .

SELECT * FROM ZSDT0015 AS A INTO CORRESPONDING FIELDS OF TABLE gt_data where EKORG = p_EKORG and VKORG = p_VKORG .

SORT gt_data by ERZET ." DESCENDING .


GT_LSDATA = Gt_DATA .

ENDFORM.*&---------------------------------------------------------------------**& Form diaplay_data
*&---------------------------------------------------------------------**& text
*&---------------------------------------------------------------------**& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*FORM display_data .
PERFORM set_alv_layout.
PERFORM bulid_fieldcat.
PERFORM call_alv_func.


ENDFORM.*&---------------------------------------------------------------------**& Form set_alv_layout
*&---------------------------------------------------------------------**& text
*&---------------------------------------------------------------------**& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*FORM set_alv_layout .
CLEAR: wa_layout.
wa_layout-zebra = 'X'. "斑马线
wa_layout-cwidth_opt = 'X'. "自动列宽
ENDFORM.*&---------------------------------------------------------------------**& Form bulid_fieldcat
*&---------------------------------------------------------------------**& text
*&---------------------------------------------------------------------**& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*FORM bulid_fieldcat .
DEFINE add_col.

* ADD 1 TO pos.* lw_fieldcat-col_pos = pos.
wa_fieldcat-fieldname = &1.
wa_fieldcat-ref_field = &2.
wa_fieldcat-ref_table = &3.
wa_fieldcat-scrtext_l = &4.
wa_fieldcat-outputlen = &5.
wa_fieldcat-no_zero = &6.
wa_fieldcat-edit = &7.
wa_fieldcat-edit_mask = &8.
wa_fieldcat-key = &9.


CASE wa_fieldcat-fieldname.
WHEN 'EKORG' or 'MATNR' or 'VKORG' or 'ZLSMATNR'.
IF FLAG is INITIAL .
wa_fieldcat-edit = 'X' .
" wa_fieldcat-checkbox = 'X' .

" wa_fieldcat-edit_mask = 'X'.
ELSE .
wa_fieldcat-edit = 'X' .
ENDIF.

WHEN OTHERS.ENDCASE .

APPEND wa_fieldcat TO gt_fieldcat.

CLEAR : wa_fieldcat.
END-OF-DEFINITION.
REFRESH: gt_fieldcat.


add_col 'EKORG' space space '采购组织' space space space space space.
add_col 'MATNR' 'MATNR' 'MARA' '物料号' space space space space space.
add_col 'VKORG' space space '销售组织' space space space space space.
add_col 'ZLSMATNR' 'MATNR' 'MARA' 'ZLSMATNR物料号' space space space space space.
add_col 'ERNAM' space space '修改者' space space space space space.
add_col 'ERDAT' space space '修改日期' space space space space space.
add_col 'ERZET' space space '修改时间' space space space space space.




ENDFORM.


*&---------------------------------------------------------------------**& Form call_alv_func
*&---------------------------------------------------------------------**& text
*&---------------------------------------------------------------------**& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*FORM call_alv_func .
DATA :gt_event TYPE slis_t_event,
gs_event TYPE slis_alv_event.



MOVE 'DATA_CHANGED' TO gs_event-name.
MOVE 'ALV_DATA_CHANGED' TO gs_event-form.
APPEND gs_event TO gt_event.



gs_glay-edt_cll_cb = abap_true. " 选中复选款,立刻触发data changed 事件

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_callback_program = sy-repid "回调程序
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_grid_settings = gs_glay
is_layout_lvc = wa_layout
it_fieldcat_lvc = gt_fieldcat "需要显示的内表的列
i_save = 'A'
it_events = gt_event
TABLES
t_outtab = gt_data "需要显示的数据
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.

ENDFORM.



FORM refresh_alv .
DATA: lo_grid TYPE REF TO cl_gui_alv_grid,
lw_stable TYPE lvc_s_stbl.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lo_grid.

lw_stable-row = 'X'.
lw_stable-col = 'X'.
lo_grid->refresh_table_display(
EXPORTING
is_stable = lw_stable
EXCEPTIONS
finished = 1
OTHERS = 2 ).ENDFORM.


" 用户子程序

FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.



CASE r_ucomm.
WHEN '&C1' .


" 输入料号 对应修改材料名称等信息.
" PERFORM frm_process_print .
WHEN '&INSERT' .
IF FLAG IS INITIAL.

MESSAGE '新增前请先点编辑按钮' TYPE 'E' .
ELSE.
PERFORM FORM_INSERT.
PERFORM refresh_alv.
ENDIF.

WHEN '&UPDATE' .

PERFORM FORM_UPDATE .

PERFORM refresh_alv.
WHEN '&DEL' .
IF FLAG IS INITIAL .
MESSAGE '删除请先点编辑按钮' TYPE 'E' .
ELSE .
PERFORM FORM_DEL .
PERFORM refresh_alv.
ENDIF.

WHEN '&DATA_SAVE'.



PERFORM FORM_SAVE .



PERFORM refresh_alv.

ENDCASE.ENDFORM.*&---------------------------------------------------------------------**& Form FORM_INSERT*&---------------------------------------------------------------------**& text 新增按钮
*&---------------------------------------------------------------------**& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*FORM form_insert .

CLEAR ls_data .


ls_data-zhh = lines( gt_data ) + 1.
ls_data-EKORG = p_EKORG.
ls_data-MATNR = ''.
ls_data-VKORG = p_VKORG.
ls_data-ZLSMATNR = '' .
ls_data-ERNAM = sy-uname.
ls_data-ERDAT = sy-datum.
ls_data-ERZET = sy-uzeit.
INSERT ls_data INTO gt_data INDEX lines( gt_data ) + 1.

SORT gt_data by ERZET DESCENDING .

ENDFORM.*&---------------------------------------------------------------------**& Form FORM_UPDATE*&---------------------------------------------------------------------**& text 修改按钮 ,如果不点这个按钮只能查询
*&---------------------------------------------------------------------**& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*FORM form_update .
" 修改flag
FLAG = 'X' .PERFORM bulid_fieldcat .

REFRESH gt_data .
gt_data = GT_LSDATA .PERFORM refresh_alv .MESSAGE '可以编辑' TYPE 'S' .


ENDFORM.




"得到选择框

FORM get_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = gv_grid.ENDFORM.*&---------------------------------------------------------------------**& Form FORM_DEL*&---------------------------------------------------------------------**& text
*&---------------------------------------------------------------------**& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*FORM form_del .



PERFORM get_grid.
CALL METHOD gv_grid->get_selected_rows
IMPORTING
et_index_rows = lt_rows.

LOOP AT lt_rows INTO DATA(LS_ROWS).
CLEAR ls_data .
READ TABLE gt_data INTO ls_data INDEX ls_rows-index.



MOVE-CORRESPONDING ls_data to ls_zsdt0015 .

DELETE ZSDT0015 FROM ls_zsdt0015 . " 删除透明表数据
DELETE gt_data INDEX ls_rows-index. " 删除内表


ENDLOOP.
" 更新当前序号
LOOP AT gt_data ASSIGNING FIELD-SYMBOL().
lv_num = lv_num + 1.
-zhh = lv_num.
ENDLOOP.


ENDFORM.*&---------------------------------------------------------------------**& Form FORM_SAVE*&---------------------------------------------------------------------**& text
*&---------------------------------------------------------------------**& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*FORM form_save .

IF FLAG = 'X'.
LOOP AT GT_DATA INTO GS_DATA.


MOVE-CORRESPONDING gs_data TO ls_zsdt0015.
MODIFY ZSDT0015 FROM ls_zsdt0015 .

CLEAR GS_DATA .
ENDLOOP.


MESSAGE '保存成功' TYPE 'I' .
SORT gt_data .


ELSE .

MESSAGE '未点编辑只能看' TYPE 'I' .
ENDIF.

ENDFORM.


FORM set_pf_status USING rt_extab TYPE slis_t_extab.
DATA : lw_tab LIKE LINE OF rt_extab.
REFRESH rt_extab.
IF gv_error IS INITIAL.

ELSE.
" 删除按钮
lw_tab-fcode = '&PRINT'.
APPEND lw_tab TO rt_extab.

ENDIF.
SET PF-STATUS 'STD' EXCLUDING rt_extab.

" SET TITLEBAR 'TIT_1000'.ENDFORM.



FORM alv_data_changed USING pcl_data TYPE REF TO cl_alv_changed_data_protocol.
DATA:
l_name(100),
ls_cells TYPE lvc_s_modi.
FIELD-SYMBOLS:  TYPE any .

IF FLAG = 'X'.
LOOP AT pcl_data->mt_mod_cells INTO ls_cells.
READ TABLE gt_data INTO gs_data INDEX ls_cells-row_id.

gs_data-ERNAM = sy-uname.
gs_data-ERDAT = sy-datum.
gs_data-ERZET = sy-uzeit.
MODIFY gt_data FROM GS_DATA TRANSPORTING ERNAM ERDAT ERZET WHERE zhh = GS_DATA-zhh and EKORG = gs_Data-ekorg and MATNR = gs_Data-matnr and VKORG = gs_Data-VKORG and ZLSMATNR = GS_DATA-ZLSMATNR.
CLEAR gs_Data.
ENDLOOP.ENDIF.DATA: ls_stbl TYPE lvc_s_stbl.PERFORM refresh_alv .ENDFORM.*&---------------------------------------------------------------------**& Form check_auth*&---------------------------------------------------------------------**& text 权限检查*&---------------------------------------------------------------------**& --> p1 text*& <-- p2 text*&---------------------------------------------------------------------*FORM check_auth .SELECT SINGLE ekorgFROM T024EINTO @DATA(ls_ekorg)WHERE ekorg = @p_ekorg.AUTHORITY-CHECK OBJECT 'M_EINF_EKO'ID 'ACTVT' DUMMYID 'EKORG' FIELD ls_ekorg .IF sy-subrc NE 0.MESSAGE '没有权限查看采购组织' && p_ekorg && '权限' TYPE 'E'.STOP.ENDIF.SELECT SINGLE vkorg INTO @DATA(lv_vkorg) FROM ztsd001 WHERE zrecon_no = @p_VKORG.IF sy-subrc EQ 0 .AUTHORITY-CHECK OBJECT 'V_VBAK_VKO'ID 'VKORG' FIELD lv_vkorgID 'VTWEG' DUMMYID 'SPART' DUMMYID 'ACTVT' FIELD '03'.IF sy-subrc <> 0.MESSAGE '你无该销售组织权限,请检查!' TYPE 'S' DISPLAY LIKE 'E'..LEAVE LIST-PROCESSING.ENDIF.ENDIF.ENDFORM.程序调用



" 数据准备
INCLUDE ZSDR026AD .


" 选择屏幕
INCLUDE ZSDR026AS .

" 子程序

INCLUDE ZSDR026AF .




"INITIALIZATION .INITIALIZATION .


"at SELECTION-SCREEN
at SELECTION-SCREEN .

" 权限检查
PERFORM check_auth.

"at SELECTION-SCREEN OUTPUT .
at SELECTION-SCREEN OUTPUT .


"START-OF-SELECTION .START-OF-SELECTION .
PERFORM get_Data .

"end-of-SELECTION .
end-of-SELECTION .

PERFORM display_data.

你可能感兴趣的:(前端,数据库,javascript)