Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Basic DOUBTS

Former Member
0 Likes
689

Hi,

Please give me answers for the below mentioned.

1.what is physical & logical lock ? why we had two kind of locks and what's the actual usage? ( i think by se11 what we create is logical lock)

2.How can we check versions of SAP script?

3.how can we check a particular date whether that is valid date r not ( assume this field in flatfile)

Regards,

Raja.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
651

1. The concept of locking in SAP is based on lock objects that combine one or more database tables into one application object. The locks that are created by using these lock objects are logical locks, because you are not creating a database lock at this stage. All such locks are held in a lock table. So when you change a material using MM02, an entry is made into this lock table so that if another person tries to change the same material, system will first check this lock table to see if there is any entry and if there is, then it will not allow that second user to change the same material. At this point, the database locks are not made.

When you make your changes and hit the save button, a commit is issued and that is when system will request database locks. These are the physical locks. These have very little lifespan because these are requested at commit during the update process. The reason for creating another layer of locking mechanism is to avoid burdening the underlying database with lock requests and also there is cost for doing so. Hope this clarifies.

2. For checking the version of a SAP script, go to SE71, enter the SAPscript name, select the radiobutton for 'Header'. In the subsequent screen, in the menu, 'Utilities-->Versions' will show you all the versions.

3. Even though the function module mentioned by others here will help you, your program and the application that is creating flat file should have an understanding of how the date should be sent. If the flat file has date in all different formats that are possible, there is no way of checking it. So the most important thing to remember is to have this understanding in place before even trying to validate it.

Srinivas

5 REPLIES 5
Read only

Former Member
0 Likes
651

hi raja,

check this link:

http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/content.htm

Function module date_check_plausibility is used to check if the date is a valid one.

regards,

keerthi.

Read only

Former Member
0 Likes
651

the fm is: DATE_CHECK_PLAUSIBILITY.

Regards,

ravi

Read only

Former Member
0 Likes
652

1. The concept of locking in SAP is based on lock objects that combine one or more database tables into one application object. The locks that are created by using these lock objects are logical locks, because you are not creating a database lock at this stage. All such locks are held in a lock table. So when you change a material using MM02, an entry is made into this lock table so that if another person tries to change the same material, system will first check this lock table to see if there is any entry and if there is, then it will not allow that second user to change the same material. At this point, the database locks are not made.

When you make your changes and hit the save button, a commit is issued and that is when system will request database locks. These are the physical locks. These have very little lifespan because these are requested at commit during the update process. The reason for creating another layer of locking mechanism is to avoid burdening the underlying database with lock requests and also there is cost for doing so. Hope this clarifies.

2. For checking the version of a SAP script, go to SE71, enter the SAPscript name, select the radiobutton for 'Header'. In the subsequent screen, in the menu, 'Utilities-->Versions' will show you all the versions.

3. Even though the function module mentioned by others here will help you, your program and the application that is creating flat file should have an understanding of how the date should be sent. If the flat file has date in all different formats that are possible, there is no way of checking it. So the most important thing to remember is to have this understanding in place before even trying to validate it.

Srinivas

Read only

Former Member
0 Likes
651

Hi,

<b>Physical locks:</b>

The database system automatically sets database locks when it receives change statements (INSERT, UPDATE, MODIFY, DELETE) from a program. Database locks are physical locks on the database entries affected by these statements. You can only set a lock for an existing database entry, since the lock mechanism uses a lock flag in the entry. These flags are automatically deleted in each database commit. This means that database locks can never be set for longer than a single database LUW; in other words, a single dialog step in an R/3 application program.

Physical locks in the database system are therefore insufficient for the requirements of an R/3 transaction. Locks in the R/3 System must remain set for the duration of a whole SAP LUW, that is, over several dialog steps. They must also be capable of being handled by different work processes and even different application servers. Consequently, each lock must apply on all servers in that R/3 System

A database sets the physical locks.

<b>Logical lock:</b>

SAP lock mechanism sets a logical lock also called as <b>SAP lock</b>.

A locked database entry is not physically locked in the database table.

The lock entry is merely entered as a lock argument in the central lock table. The lock argument is made up of the primary key field values for the tables in the lock object. These are import parameters of the enqueue function module. The lock is independent of database LUWs. It is released either implicitly when the database update or the SAP transaction ends, or explicitly, using the corresponding dequeue function module. You can use a special parameter in the update function module to set the exact point at which the lock is released during the database update.

A locked entry does not necessarily have to exist in a database table.

You can, for example, set a lock as a precaution for a database entry that is not written to the database until the update at the end of the SAP LUW.

The effectiveness of the locks depends on cooperative application programming.

Since there are no physical locks in the database tables themselves, all programs that use the same application objects must look in the central table themselves for any locks. There is no mechanism that automatically prevents a program from ignoring the locks in the lock table.

Lock Types

There are four types of locks in the SAP System:

Shared lock

Exclusive lock

Exclusive but not cumulative lock

Optimistic lock

Regards,

Aswin

Read only

abdul_hakim
Active Contributor
0 Likes
651

>>1.what is physical & logical lock ? why we had two kind of locks and what's the actual usage? ( i think by se11 what we create is logical lock)

physical lock is the lock provided by your database manufacturer for eg Oracle.This lock is not suitable for SAP Transaction because of the internal commit which occurs whenever there is a screen change in SAP Transactions which in turn will release the physical lock of your database so there is a need in SAP to have a logical lock which wont get released until the COMMIT WORK has been issued externally....

>>How can we check versions of SAP script?

use the path goto->version

>>how can we check a particular date whether that is valid date r not

there are many wayz thru which you can achieve this.one way is convert your external date format into SAP format using the fm CONVERT_DATE_TO_INTERNAL and compare it with the system date.

Cheers,

Abdul Hakim

Mark useful answers..