Wednesday, June 25, 2008
Wednesday, June 4, 2008
Releasing SAP Locks
You can release SAP locks by deleting the corresponding entry in the lock table.
When you set an SAP lock using the ENQUEUE function module, the value transferred to the _SCOPE entry parameter determines the lock duration. Depending on the formal parameter _SCOPE, you can release an SAP lock as follows:
- If _SCOPE is set to 1, the lock is not linked to the current SAP LUW. You can release the lock either by calling the DEQUEUE function module whose formal parameter _SCOPE can have any value, or by terminating the program.
- If _SCOPE is set to 2, the lock is linked to the current SAP LUW. In case CALL FUNCTION … FOR UPDATE TASK has registered at least one update function module, the statement COMMIT WORK or ROLLBACK WORK releases the lock upon completion of the SAP LUW. When using COMMIT WORK, the update function releases the lock after processing the update function modules. This type of lock may persist beyond the end of a program until the update procedure has been completed.
- If _SCOPE is set to 3, both the update function and the program must release the lock. The update function releases the lock as if _SCOPE had a value of 2. The program releases the lock as if _SCOPE had a value of 1. The entire release procedure is specified by the last user who released the lock.
If you want to release an SAP lock using the DEQUEUE function module independent of the update function, you must transfer a value to the formal parameter _SCOPE that is greater than or equal to the value transferred to the parameter of the same name for the ENQUEUE function module.
Besides the _SCOPE parameter, the entry parameters of a DEQUEUE function module correspond to those of the ENQUEUE function module. You can then use the additional parameter _SYNCHRON to specify whether the release of the lock should be delayed until the program processing continues.
Setting SAP Locks
Lock function modules set or release SAP locks when called. The function locks access a central lock table in the memory of a special application server work process. Every
ABAP system contains exactly one such table (administered by transaction SM12). An enqueue function module sets an SAP lock by writing a corresponding entry in the lock table. If you cannot set a lock because corresponding lock entries already exist in the lock table, the function module terminates with the FOREIGN_LOCK exception.
The most important entry parameters of an enqueue function module are:
Parameter | Meaning |
MODE_dbtab | Type of lock for the dbtab database table of the lock object. Possible entry values include “S” for a shared lock, “E” for an exclusive lock, “X” for an expanded exclusive lock that can be requested only once unlike a regular exclusive lock within a program, and “O” for an optimistic lock which behaves like a shared lock at first, but can be converted to an exclusive lock. |
key_fields | For all key fields of the lock object, you can specify values that define the rows to be locked. If you have not specified a value for a key field, all corresponding rows are locked. |
_SCOPE | Definition of the lock duration with respect to an SAP LUW. Possible entry values include “1″ for handling the lock in the same program, “2″ for transferring the lock to the update, and “3″ for handling the lock in the program and in the update. |
Note
You can check an SAP lock by trying to set a corresponding lock and handling the FOREIGN_LOCK exception in the process.
SAP Locks
SAP locks must be maintained for the duration of SAP LUWs. For this reason, various work processes and, if applicable, changing application servers must be able to handle these locks.
SAP locks are based on lock objects. The ABAP Dictionary defines these objects; they permit locks of single or several lines in one database table or locks of lines in several database tables linked by foreign key dependencies.
The creation of a lock object generates two lock function modules, whose names consist of the prefixes ENQUEUE_ and DEQUEUE_ and the name of the lock object.
See also SAP Locking Concept.
How to add new fields in standard table ?
Create Z-Structure with the fields needed and append the structure to the standard table by using the option append structure within table display
we can enhance the standard tables by using Append structures and customizing includes.
Append structures allow you to attach fields to a table without actually having to modify the table itself. Table enhancements using append structures therefore do not have to be planned by SAP developers. An append structure can only belong to exactly one table.
In contrast, CI_includes allow you to use the same structure in multiple tables. The include statement must already exist in the SAP table or structure. Table enhancements using CI_includes do, however, have to be planned by SAP developers
What is the difference between Domain and Data Elements?
The Domain specifies the Technical attributes of the field such as the data type, length and the value range.
The data element is an elementary type defining the description/text for the field when displaying on the screen and Parameter ID.
What is the difference between Check Table and Value Table?
The Check Table is the dependent table to which the relationship is defined using foreign keys. The contents of the check table field are shown in the input help for the referenced field.
The Value table is the table attached to a field at the domain level, where the entry to the field can be only from the value table. They are not used in the Input Help.
What is the difference between INSERT and MODIFY?
Whenever you need to create new records in the database table use INSERT. Whenever using INSERT be sure that a duplicate entry having the same values for the primary key fields are not present. Else it may throw a dump.
When you use MODIFY it makes a check for the matching key field values. If present it modifies the matching record, else it creates a new record in the database table.
How do you activate the database table after making changes to it?
After making changes to the table, inorder to reflect the changes go to transaction SE14 and Choose Edit and then choose Activate and Adjust Database.
OR
You can directly activate it from the SE11What is Table Maintenance Generator?
The Table Maintenance Generator is used to create table maintenance program to add, modify or delete records in the database table. This can be accessed using transaction SE54 or in SE11 using the menu Utilities->Table Maintenance Generator.
What are the different types of Views?
- Projection view - Just retrieves some fields from a single table.
- Help View - This is used for search help.
- Database View - This is inner join view of one or more tables
- Maintenance View - Helps in creating maintaining data of the application object. The data can be distributed among several tables.
What is the difference between Database tables and Views?
The Table has a physical storage of data whereas views do not have physical storage of data.
The view is derived from one or more tables which is created only with the required fields from the database table(s). It can also be created with table inner joins and specifying conditions for data retrieval.
What is the difference between Pooled tables and Cluster tables?
Cluster tables and Pooled tables have many to one relationship with the underlying database.
A table pool corresponds to a table in the database in which all records from the pooled tables assigned to it are stored.
Several logical data records from different cluster tables can be stored together in one physical record in a table cluster.
- A pooled table cannot have the name having more than 10 characters.
- All the key fields of the pooled table must be of character data type.
- In pooled tables, the maximum length of the key field/data fields should not exceed the length of varkey/vardata of the pool respectively.
- In cluster table the records having the same key are stored in a single key in the cluster.
- If there is an overflow of the data records a continuation record is created with the same table key.
What types of tables can be created in the ABAP Dictionary?
Transparent Tables
Pooled and Clustered Tables
What types of objects can be created in the ABAP Dictionary?
Tables
Views
Data Elements
Structures
Table Types
Type Groups
Domains
Search Helps
Lock Objects
Component Usage pdf
Component Usage (PDF 537 KB)
In this tutorial, you will develop an example for component usage in Web Dynpro ABAP and further build on tutorial 4 to display customer data of a particular booking using his customer_id as a foreign key.
Navigation PDF free download
Tutorial 3 - Navigation (PDF 391 KB)
This tutorial demonstrates how easy it is to navigate between different views of the same Web Dynpro application.
Blog Archive
-
▼
2008
(300)
-
▼
June
(30)
- EDI & IDOC Interface Material free download
- SAP List Viewer Free download
- ALV GRID CONTROL FREE DOWNLOAD
- OBJECTS TUTORIAL Free download
- BAPI PROGRAMMING Free download
- BDC & FILES
- BDC DETAILS TUTORIAL Free download
- BDC RECORDING STEPS free download
- WORKFLOW Material free download
- IDOC COMPLETE GUIDE free download
- Releasing SAP Locks
- Setting SAP Locks
- SAP Locks
- How to add new fields in standard table ?
- What is the difference between Domain and Data Ele...
- What is the difference between Check Table and Val...
- What is the difference between INSERT and MODIFY?
- How do you activate the database table after makin...
- What is Table Maintenance Generator?
- What are the different types of Views?
- What is the difference between Database tables and...
- What is the difference between Pooled tables and C...
- What types of tables can be created in the ABAP Di...
- What types of objects can be created in the ABAP D...
- Component Usage pdf
- Component and Application Configuration PDF free ...
- Display Bookings for Selected Flights (PDF 342 KB)
- Navigation PDF free download
- BAPI Usage PDF free download
- Create a Simple Web Dynpro Application pdf free do...
-
▼
June
(30)