Why Lock Objects Are Important ?


Taking the standard SAP example of flights.

Tables Involved:

T000 : Client table

SCURX : Currencies (key: currency key)

SBUSPART : Business partner (key: client, partner number)

STRAVELAG : Travel agencies (key: client, travel agency number)

SCUSTOM : Customers (key: client, customer number)

SCARR : Carriers (key: client, carrier ID)

SCOUNTER : Sales counters (key: client, carrier ID, sales counter number)

SPFLI : Flight schedule (key: client, carrier ID, connection number)

SFLIGHT : Flights (key: client, carrier ID, connection number, date of flight)

SBOOK : Flight bookings (key: client, carrier ID, connection number, date of flight, booking number, customer number)

When booking flights (see Flight Model ) it is important to prevent flights from being overbooked. For this reason, you have to lock the particular flight as well as all the bookings existing for this flight during processing. You can do this with lock object E_BOOKING.

The flights are recorded in table SFLIGHT and the bookings for the flights in table SBOOK. The two tables are linked with a foreign key. Lock object E_BOOKING must therefore contain table SFLIGHT as primary table and table SBOOK as further table.

The lock argument of table SFLIGHT thus contains the fields MANDT, CARRID, CONNID, and FLDATE. The lock argument of table SBOOK thus contains the fields MANDT, CARRID, CONNID, FLDATE, BOOKID and CUSTOMID.

Select exclusive lock mode, that is the locked data can only be displayed and edited by one user.

When the lock object is activated, the following function modules are generated from its definition:

ENQUEUE_ E_BOOKING (set locks)

ENQUEUE_ E_BOOKING (release locks)

These function modules can now be linked to ABAP programs.


要查看或添加评论,请登录

Rajendra Daggupati的更多文章

  • Lets Refresh ABAP Topics - 4

    Lets Refresh ABAP Topics - 4

    What Types of Objects Can Be Created in The ABAP Dictionary? The basic objects of the ABAP Dictionary are tables, data…

  • Actual And Formal Parameters In ABAP

    Actual And Formal Parameters In ABAP

    Actual and Formal Parameters in ABAP come into picture for Modularization and reuse of the code. For Example, you need…

  • Lets Refresh ABAP Topics - 2

    Lets Refresh ABAP Topics - 2

    Where to use FREE , REFRESH and CLEAR statements ? FREE : The memory allocated is refreshed and freed. Means after this…

  • Lets Refresh ABAP Topics - 1

    Lets Refresh ABAP Topics - 1

    What Are the Differences Between Sap Memory and Abap Memory? ABAP Memory is a memory area in the internal session (roll…

  • I am Looking for SAP Openings

    I am Looking for SAP Openings

    Hi Everybody , if anyone can help me out in finding SAP openings in the market , I have few of my friends looking for…

社区洞察

其他会员也浏览了