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

news2024/11/28 22:33:55

选择屏幕设置:

选择屏幕

**********************************************************************
* 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:<FS_FIELD>.


  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 <FS_FIELD>.
    <FS_FIELD> = LS_EXCEL-VALUE.
    AT END OF ROW.
      APPEND LS_XLSX TO GT_XLSX.
      CLEAR:
        LS_XLSX.
    ENDAT.
    CLEAR:LS_EXCEL.
  ENDLOOP.
ENDFORM.

增删改查处理:

获取选择框

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 .子例程建立



*&amp;---------------------------------------------------------------------**&amp; 包含 ZSDR026AF*&amp;---------------------------------------------------------------------**&amp;---------------------------------------------------------------------**&amp; Form get_Data
*&amp;---------------------------------------------------------------------**&amp; text
*&amp;---------------------------------------------------------------------**&amp; --> p1 text
*&amp; <-- p2 text
*&amp;---------------------------------------------------------------------*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.*&amp;---------------------------------------------------------------------**&amp; Form diaplay_data
*&amp;---------------------------------------------------------------------**&amp; text
*&amp;---------------------------------------------------------------------**&amp; --> p1 text
*&amp; <-- p2 text
*&amp;---------------------------------------------------------------------*FORM display_data .
PERFORM set_alv_layout.
PERFORM bulid_fieldcat.
PERFORM call_alv_func.


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

* ADD 1 TO pos.* lw_fieldcat-col_pos = pos.
wa_fieldcat-fieldname = &amp;1.
wa_fieldcat-ref_field = &amp;2.
wa_fieldcat-ref_table = &amp;3.
wa_fieldcat-scrtext_l = &amp;4.
wa_fieldcat-outputlen = &amp;5.
wa_fieldcat-no_zero = &amp;6.
wa_fieldcat-edit = &amp;7.
wa_fieldcat-edit_mask = &amp;8.
wa_fieldcat-key = &amp;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.


*&amp;---------------------------------------------------------------------**&amp; Form call_alv_func
*&amp;---------------------------------------------------------------------**&amp; text
*&amp;---------------------------------------------------------------------**&amp; --> p1 text
*&amp; <-- p2 text
*&amp;---------------------------------------------------------------------*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 '&amp;C1' .


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

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

WHEN '&amp;UPDATE' .

PERFORM FORM_UPDATE .

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

WHEN '&amp;DATA_SAVE'.



PERFORM FORM_SAVE .



PERFORM refresh_alv.

ENDCASE.ENDFORM.*&amp;---------------------------------------------------------------------**&amp; Form FORM_INSERT*&amp;---------------------------------------------------------------------**&amp; text 新增按钮
*&amp;---------------------------------------------------------------------**&amp; --> p1 text
*&amp; <-- p2 text
*&amp;---------------------------------------------------------------------*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.*&amp;---------------------------------------------------------------------**&amp; Form FORM_UPDATE*&amp;---------------------------------------------------------------------**&amp; text 修改按钮 ,如果不点这个按钮只能查询
*&amp;---------------------------------------------------------------------**&amp; --> p1 text
*&amp; <-- p2 text
*&amp;---------------------------------------------------------------------*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.*&amp;---------------------------------------------------------------------**&amp; Form FORM_DEL*&amp;---------------------------------------------------------------------**&amp; text
*&amp;---------------------------------------------------------------------**&amp; --> p1 text
*&amp; <-- p2 text
*&amp;---------------------------------------------------------------------*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(<lfs_item>).
lv_num = lv_num + 1.
<lfs_item>-zhh = lv_num.
ENDLOOP.


ENDFORM.*&amp;---------------------------------------------------------------------**&amp; Form FORM_SAVE*&amp;---------------------------------------------------------------------**&amp; text
*&amp;---------------------------------------------------------------------**&amp; --> p1 text
*&amp; <-- p2 text
*&amp;---------------------------------------------------------------------*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 = '&amp;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: <f_field> 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.*&amp;---------------------------------------------------------------------**&amp; Form check_auth*&amp;---------------------------------------------------------------------**&amp; text 权限检查*&amp;---------------------------------------------------------------------**&amp; --> p1 text*&amp; <-- p2 text*&amp;---------------------------------------------------------------------*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 '没有权限查看采购组织' &amp;&amp; p_ekorg &amp;&amp; '权限' 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.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1028309.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

R语言ggpubr包优雅绘制带统计数据的箱线图

ggpubr包是个很经典的R包&#xff0c;能绘制专业的论文绘图&#xff0c;它是对ggplot2进行了加强&#xff0c;R包的说明也是介绍用于创建和自定义基于“ggplot2”的出版物绘图&#xff0c;就是个为SCI而生的R包呀&#xff0c;今天咱们使用ggpubr绘制专业的论文需要的带统计数据…

一文图解|内存页面迁移技术

1. 概述 页面迁移&#xff08;page migrate&#xff09;最早是为 NUMA 系统提供一种将进程页面迁移到指定内存节点的能力用来提升访问性能。后来在内核中广泛被使用&#xff0c;如内存规整、CMA、内存hotplug等。 页面迁移对上层应用业务来说是不可感知的&#xff0c;因为其迁…

【无标题】同创永益王澍│新环境下数字韧性建设探讨

2023年9月7日&#xff0c;由同创永益主办的2023数字韧性保险峰会在上海成功举办。ITSS DCMG组长肖建一等数十位保险行业专家、企业代表出席本次会议&#xff0c;同创永益与多方共同探讨保险行业数字化发展与数字韧性体系建设&#xff0c;共话行业数智化未来。 会上&#xff0c…

贵阳RapidSSL的ssl证书适合个人网站吗

现在很多开发者不论是为了记录还是宣传&#xff0c;很多人都会创建一个属于自己的网站&#xff0c;而有了自己的网站&#xff0c;为了保护网站信息安全以及防止网站数据被篡改与劫持&#xff0c;就需要为网站安装SSL证书。那么RapidSSL的SSL证书个人开发者可以使用吗&#xff1…

Windows Server 2008安装.NET Framework 3.5

安装.NET Framework 3.5一、打开服务器管理器 在开始菜单中搜索“服务器管理器” 二、添加.NET Framework 3.5.1功能 &#xff08;一&#xff09;功能-》添加功能 &#xff08;二&#xff09;选择功能“.NET Framework 3.51” 1.点击“NET Framework 3.5.1”勾选框 2.点击“添…

python教程:内置函数和语法糖触发魔法方法

前言 大家早好、午好、晚好吖 ❤ ~欢迎光临本文章 如果有什么疑惑/资料需要的可以点击文章末尾名片领取源码 下面总结python内置函数对应的魔法方法 魔法方法 数学计算 abs(args):返回绝对值&#xff0c;调用__abs__; round(args):返回四舍五入的值&#xff0c;调用__roun…

GPIO基础知识的概括

GPIO 是通用输入/输出端口的简称&#xff0c;本文以STM32为例进行说明&#xff0c;其他的单片机功能上都是大同小异&#xff0c;学会STM32的GPIO&#xff0c;我们可以触类旁通。 GPIO 的引脚与外部硬件设备连接&#xff0c;可实现与外部通讯、控制外部硬件或者采集外部硬件数据…

CMS之织梦导航二级下拉菜单

操作步骤 1、首先&#xff1a; 将下面这段代码贴到templets\default\footer.htm文件里&#xff08;只要在此文件里就行&#xff0c;位置无所谓啦&#xff01;自己看着办&#xff01;&#xff09; <!-- //二级子类下拉菜单&#xff0c;考虑SEO原因放置于底部 --><scr…

最大限度节省采购成本的七种方法

当前经济环境下&#xff0c;降低成本比以往任何时候都更受到企业的重视。降低成本通常是指在采购过程中节省的成本&#xff0c;但其实远不止于此。它还包括通过重新谈判合同条款和条件、改进管理和运营流程&#xff0c;以及数据和技术的智能使用而节省的成本。 节省采购成本的…

提升技术招聘有效性| 杜绝候选人刷题应试

企业在技术人员招聘中&#xff0c;时常出现候选人“笔试考高分&#xff0c;工作写Bug&#xff0c;绩效来垫底”的尴尬窘境&#xff0c;让企业倍感煎熬。不仅浪费时间精力、也增大招人的成本投入。 如何招到真正合适的技术人选&#xff0c;成为摆在企业心头的难题。 合适的技术…

Vue中的生命周期钩子

生命周期钩子 :::warning 注意 所有生命周期钩子的 this 上下文将自动绑定至实例中&#xff0c;因此你可以利用 this 访问 props、data、computed 和 methods 等选项内的数据/函数。这意味着你不应该使用箭头函数来定义一个生命周期方法&#xff0c;因为箭头函数中没有 this&a…

基于Kintex UltraScale系列FPGA KU060/KU115高性能PCIe数据预处理载板(5GByte/s带宽)

PCIE702是一款基于PCIE总线架构的高性能数据预处理FMC载板&#xff0c;板卡具有1个FMC&#xff08;HPC&#xff09;接口&#xff0c;1路PCIe x8主机接口、1个RJ45千兆以太网口、2个QSFP 40G光纤接口。板卡采用Xilinx的高性能Kintex UltraScale系列FPGA作为实时处理器&#xff0…

vuex实现简易购物车加购效果

目录 一、加购效果动图二、前提条件三、开始操作四、解决vuex刷新数据丢失问题五、最终效果 一、加购效果动图 二、前提条件 创建了vue项目&#xff0c;安装了vuex 三、开始操作 目录结构如下&#xff1a; main.js文件中引入store: import Vue from vue import App from ./…

星戈瑞Cyanine7-COOH在生物学和医学中的应用 CY7-COOH

Cyanine7-COOH作为一种近红外荧光染料&#xff0c;在生物学和医学领域应用。以下是一些Cyanine7-COOH在这些领域中可能的应用&#xff1a; 生物荧光成像&#xff1a; Cyanine7-COOH可以用于细胞和组织的荧光成像&#xff0c;特别是在近红外范围内。这个波长范围的荧光信号穿透…

分布式链路追踪系统zipkin【杭州多测师_王sir】

一、部署zipkin环境的方式 》1.docker 2、java -jar 3、运行源码 二、分别可以在Linux系统和Windows系统里面运行zipkin 三、在地址栏输入&#xff1a;http://127.0.0.1:9411 四、zipkin的流程图 由上图可以看出&#xff0c;应用的代码(User Code)发起 Http Get 请求(请…

Unity丨移动相机朝向目标并确定目标在摄像机可视范围内丨摄像机注释模型丨摄像机移动丨不同尺寸模型优化丨

文章目录 问题描述功能展示技术细节小结 问题描述 本文提供的功能是摄像机朝向目标移动&#xff0c;并确定整个目标出现在摄像机视角内&#xff0c;针对不同尺寸的模型优化。 功能展示 提示&#xff1a;这里可以添加技术名词解释 技术细节 直接上代码 using UnityEngine;…

阿里云产品试用系列-函数计算 FC

函数计算&#xff08;Function Compute&#xff09;是一个事件驱动的全托管 Serverless 计算服务&#xff0c;您无需管理服务器等基础设施&#xff0c;只需编写代码并上传&#xff0c;函数计算会为您准备好计算资源&#xff0c;并以弹性、可靠的方式运行您的代码。 如上所示&am…

Selenium 4.11 正式发布--再也不用手动更新chrome driver 了

Selenium 4.11.0 正式发布了&#xff0c;先来看一下主要特性。 Chrome DevTools支持的版本现在是&#xff1a;v113、v114和v115&#xff08;Firefox仍然对所有版本使用v85&#xff09; 通过Selenium Manager支持Chrome For Testing&#xff08;CfT&#xff09; Selenium Manag…

网络基础 (深信服)

一 走进网络世界 1.1.1 企业网络环境介绍 计算机网络类型&#xff1a; LAN ------本地局域网 Local Area Network&#xff1a; •通常指几千米以内的&#xff0c;可通过某种介质互联的计算机、打印机、modem或其他设备的集合 WAN ------ 广 域 网 Wide Area Network&am…

ClickHouse分布式集群部署

目录 ​编辑 一、环境说明 二、安装部署 2.1 RPM方式安装 2.1.1 安装yum-utils 2.1.2 配置yum repo源 2.1.3 yum install 下载安装clickhouse 2.2 信息配置 2.2.1 配置外网可访问地址 2.2.2 修改存储路径 2.2.2.1 新建存储目录 2.2.2.2 授权 2.2.2.3 修改配置 2.…