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

about views and lock objects

former_member223446
Active Participant
0 Likes
870

hi friends

what is use the of views and lock objects.

how can we distinguish different types of views

database view

maintinance view

projection view.

help view

full points will be given in the answers

thanks

kiran jagana

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
582

Hi,

purpose of Lock Objects : If multiple user try to access a database object, inconsistency may occer. To avoid that inconsistency and to let multiple user give the accessibility of the database objects the locking mechanism is used.

Steps: first we create a loc object in se11 . Suppose for a table mara. It will create two functional module.:

1. enque_lockobject

1. deque_lockobject

before updating any table first we lock the table by calling enque_lockobject fm and then after updating we release the lock by deque_lockobject

Refer

Check the link -

Use of VIEWS:

The main concept of view is to combine several fields of two or more tables or it can be done within single table. See below for clear explanatioin between the Database View and Projection View.

DATABASE VIEW:

The database view is combining several fields of two or more tables into single table.

For example: Consider three tables T1,T2 and T3.

Fields of T1 are F1,F2 and F3.

Fields of T2 are F1,F5.

By using a Database view u can combine the fields of both T1 and T2 provided primary and foreign key relation is maintained between the two tables and final view can have fields like

F1,F2,F3,F5.

PROJECTION VIEW:

First will say the difference between projection and database view which is nothing but for projection view, view is maintained only in one table but in database view, view is maintained between 2 or more tables. Here single table view is not allowed

For projection view, view is maintained within a single table.

For example,if Table T1 has fields F1,F2,F3,F4,F5.

After projection view, view will look like F1,F2,F5.

Regards

Kiran Sure

2 REPLIES 2
Read only

Former Member
0 Likes
582

Hi,

Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.

SAP Provide three type of Lock objects.

Read Lock(Shared Locked)

protects read access to an object. The read lock allows other transactions read access but not write access to

the locked area of the table

Write Lock(exclusive lock)

protects write access to an object. The write lock allows other transactions neither read nor write access to

the locked area of the table.

Enhanced write lock (exclusive lock without cumulating)

works like a write lock except that the enhanced write lock also protects from further accesses from the

same transaction.

You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.

Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.

Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.

Technicaly:

When you create a lock object System automatically creat two function module.

1. ENQUEUE_<Lockobject name>. to insert the object in a queue.

2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.

You have to use these function module in your program.

Hope this will give a basic idea.

Here is a Link with good example

Look the following Links for additionl info.

http://help.sap.com/saphelp_nw04/helpdata/en/c2/2d7037ecc92a7ee10000009b38f8cf/content.htm

http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm

http://articles.techrepublic.com.com/5100-6329_11-5066352.html

Lock Objects:

Lock objects are used to synchronize access to the same data by more than one program.

Purpose:

The SAP system is equipped with a special lock mechanism that synchronizes access to data on the database. The purpose of the lock mechanism is to prevent two transactions from changing the same data on the database simultaneously .

http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/a2/3547360f2ea61fe10000009b38f839/frameset.htm

Function modules required for lock objects:

http://help.sap.com/saphelp_nw04/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/frameset.htm

Views:

http://help.sap.com/saphelp_glossary/en/index.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ea31446011d189700000e8322d00/frameset.htm

Data types

Data types are the actual type definitions in the ABAP Dictionary. They allow you to define elementary types, reference types, and complex types that are visible globally in the system. The data types of database tables are a subset of all possible types, namely flat structures.

Data Elements

Data elements in the ABAP Dictionary describe individual fields. They are the smallest indivisible units of the complex types described below, and are used to specify the types of columns in the database. Data elements can be elementary types or reference types.

Structures

A structure is a sequence of any other data types from the ABAP Dictionary, that is, data elements, structures, table types, or database tables. When you create a structure in the ABAP Dictionary, each component must have a name and a data type. In an ABAP program, you can use the TYPE addition to refer directly to a structure.

If you define a local data type in a program by referring to a structure as follows:

TYPES <t> TYPE <structure>.

Table Types

Table types are construction blueprints for internal tables that are stored in the ABAP Dictionary.

When you create a table type in the ABAP Dictionary, you specify the line type, access type, and key. The line type can be any data type from the ABAP Dictionary, that is, a data element, a structure, a table type, or the type of a database table. You can also enter a predefined Dictionary type directly as the line type, in the same way that you can with a domain.

Type Groups

Before Release 4.5A, it was not possible to define standalone types in the ABAP Dictionary to which you could refer using a TYPE addition in an ABAP program. It was only possible to refer SAP AG BC - ABAP Programming

Data Types in the ABAP Dictionary to flat structures. Structures in programs corresponded to the structures of database tables or structures in the ABAP Dictionary. In ABAP programs, you could only refer to database tables and structures in the ABAP Dictionary using LIKE. It was, however, possible to refer to individual components of the Dictionary type. Complex local data types such as internal tables or deep structures had no equivalent in the ABAP Dictionary. The solution to this from Release 3.0 onwards was to use type groups. Type groups were based on the include technique, and allowed you to store any type definitions globally in the Dictionary by defining them using TYPES statements.

Views:

There are 4 types views are avilable in SAP.

Database View - To club more than one table

Projection View - To hide fields in one table

Maintanance View - To maintain database records in table

Help View - To provide help for a fields (Same functionality as Search help. This is outdated)

View are improves perfromance in the following aspects

1. If you want to use more than two table in 'JOIN' condition better to use Views . It will improves performance of a program

2. If you want to use mutiple FOR ALL ENTRIES clause, better to club all SELECT statement in a view.

Lock Objects:

Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.

SAP Provide three type of Lock objects.

Read Lock(Shared Locked)

protects read access to an object. The read lock allows other transactions read access but not write access to

the locked area of the table

Write Lock(exclusive lock)

protects write access to an object. The write lock allows other transactions neither read nor write access to

the locked area of the table.

Enhanced write lock (exclusive lock without cumulating)

works like a write lock except that the enhanced write lock also protects from further accesses from the

same transaction.

You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.

Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.

Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.

Technicaly:

When you create a lock object System automatically creat two function module.

1. ENQUEUE_<Lockobject name>. to insert the object in a queue.

2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.

You have to use these function module in your program.

Search Helps:

These are two types.

Elementary n Collective.

1) Elementary search helps describe a search path. The elementary search help must define where the data of the hit list should be read from (selection method), how the exchange of values between the screen template and selection method is implemented (interface of the search help) and how the online input help should be defined (online behavior of the search help).

2) Collective search helps combine several elementary search helps. A collective search help thus can offer several alternative search paths.

3)An elementary search help defines the standard flow of an input help.

4) A collective search help combines several elementary search helps. The user can thus choose one of several alternative search paths with a collective search help.

5)A collective search help comprises several elementary search helps. It combines all the search paths that are meaningful for a field.

6)Both elementary search helps and other search helps can be included in a collective search help. If other collective search helps are contained in a collective search help, they are expanded to the level of the elementary search helps when the input help is called.

See the below link to understand this completely:

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ee93446011d189700000e8322d00/frameset.htm

Regards,

shiva.

Read only

Former Member
0 Likes
583

Hi,

purpose of Lock Objects : If multiple user try to access a database object, inconsistency may occer. To avoid that inconsistency and to let multiple user give the accessibility of the database objects the locking mechanism is used.

Steps: first we create a loc object in se11 . Suppose for a table mara. It will create two functional module.:

1. enque_lockobject

1. deque_lockobject

before updating any table first we lock the table by calling enque_lockobject fm and then after updating we release the lock by deque_lockobject

Refer

Check the link -

Use of VIEWS:

The main concept of view is to combine several fields of two or more tables or it can be done within single table. See below for clear explanatioin between the Database View and Projection View.

DATABASE VIEW:

The database view is combining several fields of two or more tables into single table.

For example: Consider three tables T1,T2 and T3.

Fields of T1 are F1,F2 and F3.

Fields of T2 are F1,F5.

By using a Database view u can combine the fields of both T1 and T2 provided primary and foreign key relation is maintained between the two tables and final view can have fields like

F1,F2,F3,F5.

PROJECTION VIEW:

First will say the difference between projection and database view which is nothing but for projection view, view is maintained only in one table but in database view, view is maintained between 2 or more tables. Here single table view is not allowed

For projection view, view is maintained within a single table.

For example,if Table T1 has fields F1,F2,F3,F4,F5.

After projection view, view will look like F1,F2,F5.

Regards

Kiran Sure