PFCG 角色分配用户 - PRGN_RFC_CHANGE_USERS_IN_AGRS

这是一个SAPABAP程序,用于处理用户角色分配的数据上传。程序从Excel文件中读取数据,检查用户名和角色是否存在,然后显示数据并提供下载模板的功能。用户可以选择分配或取消分配角色给用户,并进行相应的数据库操作。
摘要由CSDN通过智能技术生成

目录

一、程序源代码

二、数据模版


一、程序源代码

*&---------------------------------------------------------------------*
*& Report  ZFIU024
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ZFIU024.

TABLES: SSCRFIELDS.
SELECTION-SCREEN FUNCTION KEY 1.

TYPES: BEGIN OF TYP_UPLOAD,
         AGR_NAME TYPE STR_AGRS-AGR_NAME,
         UNAME TYPE STR_AGRS-UNAME,
         ZSEL TYPE CHAR1,
         ICON TYPE ICON-NAME,
         ZTYPE TYPE C,
         ZMESSAGE TYPE CHAR255,
       END OF TYP_UPLOAD.

DATA: WA_UPLOAD TYPE TYP_UPLOAD,
      IT_UPLOAD LIKE STANDARD TABLE OF WA_UPLOAD.

DATA: WA_USERLIST TYPE STR_AGRS,
      IT_USERLIST LIKE STANDARD TABLE OF WA_USERLIST.

DATA: WA_AGRS TYPE AGR_AGRS,
      IT_AGRS LIKE STANDARD TABLE OF WA_AGRS.

DATA: L_AGR_NAME TYPE STR_AGRS-AGR_NAME.

DATA: L_CHECK TYPE C.
DATA: G_DO TYPE C.

DATA: IS_LAYOUT TYPE SLIS_LAYOUT_ALV,          "ALV输出样式
      IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,    "ALV输出的头项目(内表)
      WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,      "ALV输出的头项目(工作区)
      WA_REPID LIKE SY-REPID."程序名



PARAMETERS: P_FILE TYPE RLGRAP-FILENAME.

PARAMETERS: R1 RADIOBUTTON GROUP G1 DEFAULT 'X',
            R2 RADIOBUTTON GROUP G1.



INITIALIZATION.
  PERFORM FRM_INIT.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
  PERFORM FRM_FILE_F4.

AT SELECTION-SCREEN.
  CASE SY-UCOMM.
    WHEN 'FC01'.
      PERFORM FRM_DOWNLOAD_TEM_XLS.
  ENDCASE.


START-OF-SELECTION.
  PERFORM FRM_GET_DATA.

END-OF-SELECTION.
  PERFORM FRM_SHOW_DATA.














*&---------------------------------------------------------------------*
*&      Form  FRM_INIT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_INIT .
  SSCRFIELDS-FUNCTXT_01 = '下载上载模板'.
ENDFORM.                    " FRM_INIT
*&---------------------------------------------------------------------*
*&      Form  FRM_FILE_F4
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_FILE_F4 .
  CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
      MASK             = ' Excel(*.xls)|*.xls|Excel(*.xlsx)|*.xlsx|全部文件 (*.*)|*.*|'
      TITLE            = '选择文件'
    IMPORTING
      FILENAME         = P_FILE
    EXCEPTIONS
      INV_WINSYS       = 1
      NO_BATCH         = 2
      SELECTION_CANCEL = 3
      SELECTION_ERROR  = 4
      OTHERS           = 5.
  IF SY-SUBRC <> 0 AND SY-SUBRC <> 3.
    MESSAGE E015(ZMM) WITH '选择文件出错!'.
  ENDIF.
ENDFORM.                    " FRM_FILE_F4
*&---------------------------------------------------------------------*
*&      Form  FRM_DOWNLOAD_TEM_XLS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_DOWNLOAD_TEM_XLS .
  DATA: FILENAME TYPE STRING VALUE 'ZFIU024.xls',
        PATH TYPE STRING VALUE 'C:\',
        FULLPATH TYPE STRING VALUE 'C:\ZFIU024.xls'.

  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
    EXPORTING
*     WINDOW_TITLE         =
*     DEFAULT_EXTENSION    =
      DEFAULT_FILE_NAME    = FILENAME
*     WITH_ENCODING        =
      FILE_FILTER          = 'Excel(*.xls)|*.xls|Excel(*.xlsx)|*.xlsx|全部文件 (*.*)|*.*|'
      INITIAL_DIRECTORY    = PATH
*     PROMPT_ON_OVERWRITE  = 'X'
    CHANGING
      FILENAME             = FILENAME
      PATH                 = PATH
      FULLPATH             = FULLPATH
*     USER_ACTION          =
*     FILE_ENCODING        =
    EXCEPTIONS
      CNTL_ERROR           = 1
      ERROR_NO_GUI         = 2
      NOT_SUPPORTED_BY_GUI = 3
      OTHERS               = 4.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ELSE.
    IF FULLPATH IS INITIAL.

    ELSE.
      PERFORM DOWNLOAD_EXCEL_FROMSERVER USING FULLPATH.
      P_FILE = FULLPATH.
      "MESSAGE '模板导出成功' TYPE 'S'.
    ENDIF.
  ENDIF.
ENDFORM.                    " FRM_DOWNLOAD_TEM_XLS
*&---------------------------------------------------------------------*
*&      Form  DOWNLOAD_EXCEL_FROMSERVER
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_FULLPATH  text
*----------------------------------------------------------------------*
FORM DOWNLOAD_EXCEL_FROMSERVER  USING P_DEST.
  DATA: LO_OBJDATA LIKE WWWDATATAB,
        LS_DESTINATION LIKE RLGRAP-FILENAME.
  LS_DESTINATION = P_DEST.
  LO_OBJDATA-RELID = 'MI'.
  LO_OBJDATA-OBJID = 'ZFIU024'.
  CALL FUNCTION 'DOWNLOAD_WEB_OBJECT'
    EXPORTING
      KEY               = LO_OBJDATA
      DESTINATION       = LS_DESTINATION
*   IMPORTING
*     RC                =
*   CHANGING
*     TEMP              =
            .
ENDFORM.                    " DOWNLOAD_EXCEL_FROMSERVER
*&---------------------------------------------------------------------*
*&      Form  FRM_GET_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_GET_DATA .
  PERFORM FRM_UPLOAD_FILE_XLS.
  PERFORM FRM_CHECK_DATA.
ENDFORM.                    " FRM_GET_DATA
*&---------------------------------------------------------------------*
*&      Form  FRM_UPLOAD_FILE_XLS
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_UPLOAD_FILE_XLS .
  DATA: IT_RAW  TYPE TRUXS_T_TEXT_DATA.

  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
*     I_FIELD_SEPERATOR    =
      I_LINE_HEADER        = 'X'
      I_TAB_RAW_DATA       = IT_RAW       " WORK TABLE
      I_FILENAME           = P_FILE
    TABLES
      I_TAB_CONVERTED_DATA = IT_UPLOAD  "ACTUAL DATA
    EXCEPTIONS
      CONVERSION_FAILED    = 1
      OTHERS               = 2.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  IF IT_UPLOAD IS INITIAL.
    MESSAGE '上载文档空请检查' TYPE 'S' DISPLAY LIKE 'E'.
    LEAVE LIST-PROCESSING.
  ELSE.
*************设置标识的初始状态
    LOOP AT IT_UPLOAD INTO WA_UPLOAD.
      WA_UPLOAD-ICON = ICON_YELLOW_LIGHT.
      WA_UPLOAD-ZMESSAGE = ''.
      MODIFY IT_UPLOAD FROM WA_UPLOAD TRANSPORTING ICON ZMESSAGE.
    ENDLOOP.
  ENDIF.
ENDFORM.                    " FRM_UPLOAD_FILE_XLS
*&---------------------------------------------------------------------*
*&      Form  FRM_CHECK_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_CHECK_DATA .
  CLEAR: WA_USERLIST.
  CLEAR: IT_USERLIST.
  L_CHECK = 'S'.
  LOOP AT IT_UPLOAD INTO WA_UPLOAD.
    CLEAR: WA_USERLIST.
    SELECT SINGLE BNAME
      FROM USR21
      INTO WA_USERLIST-UNAME
     WHERE BNAME EQ WA_UPLOAD-UNAME.
    IF SY-SUBRC <> 0.
      L_CHECK = 'E'.
      WA_UPLOAD-ICON = ICON_RED_LIGHT.
      WA_UPLOAD-ZTYPE = 'E'.
      WA_UPLOAD-ZMESSAGE = '用户名不存在'.
      MODIFY IT_UPLOAD FROM WA_UPLOAD TRANSPORTING ICON ZTYPE ZMESSAGE.
      CONTINUE.
    ENDIF.

    SELECT SINGLE AGR_NAME
      FROM AGR_DEFINE
      INTO WA_USERLIST-AGR_NAME
     WHERE AGR_NAME EQ WA_UPLOAD-AGR_NAME.
    IF SY-SUBRC <> 0.
      L_CHECK = 'E'.
      WA_UPLOAD-ICON = ICON_RED_LIGHT.
      WA_UPLOAD-ZTYPE = 'E'.
      WA_UPLOAD-ZMESSAGE = '角色不存在'.
      MODIFY IT_UPLOAD FROM WA_UPLOAD TRANSPORTING ICON ZTYPE ZMESSAGE.
      CONTINUE.
    ENDIF.

    IF R1 = 'X'.
      SELECT SINGLE AGR_NAME
        FROM AGR_USERS
        INTO L_AGR_NAME
       WHERE AGR_NAME EQ WA_UPLOAD-AGR_NAME
         AND UNAME EQ WA_UPLOAD-UNAME.
      IF SY-SUBRC = 0.
        L_CHECK = 'E'.
        WA_UPLOAD-ICON = ICON_RED_LIGHT.
        WA_UPLOAD-ZTYPE = 'E'.
        WA_UPLOAD-ZMESSAGE = '角色已分配该用户'.
        MODIFY IT_UPLOAD FROM WA_UPLOAD TRANSPORTING ICON ZTYPE ZMESSAGE.
        CONTINUE.
      ENDIF.
      WA_USERLIST-FROM_DAT = SY-DATUM.
      WA_USERLIST-TO_DAT = '99991231'.
      WA_USERLIST-ORG_FLAG = ''.
    ELSEIF R2 = 'X'.
      SELECT SINGLE FROM_DAT TO_DAT COL_FLAG
        FROM AGR_USERS
        INTO (WA_USERLIST-FROM_DAT, WA_USERLIST-TO_DAT, WA_USERLIST-ORG_FLAG)
       WHERE AGR_NAME EQ WA_UPLOAD-AGR_NAME
         AND UNAME EQ WA_UPLOAD-UNAME
         AND COL_FLAG EQ ''.
      IF SY-SUBRC <> 0.
        L_CHECK = 'E'.
        WA_UPLOAD-ICON = ICON_RED_LIGHT.
        WA_UPLOAD-ZTYPE = 'E'.
        WA_UPLOAD-ZMESSAGE = '用户未分配该角色'.
        MODIFY IT_UPLOAD FROM WA_UPLOAD TRANSPORTING ICON ZTYPE ZMESSAGE.
        CONTINUE.
      ENDIF.
*      IF WA_USERLIST-ORG_FLAG = 'X'.
**        WA_USERLIST-ORG_FLAG = 'C'.
*        L_CHECK = 'E'.
*        WA_UPLOAD-ICON = ICON_RED_LIGHT.
*        WA_UPLOAD-ZTYPE = 'E'.
*        WA_UPLOAD-ZMESSAGE = '用户未分配该角色'.
*        MODIFY IT_UPLOAD FROM WA_UPLOAD TRANSPORTING ICON ZTYPE ZMESSAGE.
*        CONTINUE.
*      ENDIF.
    ENDIF.


    WA_UPLOAD-ICON = ICON_YELLOW_LIGHT.
    WA_UPLOAD-ZTYPE = 'W'.
    WA_UPLOAD-ZMESSAGE = '检查通过'.
    MODIFY IT_UPLOAD FROM WA_UPLOAD TRANSPORTING ICON ZTYPE ZMESSAGE.
    APPEND WA_USERLIST TO IT_USERLIST.

*    IF R1 = 'X'.
*      SELECT *
*        FROM AGR_AGRS
*        INTO CORRESPONDING FIELDS OF TABLE IT_AGRS
*       WHERE AGR_NAME EQ WA_UPLOAD-AGR_NAME.
*      IF SY-SUBRC = 0.
*        LOOP AT IT_AGRS INTO WA_AGRS.
*          WA_USERLIST-UNAME = WA_UPLOAD-UNAME.
*          WA_USERLIST-AGR_NAME = WA_AGRS-CHILD_AGR.
*          WA_USERLIST-FROM_DAT = SY-DATUM.
*          WA_USERLIST-TO_DAT = '99991231'.
*          WA_USERLIST-ORG_FLAG = 'C'.
*          APPEND WA_USERLIST TO IT_USERLIST.
*        ENDLOOP.
*      ENDIF.
*    ENDIF.

  ENDLOOP.
ENDFORM.                    " FRM_CHECK_DATA
*&---------------------------------------------------------------------*
*&      Form  FRM_SHOW_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_SHOW_DATA .
  WA_REPID = SY-REPID.                     "得到程序名
  IS_LAYOUT-ZEBRA = 'X'.                   "颜色相间显示
  IS_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.       "优化列宽选项
  IS_LAYOUT-BOX_FIELDNAME = 'ZSEL'.       "优化列宽选项

  DATA: DE_POS TYPE I.

  DE_POS = DE_POS + 1.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS       = DE_POS.
*  WA_FIELDCAT-KEY           = 'X'.
  WA_FIELDCAT-FIELDNAME     = 'ICON'.
  WA_FIELDCAT-ICON          = 'X'.
  WA_FIELDCAT-SELTEXT_L     = ''.
  WA_FIELDCAT-SELTEXT_M     = ''.
  WA_FIELDCAT-SELTEXT_S     = ''.
  WA_FIELDCAT-DDICTXT       = 'L'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.

  DE_POS = DE_POS + 1.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS       = DE_POS.
*  WA_FIELDCAT-KEY           = 'X'.
  WA_FIELDCAT-FIELDNAME     = 'AGR_NAME'.
  WA_FIELDCAT-REF_TABNAME   = 'STR_AGRS'.
  WA_FIELDCAT-REF_FIELDNAME = 'AGR_NAME'.
  WA_FIELDCAT-SELTEXT_L     = '角色'.
  WA_FIELDCAT-SELTEXT_M     = '角色'.
  WA_FIELDCAT-SELTEXT_S     = '角色'.
  WA_FIELDCAT-DDICTXT       = 'L'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.

  DE_POS = DE_POS + 1.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS       = DE_POS.
*  WA_FIELDCAT-KEY           = 'X'.
  WA_FIELDCAT-FIELDNAME     = 'UNAME'.
  WA_FIELDCAT-REF_TABNAME   = 'STR_AGRS'.
  WA_FIELDCAT-REF_FIELDNAME = 'UNAME'.
  WA_FIELDCAT-SELTEXT_L     = '用户'.
  WA_FIELDCAT-SELTEXT_M     = '用户'.
  WA_FIELDCAT-SELTEXT_S     = '用户'.
  WA_FIELDCAT-DDICTXT       = 'L'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.

  DE_POS = DE_POS + 1.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS       = DE_POS.
*  WA_FIELDCAT-KEY           = 'X'.
  WA_FIELDCAT-FIELDNAME     = 'ZMESSAGE'.
  WA_FIELDCAT-SELTEXT_L     = '消息'.
  WA_FIELDCAT-SELTEXT_M     = '消息'.
  WA_FIELDCAT-SELTEXT_S     = '消息'.
  WA_FIELDCAT-DDICTXT       = 'L'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
*     I_INTERFACE_CHECK                 = ' '
*     I_BYPASSING_BUFFER                = ' '
*     I_BUFFER_ACTIVE                   = ' '
      I_CALLBACK_PROGRAM                = WA_REPID
      I_CALLBACK_PF_STATUS_SET          = 'SET_STATUS'
      I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
*     I_CALLBACK_TOP_OF_PAGE            = ' '
*     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*     I_CALLBACK_HTML_END_OF_LIST       = ' '
*     I_STRUCTURE_NAME                  =
*     I_BACKGROUND_ID                   = ' '
*     I_GRID_TITLE                      =
*     I_GRID_SETTINGS                   =
      IS_LAYOUT                         = IS_LAYOUT
      IT_FIELDCAT                       = IT_FIELDCAT
*     IT_EXCLUDING                      =
*     IT_SPECIAL_GROUPS                 =
*     IT_SORT                           =
*     IT_FILTER                         =
*     IS_SEL_HIDE                       =
*     I_DEFAULT                         = 'X'
      I_SAVE                            = 'A'
*     IS_VARIANT                        =
*     IT_EVENTS                         =
*     IT_EVENT_EXIT                     =
*     IS_PRINT                          =
*     IS_REPREP_ID                      =
*     I_SCREEN_START_COLUMN             = 0
*     I_SCREEN_START_LINE               = 0
*     I_SCREEN_END_COLUMN               = 0
*     I_SCREEN_END_LINE                 = 0
*     I_HTML_HEIGHT_TOP                 = 0
*     I_HTML_HEIGHT_END                 = 0
*     IT_ALV_GRAPHICS                   =
*     IT_HYPERLINK                      =
*     IT_ADD_FIELDCAT                   =
*     IT_EXCEPT_QINFO                   =
*     IR_SALV_FULLSCREEN_ADAPTER        =
*   IMPORTING
*     E_EXIT_CAUSED_BY_CALLER           =
*     ES_EXIT_CAUSED_BY_USER            =
    TABLES
      T_OUTTAB                          = IT_UPLOAD
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
            .
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " FRM_SHOW_DATA

*&---------------------------------------------------------------------*
*&      FORM  SET_STATUS
*&---------------------------------------------------------------------*
*       TEXT
*----------------------------------------------------------------------*
*      -->RT_EXTAB   TEXT
*----------------------------------------------------------------------*
FORM SET_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
  SET PF-STATUS 'ZFIU024' EXCLUDING RT_EXTAB.
ENDFORM.                    "SET_STATUS


*&---------------------------------------------------------------------*
*&      FORM  USER_COMMAND
*&---------------------------------------------------------------------*
*       TEXT
*----------------------------------------------------------------------*
*      -->RF_UCOMM     TEXT
*      -->RS_SELFIELD  TEXT
*----------------------------------------------------------------------*
FORM USER_COMMAND USING RF_UCOMM LIKE SY-UCOMM
                        RS_SELFIELD TYPE SLIS_SELFIELD.
  CASE RF_UCOMM.
    WHEN 'ZDO'.
      IF L_CHECK = 'E'.
        MESSAGE '上载数据有错,不能保存' TYPE 'E'.
      ENDIF.
      IF G_DO = 'X'.
        MESSAGE '修改操作已执行' TYPE 'E'.
      ENDIF.
      G_DO = 'X'.
      PERFORM FRM_GO..
  ENDCASE.
*如果前面把内表的数据修改了,通过这个就会自到更新数据
  RS_SELFIELD-REFRESH = 'X'.
ENDFORM.                    "USER_COMMAND
*&---------------------------------------------------------------------*
*&      Form  FRM_GO
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM FRM_GO .
  DATA: L_ZTYPE TYPE C.
  DATA: L_ZMESSAGE TYPE CHAR255.
  IF R1 = 'X'.
    CALL FUNCTION 'PRGN_RFC_CHANGE_USERS_IN_AGRS'
*     IMPORTING
*       NUMBER_NOT_AUTHORIZED             =
*       NUMBER_ENQUEUED                   =
*       NUMBER_NOT_EXISTING               =
      TABLES
        ADD_USERS_TO_ACTGROUPS            = IT_USERLIST
*       DELETE_USERS_FROM_ACTGROUPS       =
*       NOT_AUTHORIZED                    =
*       ENQUEUED                          =
*       NOT_EXISTING                      =
      EXCEPTIONS
        CENTRAL_USER_MAINT_ACTIVE         = 1
        OTHERS                            = 2
              .
    IF SY-SUBRC <> 0.
      L_ZTYPE = 'E'.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
               INTO L_ZMESSAGE.
      CONCATENATE '失败:'
                  L_ZMESSAGE
                  INTO
                  L_ZMESSAGE.
      ROLLBACK WORK.
    ELSE.
      L_ZTYPE = 'S'.
      L_ZMESSAGE = '成功'.
      COMMIT WORK AND WAIT.
    ENDIF.
  ELSEIF R2 = 'X'.
    CALL FUNCTION 'PRGN_RFC_CHANGE_USERS_IN_AGRS'
*     IMPORTING
*       NUMBER_NOT_AUTHORIZED             =
*       NUMBER_ENQUEUED                   =
*       NUMBER_NOT_EXISTING               =
      TABLES
*       ADD_USERS_TO_ACTGROUPS            =
        DELETE_USERS_FROM_ACTGROUPS       = IT_USERLIST
*       NOT_AUTHORIZED                    =
*       ENQUEUED                          =
*       NOT_EXISTING                      =
      EXCEPTIONS
        CENTRAL_USER_MAINT_ACTIVE         = 1
        OTHERS                            = 2
              .
    IF SY-SUBRC <> 0.
      L_ZTYPE = 'E'.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
               INTO L_ZMESSAGE.
      CONCATENATE '失败:'
                  L_ZMESSAGE
                  INTO
                  L_ZMESSAGE.
      ROLLBACK WORK.
    ELSE.
      L_ZTYPE = 'S'.
      L_ZMESSAGE = '成功'.
      COMMIT WORK AND WAIT.
    ENDIF.
  ENDIF.
  LOOP AT IT_UPLOAD INTO WA_UPLOAD.
    CASE L_ZTYPE.
      WHEN 'S'.
        WA_UPLOAD-ICON = ICON_GREEN_LIGHT.
      WHEN 'E'.
        WA_UPLOAD-ICON = ICON_RED_LIGHT.
    ENDCASE.
    WA_UPLOAD-ZTYPE = L_ZTYPE.
    WA_UPLOAD-ZMESSAGE = L_ZMESSAGE.
    MODIFY IT_UPLOAD FROM WA_UPLOAD TRANSPORTING ICON ZTYPE ZMESSAGE.
  ENDLOOP.
ENDFORM.                    " FRM_GO

二、数据模版

角色用户
  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

陈送平er

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值