‎2005 Aug 05 9:43 AM
Hi,
I've read some facts about transaction handling / Locking.
I have a table ZPRICECOND_TAB that needs to be updated every 4 h.
Table ZPRICECOND_TAB has:
Rows: 100.000
Fields: 15
Primary key: 3
Other: runnig sqlserver2000 on windows.
So now I think I need to make the following statement.
delete from ZPRICECOND_TAB. " empty this table
insert ZPRICECOND_TAB from table i_pricecond3100.
insert ZPRICECOND_TAB from table i_pricecond4100.
Q1: How do I do a proper transaction/locking on this table ?
Dirty reads are OK... but there must always be data in the table...locks/waiting are ok as well...
// Martin
‎2005 Aug 05 10:16 AM
‎2005 Aug 05 9:47 AM
Hi,
Check this link.May be it can help you.
http://help.sap.com/saphelp_40b/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
‎2005 Aug 05 9:49 AM
Hi,
Create Lock object on your Z table ZPRICECOND_TAB using transaction SE11. when you active this lock object, SAP creates two function modules to impose and delete locks. Call these function modules to impose and delete locks.
‎2005 Aug 05 10:00 AM
‎2005 Aug 05 10:16 AM
‎2005 Aug 05 10:47 AM
Hi,
or try that:
data sptab type rstable.
sptab-TABNAME = 'ZPRICECOND_TAB '.
sptab-VARKEY = SY-MANDT.
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
TABNAME = sptab-TABNAME
VARKEY = sptab-VARKEY
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.Andreas