sap-abap 权限控制

FORM AUTH_CHECK .

  "工厂
  LOOP AT S_WERKS.
    AUTHORITY-CHECK OBJECT 'M_BANF_WRK'
    ID 'WERKS'     FIELD S_WERKS-LOW
    ID 'ACTVT'     FIELD '03'.

    IF SY-SUBRC <> 0.
      CONCATENATE '您没有查看公司代码'  S_WERKS-LOW '下采购申请的权限' INTO DATA(LV_MESSAGE).
      MESSAGE LV_MESSAGE TYPE 'E' DISPLAY LIKE 'S'.
    ENDIF.
  ENDLOOP.

  "采购组织
  LOOP AT S_EKORG.
    AUTHORITY-CHECK OBJECT 'M_BANF_EKO'
    ID 'EKORG'     FIELD S_EKORG-LOW
    ID 'ACTVT'     FIELD '03'.

    IF SY-SUBRC <> 0.
      CONCATENATE '您没有查看采购组织'  S_EKORG-LOW '下采购申请的权限' INTO DATA(LV_MESSAGE1).
      MESSAGE LV_MESSAGE1 TYPE 'E' DISPLAY LIKE 'S'.
      EXIT.
    ENDIF.
  ENDLOOP.

你可能感兴趣的:(sap-abap 权限控制)