Thursday, June 5, 2008

SAP ABAP Program EDITOR LOCK/UNLOCK

SAP ABAP Program EDITOR LOCK/UNLOCK

If you wish to Lock or UnLock a program Editor Lock it can be done by the program given below. The SAP System Table TRDIR has a field called EDTX which is basically the EDITOR lock filed. Edit Lock facility is given in the PROGRAM ATTRIBUTES. The EDITOR LOCK is a check box given in the PROGRAM ATTRIBUTES. If this field is SET then the program gets locked and if this is Unchecked the the program is unlocked.

If the EDITOR lock is ON then only the program's author user who has created the program can edit it. Please find the program below.

REPORT ZEX_LOCKUNLOCKED .

**************************************************************
* ABAPLOVER.BLOGSPOT.COM                                     *
* Editor Lock                                                *
*                                                            *
**************************************************************
* Table Declaration
TABLES: TRDIR. "System table TRDIR

*Parameters--------------------------------------------------*
Parameter:  P_PROG    LIKE TRDIR-NAME,
            P_EDITOR  LIKE TRDIR-EDTX.

* Select the entered Program
SELECT SINGLE * FROM TRDIR WHERE NAME = P_PROG.

* Set/Remove the lock
TRDIR-EDTX = P_EDITOR.
MODIFY TRDIR.
IF SY-SUBRC EQ 0.
   WRITE: / 'Editor Lock update Successful ', TRDIR-NAME.
   IF TRDIR-EDTX = 'X'.
      WRITE: ' Lock'.
   ELSE.
      WRITE: ' UnLock'.
   ENDIF.
ELSE.
   WRITE: / 'Editor Lock update Unsuccessful ', TRDIR-NAME.
ENDIF.


Using Logical Databases in SAP ABAP

Using Logical Databases in SAP ABAP

A logical database can be used in the following ways.

By linking it was an executable program in Program Attributes.
By using the function module LDB_PROCESS


The SELECTION SCREEN is displayed only if link the Logical Database in the Program Attributes. It is not displayed if you call it using the Function Module LDB_PROCESS.

Editing Logical Databases:

The Logical Database can be edited using the following methods.

By using the Logical Database Builder in ABAP workbench.
Transaction SE36 or SLDB the menu path is given below.

Tools---------->ABAP Work Bench--------------->Development------------->Programming Environment-------------->Logical Database Builder

Naming the Logical Database: The name can be upto 20 characters. It can also contain a three to to ten character namespace prefix, enclosed in forward slashes. From the initial screen the Logical Database can be created, copied or deleted. Before deleting the Logical Database its links form any program should be removed. You can use the where used link to find exactly where a Logical Database used before deleting it.

SAP ABAP BAPI Material EDIT

SAP ABAP BAPI Material EDIT

If you wish to edit a Material, you can use the following BAPI.

BAPI_MATERIAL_EDIT

The above mentioned BAPI makes use of CALL TRANSACTION MM02 or MM42 to edit the MATERIAL. The selection of the appropriate transaction is made based on the entered material. The table MAW1 is checked for the existence of material, if the material exists in MAW1 then the transaction MM02 is called else transaction MM42 is called.

 
 BAPI_MATERIAL_EDIT in turn calls the following function modules.

BAPI_MATERIAL_EXISTENCECHECK and
CONVERSION_EXIT_MATN1_OUTPUT

The user is then presented with the change material screen either for MM02 or MM42.

The code below shows the values of the input parameters for the BAPI  BAPI_MATERIAL_EDI

REPORT ZEX_CHANGEMAT .

Parameters: p_matnr like BAPIMATALL-MATERIAL,
            p_fscrn like BAPIMATALL-SKIP_1ST_SCREEN.

Data: d_ret like BAPIRET1.


           CALL FUNCTION 'BAPI_MATERIAL_EDIT'
             EXPORTING
               MATERIAL             = p_matnr
              SKIP_1ST_SCREEN       = p_fscrn
            IMPORTING
              RETURN                = d_ret
                     .



if sy-subrc = 0.

endif.


SAP Production Standard Reports

No Report Selection Criterion T Code Description Area
1 Bill of Materials Material
Plant
BOM Usage
Alternative BOM
Change Number
Valid From
Valid to
Revision Level
Required Quantity

CS03
CS09
CS15
CS14
CS12
CS11

Responsible for giving information related to Bill of Materials. Comparison of BOM between two Materials. Production
2 Work Center Information System

Work center     
Plant           
Work center cat.
Person responsible
Capacity category
Capacity planner
Name of hierarch
Plant          
Controlling area
Cost center  

CR60
CR05
In this report Machines used for manufacturing are displayed. Labor work center is also displayed. Production
3 Operation Analysis Dates Selection

Plant           
Work center     
Material        
Order           
Operation/Activity
Date
Exception

MCPB
MCPY
MCPK
MCPQ

This report is used to extract the information of operation quantity, scrap quantity, lead time, target lead time. Production
4 Material Analysis

Plant            
MRP controller   
Material
Month
Exception

MCPW
MCPF
MCPO
MC89

Used to give information of target against actual lead time. Planned ordered quantity against actual ordered quantity. Planned cost against actual cost. Production
5 Operation Analysis: Selection

Plant              
Work center        
Material           
Order              
Operation/Activity 

MCP1
MCP3
MCP5
MCPB
MCPU
MCPW

The order information system is a tool for shop floor control with a reporting function for production orders and planned orders. These reports are useful in discreet manufacturing set up.

Production

SAP ABAP BADIs Introduction

SAP ABAP BADIs Busines Add-Ins an Introduction

SAP Standard Programs can be easily modified/changed using Business Add-Ins or BADIs. And all this can be done without any system level modifications. Business Add-Ins are a new SAP enhancement technique based on ABAP Objects.

BADIs are based on ABAP objects and are new techniques introduced by SAP for changing the SAP Standard programs as per the user requirements. The concept is similar to User Exits but BADIs make use of ABAP Objects. Many industries have some specific requirements that may not be configurable in SAP. This can be easily achieved using BADIs. The original Object does not change as this piece of code is inserted in specific points using BADIs.



Go To IMG( Implementation guide)

Transaction SPRO.


Find the BADI in implementation Guide (IMG)

Search for BADI Check the Documentation For BADI for functionality

Functionality will be implemented in the Method.

Business Add-Ins can be defined according to filter values. This allows you to control add-in implementation and make it dependent on specific criteria.

User Exits / Enhancements  use Transactions SMOD/CMOD.


See also: User Exits in SAP