Home > SAP software/management Tips > SAP Basis administration tips > Assigning Tcodes to new roles from a text file
SAP Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

SAP BASIS ADMINISTRATION TIPS

Assigning Tcodes to new roles from a text file


chris crofoot
10.24.2003
Rating: -3.50- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Creating a new role from scratch can be tedious and SAP hasn't provided a user friendly way of assigning a large number of Tcodes to a new role. This program allows you to take a text file (converted from Excel) and insert the Tcodes directly into the role menu. It is then a simple matter of creating the authorization profile from the new Tcodes.
The code was written in R/3 4.6C.

Code

REPORT z_role_tcode_addition .
************************************************************************
* Program to write tcodes from text file to a Role
*
************************************************************************
* 10.07.03 CWC Created
************************************************************************
TABLES: cus_actobj, agr_tcodes.

DATA: iagrtc LIKE agr_tcodes OCCURS 1000 WITH HEADER LINE.


* Table to store the uploaded file.
DATA : BEGIN OF itab OCCURS 0,
         tcode LIKE agr_tcodes-tcode,
       END OF itab.


*  Input file parameter.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: role LIKE agr_tcodes-agr_name OBLIGATORY.
PARAMETERS: ifile LIKE rlgrap-filename OBLIGATORY .
SELECTION-SCREEN END OF BLOCK b1.


**** Drop down for the file search
AT SELECTION-SCREEN ON VALUE-REQUEST FOR ifile.
  CALL FUNCTION 'WS_FILENAME_GET'
       EXPORTING
            def_path         = '*.txt'  " ifile
            mask             = ',*.*,*.*.'
            mode             = '0'
            title            = 'Select The Input File'
       IMPORTING
            filename         = ifile
       EXCEPTIONS
            inv_winsys       = 1
            no_batch         = 2
            selection_cancel = 3
            selection_error  = 4
            OTHERS           = 5.

  IF sy-subrc <:> 0.
    STOP.
  ENDIF.



START-OF-SELECTION.
  PERFORM up_load.
  PERFORM process_itab.

*&---------------------------------------------------------------------*
*&      Form  up_load
*&---------------------------------------------------------------------*
FORM up_load.

  CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
            filename = ifile
            filetype = 'DAT'
       TABLES
            data_tab = itab.

  IF sy-subrc NE 0.
    MESSAGE e368(00) WITH 'Error in uploading the file ' .
  ENDIF.

ENDFORM.                    " up_load


*&---------------------------------------------------------------------*
*&      Form  process_itab
*&---------------------------------------------------------------------*
FORM process_itab.

  iagrtc-agr_name = role.
  iagrtc-type = 'TR'.
  iagrtc-direct = 'X'.
  LOOP AT itab.
    iagrtc-tcode = itab-tcode.
    APPEND iagrtc.
    write: / iagrtc-agr_name, iagrtc-tcode.
  ENDLOOP.
  MODIFY agr_tcodes FROM TABLE iagrtc.

ENDFORM.                    " process_itab

Rate this Tip
To rate tips, you must be a member of SearchSAP.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
SAP Basis administration tips
Converting from MDMP to Unicode
Can SAP developer include authority check for S_TCODE in a called transaction?
How to fix Smart Forms printing double purchase orders
Deriving the name of a Smart Style from a Smart Form
SAP FI/CO consultant's role during upgrade from R/3 to ECC 6.0
Alternatives to downloading a trial version of SAP IDES ERP software
Verifying data consistency in production SAP FI/CO system when restoring a backup
How to upgrade DB2 on SAP R/3 4.7
How to create a snapshot from NAS and SAN of Oracle database
How to clone an SAP ECC 6.0 instance

SAP Basis administration and NetWeaver administration
Seven tips for simplifying SAP data archiving administration
Using up-to-date SAP ABAP codes in SAP ECC 6.0
Migrating SAP Solution Manager system between Unix platforms
SAP talent management FAQ: Fresh answers to frequently asked questions
Collaboration a must for SAP hardware teams and software teams
How to establish communication between SAP Unicode and non-Unicode systems
Mission-critical SAP software demands a mission-critical hardware infrastructure
In an upgrade to SAP ECC 6.0, when do integrated apps get upgraded?
NetWeaver PI 7.1 easier to implement than earlier versions, SAP says
SAP Software Deployment Manager vs. Java Support Package Manager
SAP Basis administration and NetWeaver administration Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Basis  (SearchSAP.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



NetWeaver SAP White Papers
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
SearchSAP.com is a search service provided by TechTarget and is completely
independent of and not affiliated with SAP AG.
  TechTarget - The IT Media ROI Experts