• SAP根据用户名查找使用的TCODE


    由于某些部门的权限变动频繁,设置也比较复杂,现做一个查找TCODE事务代码的程序方便业务部门管理。

    *&---------------------------------------------------------------------*
    *& Report ZMMRP087A
    *&---------------------------------------------------------------------*
    *&
    *&---------------------------------------------------------------------*
    REPORT ZMMRP087A.
    TABLES:USR02.
    TYPES:BEGIN OF TY_DATA,
            BNAME TYPE USR02-BNAME,
            TCODE TYPE AGR_TCODES-TCODE,
            TTEXT TYPE TSTCT-TTEXT,"事务代码描述文本
          END OF TY_DATA.
    DATA:LT_TAB TYPE STANDARD TABLE OF TY_DATA.
    
    SELECT-OPTIONS:
    S_USER FOR USR02-BNAME.
    "查找母角色的TCODE
    SELECT USR02~BNAME,
    *AGR_USERS~AGR_NAME,
    AGR_TCODES~TCODE,
    TSTCT~TTEXT
    FROM USR02
    LEFT JOIN AGR_USERS ON AGR_USERS~UNAME = USR02~BNAME
    LEFT JOIN AGR_TCODES ON AGR_USERS~AGR_NAME = AGR_TCODES~AGR_NAME
    LEFT JOIN TSTCT ON TSTCT~TCODE = AGR_TCODES~TCODE
    INTO CORRESPONDING FIELDS OF TABLE @LT_TAB
          WHERE USR02~BNAME IN @S_USER
      AND TSTCT~SPRSL = 1.
    "查找继承角色的TCODE
    SELECT USR02~BNAME,
    *AGR_USERS~AGR_NAME,
    AGR_TCODES~TCODE,
    TSTCT~TTEXT
    FROM USR02
    LEFT JOIN AGR_USERS ON AGR_USERS~UNAME = USR02~BNAME
    LEFT JOIN AGR_DEFINE ON AGR_USERS~AGR_NAME = AGR_DEFINE~AGR_NAME
    LEFT JOIN AGR_TCODES ON AGR_DEFINE~PARENT_AGR = AGR_TCODES~AGR_NAME
      LEFT JOIN TSTCT ON TSTCT~TCODE = AGR_TCODES~TCODE
    APPENDING CORRESPONDING FIELDS OF TABLE @LT_TAB
          WHERE USR02~BNAME IN @S_USER
        AND TSTCT~SPRSL = 1.
    
    SORT LT_TAB BY BNAME TCODE.
    DELETE ADJACENT DUPLICATES FROM LT_TAB.

  • 相关阅读:
    技术收集
    Entity Framework的扩展库
    暂时收集
    php 处理高并发的思路
    nginx缓存优先级(缓存问题者必看)
    mysql5.5主从配置
    php源码编译常见错误解决方案
    今天开始要改变模式了
    nrpe 在ubuntu上安装遇到的问题
    zendstudio 10下载汉化
  • 原文地址:https://www.cnblogs.com/BruceKing/p/15272973.html
Copyright © 2020-2023  润新知