Free SAP Training & Tutorial A Free SAP Functional And Technical Tutorial And Training For ABAP, SAP QUERY, ALV, SMARTFORMS, SD, PP, MM, QM, FICO
30.08.2010 | Author: | Posted in ABAP 

This tutorial will teach you how to lock and unlock ABAP program by updating the table TRDIR, once the program is locked, then only the program’s author has the authority to edit it.

Report Z_Lock_Unlock_ABAP_Program.
“A Sample Code To Lock And Unlock ABAP Program Editor

* Table Declaration
TABLES: TRDIR.

*Declare the parameters
Parameter: P_PRGNAME LIKE TRDIR-NAME,
P_PRGEDTR LIKE TRDIR-EDTX.

* Query the specified program name from
* table TRDIR
SELECT SINGLE * FROM TRDIR WHERE NAME = P_PROG.

* Set/Remove the lock
TRDIR-EDTX = P_PRGEDTR.
MODIFY TRDIR.
IF SY-SUBRC EQ 0.
WRITE: / ‘Program Editor is locked successfully’, TRDIR-NAME.
IF TRDIR-EDTX = ‘X’.
WRITE: ‘ Lock’.
ELSE.
WRITE: ‘ UnLock’.
ENDIF.
ELSE.
WRITE: / ‘Program Editor Lock update Unsuccessful ‘, TRDIR-NAME.
ENDIF.

Popularity: 1% [?]

 


 
 

Related Tutorial " ABAP" 

  •  
     
    Recent Tutorials
    Create Table Maintenance Display In SAP Create table display to maintain tables values using SM30
    Create Table Maintenance Generator In SAP Maintaining SAP Transparent table values using maintenance generator
    Table Relationship In SAP Learn How To Find Tables Relationships in SAP
    Convert Number To words Using ABAP Find out how to convert numbers into words Using ABAP
    How To Maintain Long Text Object in SAP Maintain long text object in SAP
    How To Know What TCODE Used In ABAP Program Find TCODE For your ABAP Program Report
    How does CRM Work? Learn how CRM system works to run your business
    Why SAP CRM is the Best Choice? The reasons why CRM application is the best choice
    Difference Between CRM System and CRM Strategy What's the difference between CRM system and its strategy
    CRM for a Better Customer Service Learn how CRM could make your customer service much better
    Costs of Implementing CRM Software Learn the how much cost you need to prepare when implementing CRM
     
    Popular Tutorials
  • (none)
  •  
    Categories
    ABAP   Basis & Configuration  
    ALV SAP BW (Business Warehouse)
    BAPI   SAP Interview Questions
    SAP Tables   SAP Overview
    Transaction Codes FI SAP Query
      MM SAP Script  
      PP SAP Tutorial FI Module
      QM   MM Module
      SD   PM Module
    SAP Functional MM   PP Module
      SD   QM Module
    White Papers     SD Module
    Uncategorized   SmartForms  
      User-Exits  
     
     

     

    Home | About | Contribute | Privacy

    Copyright 2011 freesaptutorial.com.

    Free SAP Tutorial is not associated with SAP AG in Germany or in any other country.

    SAP is a registered trade mark of SAP AG.