About lock object in Dynpro ABAP
Hi Expert,
We develop the Dynpro ABAP program to modify SAP document on EP,
( like Sales Order, Purchase order...ect. ).
In tranditional ABAP program, we use lock object(lock entry) to lock sigle document( SO, PO.. etc. )
In Dynpro ABAP , how to lock the single document ?
You can also use the "ENQUEUE" and "DEQUEUE" function modules to lock records in WDA as well.
Check out the thread [The effect of Session Expiration on Lock Table |The effect of Session Expiration on Lock Table].
Hope it helps.
Similar Messages
-
Regd using of lock object in an abap program
Hi all,
i have created an lock object but doesnot know how to use that lock object in an abap program. can anyone guide me how to use lock object in an abap program.check this sample for Production Order.
<b>* Lock request for order
call function 'ENQUEUE_ESORDER'
exporting
aufnr = p_aufnr
exceptions
foreign_lock = 1
system_failure = 2
others = 3
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.</b>
Regards
Prabhu -
About lock object and how to create it
Hi ABAP gurus,
Can any one explain about the Lock Objects and How to create Lock object step by step.
Rgds,Hi Rangamma,
Check this info.
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.
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.
Technically:
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.
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
GO TO SE11
Select the radio button "Lock object"..
Give the name starts with EZ or EY..
Example: EYTEST
Press Create button..
Give the short description..
Example: Lock object for table ZTABLE..
In the tables tab..Give the table name..
Example: ZTABLE
Save and generate..
Your lock object is now created..You can see the LOCK MODULES..
In the menu ..GOTO -> LOCK MODULES..There you can see the ENQUEUE and DEQUEUE function
Lock objects:
http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
Match Code Objects:
http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
http://searchsap.techtarget.com/tip/0,289483,sid21_gci553386,00.html
See this link:
http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
Hope this resolves your query.
<b>Reward all the helpful answers.</b>
Regards -
I have one TABLE with TABLE MAINTENANCE GENERATOR
and it has also LOCK OBJECT.
Now I have adjusted the table by making some normal fields as primary keys
and regenerated Table maintenance generator ,
It seems to me lock object also adjusted( I am able to see the newly converted primary key fields in lock object( in se11 ) ).
Does the lock object automatically adjusts ????
If lock object adjusts automatically --> what about the function modules ENQUEUE_ztable DEQUEUE_ztable ? these function modules also gets adjusted ?
do I need to check the associated lock object impact ?
How can I check ?Hi,
No need to delete the Lock object. Just <b>remove</b> the Table which you modified from Lock object & <b>add again</b>. You can add the lock Parameters manually. It will be drived automatically from Table key fields.
You no need to delete the lock object.
Raja T
Message was edited by:
Raja T -
Lock Object. Want to see if it's locked.
Hello to everyone.
I have got a question about lock objects.
There is a Z-table in abap dictionary. During the processing of my report some strings from this Z-table are selected. To select strings i use the SELECT statement. But there can appear the situation when two users ( or more) run my transaction, so the same strings can be selected and then processed. To avoid this situation i've created the lock object with cumulative lock mode ( 'X' ) for this Z-table and put the calling of ENQUEUE function into the code. To test the locking i' ve run my report under two different accounts in the debugging mode. And found that when the enqueue function is finished , and the current string should be locked in theory, this string can be easily selected with help of select-statement under another account. (Even when the transactions start with delay.)
How can i lock the string in the Z-table so that it could be selected only once during the earlier launched transaction?
Regards,
alex karpo.Ho alex,
SAP locking is a cooperative locking model. That means that you have to care for what is possible and what is not possible. You may use enqeue module to set lock for key of every object selected.
If there is already a foreign lock, you should delete the entry from the list or table of selected objects (in memory, not in database).
Or do it as SAP does: If there is a foreign lock, the user is informed and the data can be displayed, not changed.
You can always check the lock by trying to set a lock.
Regards,
Clemens -
What is the use for lock object and how to use the lock objects
Hi Guru's,
I am new to ABAP .Can you please clarify the that what is the use of lock object and how to use the loct object .what is use of the Deque & Enque function modules .hi ,
below are some minfo about lock objects :
Lock Objects
These types of objects are used for locking the access to database records in table. This mechanism is used to enforce data integrity that is two users cannot update the same data at the same time. With lock objects you can lock table-field or whole table.
In a system where many users can access the same data, it becomes necessary to control the access to the data. In R/3 system this access control is built-in on database tables. Developers can also lock objects over table records.
To lock an object you need to call standard functions, which are automatically generated while defining the lock object in ABAP/4 dictionary. This locking system is independent of the locking mechanism used by the R/3 system. This mechanism also defines LUW i.e. Logical Unit of Work. Whenever an object is locked, either by in built locking mechanism or by function modules, it creates corresponding entry in global system table i.e. table is locked. The system automatically releases the lock at the end of transaction. The LUW starts when a lock entry is created in the system table and ends when the lock is released.
Creating Lock Objects
Lock object is an aggregated dictionary object and can be defined by using the following steps:
o From initial data dictionary screen, enter the name for the object, Click Lock object radiobutton and then click on Create. The system displays a dialog box for Maintain Lock Objects screen
o Enter short text as usual and the name for primary table.
-Save
-Select Tables option
From this screen you can:
Select secondary tables, if any, linked by foreign key relationship.
Fields for the lock objects. This option allows you to select fields for objects (R/3 system allows locking up to record level). Lock object argument are not selected by user but are imposed by the system and includes all the primary keys for the table.
1) Exclusive lock: The locked data can only be displayed or edited by a single user. A request for another exclusive lock or for a shared lock is rejected.
2) Shared lock: More than one user can access the locked data at the same time in display mode. A request for another shared lock is accepted, even if it comes from another user. An exclusive lock is rejected.
3) Exclusive but not cumulative: Exclusive locks can be requested several times from the same transaction and are processed successively. In contrast, exclusive but not cumulative locks can be called only once from the same transaction. All other lock requests are rejected.
Also, last but not the least, locking the object is logical (locking with any enqueue ) .so, you have to use the lock object while trying to access from second program .
reward if helpful ,
Regards,
Ranjita -
With regard to lock object and authority check
hi all
i would like to know about lock object and authority check specifically in reports. there is a coding in sap library with regard to authority check, but there is no coding to restrict user (i mean there is no user names that the object is restricting for a particular user or any user has got permission to change or display object).
further, the code mentions that you need an authorization in your user master record for the object, could any of u explain where is user master record.
below is the code for authority check.
*& Module USER_COMMAND_0100 INPUT
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'SHOW'.
AUTHORITY-CHECK OBJECT 'S_CARRID'
ID 'CARRID' FIELD '*'
ID 'ACTVT' FIELD '03'.
IF SY-SUBRC NE 0. MESSAGE E009. ENDIF.
MODE = CON_SHOW.
SELECT SINGLE * FROM SPFLI
WHERE CARRID = SPFLI-CARRID
AND CONNID = SPFLI-CONNID.
IF SY-SUBRC NE 0.
MESSAGE E005 WITH SPFLI-CARRID SPFLI-CONNID.
ENDIF.
CLEAR OK_CODE.
SET SCREEN 200.
WHEN 'CHNG'.
AUTHORITY-CHECK OBJECT 'S_CARRID'
ID 'CARRID' FIELD '*'
ID 'ACTVT' FIELD '02'.
IF SY-SUBRC NE 0. MESSAGE E010. ENDIF.
MODE = CON_CHANGE.
SELECT SINGLE * FROM SPFLI
WHERE CARRID = SPFLI-CARRID
AND CONNID = SPFLI-CONNID.
IF SY-SUBRC NE 0.
MESSAGE E005 WITH SPFLI-CARRID SPFLI-CONNID.
ENDIF.
OLD_SPFLI = SPFLI.
CLEAR OK_CODE.
SET SCREEN 200.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
i thank u all for the help in advance.hi
this might help
REPORT YUSRLOCK NO STANDARD PAGE HEADING.
TABLES: TRDIR, USR02.
DATA: MARK,CNTR TYPE I,
ACCNT LIKE USR02-ACCNT, ERDAT LIKE USR02-ERDAT,
ANAME LIKE USR02-ANAME, CLI(3) VALUE 'AAA', SZIN TYPE I,
SYDATUM LIKE SY-DATUM, FLAG(3).
TABLES: UINFO.
DATA: OPCODE TYPE X VALUE 2.
DATA: BEGIN OF USR_TABL OCCURS 10.
INCLUDE STRUCTURE UINFO.
DATA: END OF USR_TABL.
START-OF-SELECTION.
CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE
ID 'TAB' FIELD USR_TABL-SYS.
SELECT * FROM USR02 CLIENT SPECIFIED ORDER BY MANDT BNAME.
IF USR02-MANDT <> CLI.
SZIN = SZIN + 1. SZIN = SZIN MOD 2.
CLI = USR02-MANDT.
ENDIF.
IF USR02-UFLAG = 0.
MARK = ' '.
ELSE.
MARK = 'X'.
ENDIF.
CLEAR FLAG.
LOOP AT USR_TABL.
IF USR_TABL-BNAME = USR02-BNAME AND USR_TABL-MANDT = USR02-MANDT.
FLAG = '!!!'.
ENDIF.
ENDLOOP.
SYDATUM = SY-DATUM - 30.
IF SYDATUM < USR02-TRDAT.
IF SZIN = 0.
WRITE:/ ' ', MARK AS CHECKBOX,' ', USR02-BNAME COLOR 2,
' ',USR02-MANDT COLOR 2,
' ',USR02-USTYP COLOR 2,
' ',USR02-TRDAT COLOR 2, USR02-LTIME COLOR 2,
' ',FLAG COLOR 6.
ELSE.
WRITE:/ ' ', MARK AS CHECKBOX,' ', USR02-BNAME COLOR 3,
' ',USR02-MANDT COLOR 2,
' ',USR02-USTYP COLOR 2,
' ',USR02-TRDAT COLOR 2, USR02-LTIME COLOR 2,
' ',FLAG COLOR 6.
ENDIF.
ELSE.
IF SZIN = 0.
WRITE:/ ' ', MARK AS CHECKBOX,' ', USR02-BNAME COLOR 2,
' ',USR02-MANDT COLOR 2,
' ',USR02-USTYP COLOR 2,
' ',USR02-TRDAT COLOR 4, USR02-LTIME COLOR 4,
' ',FLAG COLOR 6.
ELSE.
WRITE:/ ' ', MARK AS CHECKBOX,' ', USR02-BNAME COLOR 3,
' ',USR02-MANDT COLOR 2,
' ',USR02-USTYP COLOR 2,
' ',USR02-TRDAT COLOR 4, USR02-LTIME COLOR 4,
' ',FLAG COLOR 6.
ENDIF.
ENDIF.
HIDE: USR02-BNAME, USR02-MANDT.
ENDSELECT.
CLEAR USR02.
TOP-OF-PAGE.
WRITE:/ 'LOCK USER CLIENT TYPE LAST lOGIN ' COLOR 6.
SKIP.
AT USER-COMMAND.
IF SY-UCOMM = 'SEL'.
DO.
CLEAR MARK.
READ LINE SY-INDEX FIELD VALUE MARK.
IF SY-SUBRC NE 0. EXIT. ENDIF.
IF USR02-BNAME IS INITIAL.CONTINUE.ENDIF.
SELECT SINGLE * FROM USR02 CLIENT SPECIFIED WHERE
MANDT = USR02-MANDT AND BNAME = USR02-BNAME.
IF MARK = 'X' AND USR02-UFLAG = 0.
USR02-UFLAG = 64.
UPDATE USR02 CLIENT SPECIFIED SET: UFLAG = 64 WHERE
MANDT = USR02-MANDT AND
BNAME = USR02-BNAME.
COMMIT WORK.
ENDIF.
IF MARK = ' ' AND USR02-UFLAG = 64.
USR02-UFLAG = 0.
UPDATE USR02 CLIENT SPECIFIED SET: UFLAG = 0 WHERE
MANDT = USR02-MANDT AND
BNAME = USR02-BNAME.
COMMIT WORK.
ENDIF.
ENDDO.
CLEAR USR02.
ENDIF.
regards
Arun -
New Web Dynpro ABAP Related eLearnings Available
Although not a question, I thought using a forum thread to let everyone know about some new Web Dynpro ABAP realted eLearning sessions might be useful. These focus on new features in NetWeaver 7.01 and give a little sneak preview to some features coming later this year in NetWeaver 7.02. I try to publish new sessions twice a month.
Web Dynpro ABAP: Dynamic Context Creation, Mapping, and Data Binding (NetWeaver 7.0)
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/201ddd3b-b4ce-2b10-8883-880ae8147f89
Web Dynpro ABAP: Defaulting Select-Option Values (NetWeaver 7.0)
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60474842-91ca-2b10-3390-d2fd30f335fd
Web Dynpro ABAP: Drag and Drop (NetWeaver 7.01)
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0760510-a2d5-2b10-de9f-d897679696e3
Web Dynpro ABAP Flash Islands Tutorial: Google Maps (NetWeaver 7.01)
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80f16eef-91ef-2b10-4fb5-d709436f3cc3
Web Dynpro ABAP Flash Islands Tutorial: Multiple File Upload (NetWeaver 7.01)
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50d42644-91ef-2b10-228c-9e0ae75b274e
Tutorial on ABAP HTTP Client REST Service Calls (using Polestar OnDemand)
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/608ef65d-1ff9-2b10-b582-d6445b691719
Web Dynpro ABAP Tutorial: ACFUpDownload and ACFExecute (NetWeaver 7.01)
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/109b9b52-bc00-2c10-8786-e4c5e96d7e04
ABAP Language and Tools 7.02 Preview (Also shows new features in WDA - 7.02)
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90db53c4-812d-2c10-0789-dc18f6c9c725
Web Dynpro ABAP - Islands Revisited (NetWeaver 7.01)
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0c91fc0-932d-2c10-4ca7-f5774950c8e3
NetWeaver Business Client 3.0 Preview (NetWeaver 7.02)
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/207c3b88-8c2d-2c10-00bc-bf10a7158f2b
Future topics coming later this month: "How to do Long Polling/Reverse AJAX in Web Dynpro ABAP 7.02" and "Database Locators and Streams for large STRINGs and XSTRINGS in 7.02".
I'm also always looking for suggestions for future eLearning topics.Hello Thomas.
I got some questions for you.
I think you are a great expert on SAP Development Subject.
I saw the webdynpro tutorials that you appended on this board.
When I saw the tutorial there were some persons work with me.
And they were suprised with the beautiful graphics. It's M~uch better than the webdynpro Screens( like colours or Designs) that I use until now.
So. I want to change my webdynpro development enviroment excatly the same thing as the tutorial's one.
And I found there is URLS. That means Unified Rendering Light Speed.
It changes Some of webdynpro's development attributes.
And I also think it can spoils some or all the webdynpro components that existed before I applied URLS.
I have two questions.
one of the questions is this. If I apply URLS on my system, whether the system does get any negative effedcts from the applying.
The other question is this. I have a experience that use NWBC. And the Tutorial's GUI looks similar to NWBC. I want to know the GUI's name and What should I do if I use it on my system.
Component Version - ECC 6.0
Enhencement Package Version 3
Thank you for your concern and reading.
I deeply Appreciate you,
Regards,
Jonghwan -
Hi All,
I have doubt about lock object,
when we create lock object ENQUEUE_OBJ AND DEQUEUE_OBJ also gets created but what about transporting it? should we transport it saparately or automatically its get transported?
Thx.Check the below link
[http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eef3446011d189700000e8322d00/content.htm|http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eef3446011d189700000e8322d00/content.htm]
When you save a lock object, it will ask for a trasport request to be saved under. Once that is given, the generated FMs ENQUEUE_<lockobjectname> and DEQUEUE_<lockobjectname> are also saved under the same transport request.
1. Check your QA system whether the 2 generated FMs for the <lockobjectname> exist in QA?
2. Also check in SE11 whether <lockobjectname> exist in QA?
Hope it helps.
Thanks,
Balaji -
Let me know creation of lock object
let me know creation of lock object
Hi
<b>Lock Objects</b>
Lock object concept
Lock modes
Creating a lock object (example)
Lock object sample code
SAP data dictionary provides you with a locking mechanism to synchronize simultaneous data access by different users.
Lock objects are created in SE11.
Customer lock objects must begin with EY or EZ .
Three possible lock modes exist for lock objects.
<b>Lock Mode</b>
Lock mode E: This sets a lock for changing data for single user. This lock can be accumulated.
Lock mode X: This mode is used like mode E for changing data. The only technical difference from mode E is that the respective lock does not allow accumulation.
Lock mode S: This mode ensures that data displayed in your program cannot be changed by other users during the entire display time. Here you do not want to change the data yourself (allows read only access for data).
<b>Creating Lock object</b>
SE11
1)Enter lock object name beginning with EY or EZ
and hit create.
2)Enter table names containing data records that should be locked and the lock mode.
Enter short text /tbale/lockmode.
3) The primary keys of the specified tables are automatically selected as lock parameters.
It automatically selects the primary key for the selected table.
To set a lock in the application program
call a function module ENQUEUE_<LOCK_OBJECT>.
For our example, it would be ENQUEUE_EZMARA.
To release the lock in the application program
call a function module DEQUEUE_<LOCK_OBJECT>.
For our example, it would be DEQUEUE_EZMARA.
Refer the code executed by user (say abap1) for
matnr = 000000000000000012.
Lock Objects are used to synchronize access to the same data by more than one user. Function modules that can be used in application programs are generated from the definition of a lock object in the ABAP Dictionary.
The R/3 System synchronizes simultaneous access of several users to the same data records with a lock mechanism. When interactive transactions are programmed, locks are set and released by calling function modules .These function modules are automatically generated from the definition of lock objects in the ABAP Dictionary.
Structure of a Lock Object
The tables in which data records should be locked with a lock request are defined in a lock object together with their key fields.
When tables are selected, one table (the primary table) is first selected. Further tables (secondary tables) can also be added using foreign key relationships.
Lock Arguments
The lock argument of a table in the lock object consists of the key fields of the table.
The lock argument fields of a lock object are used as input parameters in the function modules for setting and removing locks generated from the lock object definition. When these function modules are called, the table rows to be locked or
unlocked are specified by defining certain values in these fields.These values can also be generic. The lock argument fields therefore define which subset of the table rows should be locked
Data Dictionary/ Lock Objects
The simplest case of a lock object consists of exactly one table and the lock argument of the table is the primary key of this table. Several tables can also be included in a lock object. A lock request therefore can lock an entire logical
object, and not only a record of a table. Such a logical object can be for example a document comprising an entry in a header table and N entries in a positiontable.
Lock Mode
The lock mode controls whether several users can access data records at the same time. The lock mode can be assigned separately for each table in the lock object. When the lock is set, the corresponding lock entry is stored in the
lock table of the system for each table. Access by more than one user can be synchronized in the
following ways:
Exclusive lock: The locked data can only be displayed or
edited by a single user. A request for another exclusive lock
or for a
shared lock is rejected.
Shared lock: More than one user can access the locked data
at the same time in display mode. A request for another
shared lock is accepted, even if it comes from another user. An exclusive lock
is rejected. Exclusive but not cumulative: Exclusive locks can be requested
several times from the same transaction and are processed
successively. In contrast, exclusive but not cumulative locks
can be called only once from the same transaction. All other
lock requests are rejected.
1) Select object type Lock object in the initial screen of the ABAP Dictionary, enter an object name and choose Create. The name of a lock object should begin with an E (Enqueue).The maintenance screen for lock objects is displayed.
2) Enter an explanatory short text in the field Short text. You can then use the short text to find the lock object at a later time, for example with the R/3 Repository Information System.
3) Enter the name of the primary table of the lock object. All other tables in the lock object must be linked with the primary table using foreign keys.
4) Select the lock mode of the primary table in the field below it The lock mode is used as the default value for the corresponding parameters of the function modules generated from the lock object.
5) Choose Add if you want to lock records in more than one
table with the lock object. A list of all the tables linked with the primary table using valid foreign keys is displayed. Select the appropriate table. The lock
mode of the primary table is copied as lock mode. You can change this setting as required, for example you can assign the lock mode separately for each table.
Similarly, you can add a table linked with the secondary table just added with foreign keys. To do this, place the cursor on the name of the secondary table and choose Add.
If no lock mode is assigned to a table, no lock is set for the
entries in this table when the generated function modules are
called. You should not assign a lock mode if a secondary table
was only used to define a path between the primary table and
another secondary table with foreign keys.
6) Save your entries.
A dialog box appears in which you have to assign the lock
object a development class.
7) You can define whether the function modules generated from
the lock object should be RFC-enabled on the Attributes tab
page. If you set the Allow RFC flag, the generated function
modules can be called from within another system with Remote
Function Call. If you permit Remote Function Calls for an
existing lock object, you must ensure that the generated
function modules are called from within an ABAP program with
parameters appropriate for the type. You should therefore check
all programs that use the associated function modules before
activating the lock object with the new option.
8) Choose Activate
<b>Reward if u sefull</b> -
I've a TCode to modify a report. That TCode picks a doc no. from a table & opens up an editable ALV based on that doc. no .That doc. no. is the only primary key.
I want that if someone is already opened that report, & if someoen else is trying to open that report, it shouldn't open & should show that -"its locked by User XXX". I've made a lock object for that table. Please advise what to do next. How to populate the User name who has locked the report.used ENQUEUE function and DEQUEUE function
Function Modules for Lock Requests
Activating a lock object in the ABAP Dictionary automatically creates function modules for setting (ENQUEUE_<lock object name>) and releasing (DEQUEUE_<lock object name>) locks.
The generated function modules are automatically assigned to function groups. You should not change these function modules and their assignment to function groups since the function modules are generated again each time the lock object is activated.
Never transport the function groups, which contain the automatically generated function modules. The generated function modules of a lock object could reside in a different function group in the target system. Always transport the lock objects. When a lock object is activated in the target system, the function modules are generated again and correctly assigned to function groups.
Parameters of the Function Modules
Field Names of the Lock Object
The keys to be locked must be passed here.
A further parameter X_<field> that defines the lock behavior when the initial value is passed exists for every lock field <field>. If the initial value is assigned to <field> and X_<field>, then a generic lock is initialized with respect to <field>. If <field> is assigned the initial value and X_<field> is defined as X, the lock is set with exactly the initial value of <field>.
Parameters for Passing Locks to the Update Program
A lock is generally removed at the end of the transaction or when the corresponding DEQUEUE function module is called. However, this is not the case if the transaction has called update routines. In this case, a parameter must check that the lock has been removed.
Parameter _SCOPE controls how the lock or lock release is passed to the update program (see The Owner Concept for Locks). You have the following options:
キ _SCOPE = 1: Locks or lock releases are not passed to the update program. The lock is removed when the transaction is ended.
キ _SCOPE = 2: The lock or lock release is passed to the update program. The update program is responsible for removing the lock. The interactive program with which the lock was requested no longer has an influence on the lock behavior. This is the standard setting for the ENQUEUE function module.
キ _SCOPE = 3: The lock or lock release is also passed to the update program. The lock must be removed in both the interactive program and in the update program. This is the standard setting for the DEQUEUE function module.
Parameters for Lock Mode
A parameter MODE_<TAB> exists for each base table TAB of the lock object. The lock mode for this base table can be set dynamically with this parameter. The values allowed for this parameter are S (read lock), E (write lock), X (extended write lock), and O (optimistic lock).
The lock mode specified when the lock object for the table is created is the default value for this parameter. This default value can, however, be overridden as required when the function module is called.
If a lock set with a lock mode is to be removed by calling the DEQUEUE function module, this call must have the same value for the parameter MODE_<TAB>.
Controlling Lock Transmission
Parameter _COLLECT controls whether the lock request or lock release should be performed directly or whether it should first be written to the local lock container. This parameter can have the following values:
キ Initial Value: The lock request or lock release is sent directly to the lock server.
キ X: The lock request or lock release is placed in the local lock container. The lock requests and lock releases collected in this lock container can then be sent to the lock server at a later time as a group by calling the function module FLUSH_ENQUEUE.
Whenever you have lock mode X (extended write lock), locks should not be written to the local lock container if very many locks refer to the same lock table. In this case, there will be a considerable loss in performance in comparison with direct transmission of locks.
Behavior for Lock Conflicts (ENQUEUE only)
The ENQUEUE function module also has the parameter _WAIT. This parameter determines the lock behavior when there is a lock conflict.
You have the following options:
キ Initial Value: If a lock attempt fails because there is a competing lock, the exception FOREIGN_LOCK is triggered.
キ X: If a lock attempt fails because there is a competing lock, the lock attempt is repeated after waiting for a certain time. The exception FOREIGN_LOCK is triggered only if a certain time limit has elapsed since the first lock attempt. The waiting time and the time limit are defined by profile parameters.
Controlling Deletion of the Lock Entry (DEQUEUE only)
The DEQUEUE function module also has the parameter _SYNCHRON.
If X is passed, the DEQUEUE function waits until the entry has been removed from the lock table. Otherwise it is deleted asynchronously, that is, if the lock table of the system is read directly after the lock is removed, the entry in the lock table may still exist.
Exceptions of the ENQUEUE Function Module
キ FOREIGN_LOCK: A competing lock already exists. You can find out the name of the user holding the lock by looking at system variable SY-MSGV1.
キ SYSTEM_FAILURE: This exception is triggered when the lock server reports that a problem occurred while setting the lock. In this case, the lock could not be set.
If the exceptions are not processed by the calling program itself, appropriate messages are issued for all exceptions.
Reference Fields for RFC-Enabled Lock Objects
The type of an RFC-enabled function module must be completely defined. The parameters of the generated function module therefore have the following reference fields for RFC-enabled lock objects:
Parameters
Reference fields
X_<field name>
DDENQ_LIKE-XPARFLAG
_WAIT
DDENQ_LIKE-WAITFLAG
_SCOPE
DDENQ_LIKE-SCOPE
_SYNCHRON
DDENQ_LIKE-SYNCHRON
See also:
Example for Lock Objects
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eebf446011d189700000e8322d00/content.htm -
How can I call a java object from Web dynpro ABAP application?
I made Web dynpro ABAP application and posted it to SAP EP.
For certain business purpose, we need to call external 3rd party java object using 3rd party's java api in Web dynpro application.
Is there anybody who experienced this kind of java interface issue?
I know Web dynpro Java environment can fully support this kind of requirement. but regarding Web dynpro ABAP, I couldn't find any clue for this.
Any comment or suggestion would be greatly appreciated.
Thanks,
Raymond, ABAP Consultantif you have jco configured, then you can make calls to java api from ABAP .
check out this weblog.
/people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
Raja -
I need information about Web dynpro ABAP Exception : ICF Service Node
I need information about Web dynpro ABAP Exception :
ICF Service Node "/sap/bc/webdynpro/sap/abcd/undefined" does not exist.
Here abcd is application name.
ICF Service Node exists and activated but kindly let me know from where "undefined" is coming .
Please let me know your comments /views about this.Hi,
I think ur webdynpro service is not active after upgradation.
You have manually activate it.
Go go Tcode SICF,Execute the Initial screen,
and in this new screen give service as your application name and click on filter.
You will get your service below which will be ur application name .
right-Click on the deactivate and activate it or just activate it,.
This shd work -
Hi All,
I want to include ALV object in web dynpro ABAP, instead of a table in a window. I have SAP Version 4.6 as backend.
Pl help.Hi Nirmal,
the information on ALV and WDA is here: http://help.sap.com/saphelp_nw2004s/helpdata/en/74/fd4142646ab46be10000000a155106/frameset.htm
As you know, Web Dynpro ABAP is availiable with NW2004s, not before.
Regards, Heidi -
Authorization objects in web dynpro ABAP and SU24 transaction
Hi,
I have created a new authorization object to check a storage location for certain activities. I have added the authorization object in a specific web dynpro ABAP and I have created a new role in PFCG for my web dynpro ABAP.
The organization level for storage location is not recognized in PFCG. Someone told me I have to maintain my authorization object in SU24 as it is done for transaction.
I wanted to maintain my web dynpro in SU24 but I found no way to do that.
It seems that we can maintain authorization for TADIR service and in those services there is R3TR WDYA but when I use the search help for OBJ_NAME I don't find may web dynpro ABAP. I suppose I have to create a TADIR service for my web dynpro ABAP or something like that but I don't know how to do ?
Does anybody know how to deal with specific authorization in web dynpro ABAP and t ohave the organizational level recognized in PFCG.
Thanks for your help,
EmmanuelHi,
Please RUN the function module as "AUTH_TRACE_WRITE_USOBHASH" with following parameter
R3TR
"custom webdynpro application"
SERVICE TYPE and Service can be kept blank
after this try SU24 it will be available in SU24 list.
Thanks & regards
Maybe you are looking for
-
Dynamic Connection Pool Creation Failing in a cluster
Hi, I am trying to create a connection pool in a clustered environment. This connection pool is created lazily behind a Stateless Session Bean. We first attempt to determine whether, the connection pool exists using JdbcServices.poolExists(someName),
-
Hi I am experiencing wireless connection problem on 4s after ios 8.1 upgrade. The wireless icon appears showing that it's connected but webpages do not load. I have checked my internet connection with other devices and seems to be alright. what to do
-
I am using Windows 7 (64) and keep on getting the message of "missing .dll files" after I attempt to install the latest version of ITunes. I attempted to install an earlier version and had the same results. I have uninstalled and reinstalled ITunes t
-
VS 2010 is crashing after installing SAP Crystal report 13.0.
HI Experts. I have seen many thread related to crashing in VS2010. I feel i am also getting the same error msg. "Msg:Object reference set to an instance of an object - (Mouse move event)." I didn't see any proper fix on this issue and I think i can g
-
How do I install a widget?
I'm in Dreamweaver CC trying to build and package a mobile app (for the first time). I need to replace "content" with an unordered list that will display categories. I position the cursor in Code View where I want to add the List View widget. In the