Unlock table
Hi,
i was trying to adjust fact table in Se14.
But it has failed in step 5."Conversion of data to new table, deletion of renamed table."
Now teh data exists in the temporary table.How I can unlock the table.If i click on unlock it is saying data can be lost.
Now data does not exist in fact table
Reagrds,
Anita
Hi,
See Tcode : SM12
regards
Happy Tony
Similar Messages
-
Se14- conversion error, unlock table
Hi.
I have added a new append to MCHA. I modified this append and afterwards I went to se14 in order to adjust and activate the table.
But, I have a conversion error. Now, append structure is partially active and only temporary table for MCHA exists. I can not fix the conversion problem. Data on MCHA are not important, it is the development system and it contains few data. What happens if I select "Unloc Table" in se14?
ThanksHi all,
Regarding data, I lost them, but I did not mind since it is test development, and we are doing the first steps to implant MM module. So data was not revelant for us.
Archana,
Our problem was caused by a bad conversion data, in the end I unlock the table. Afterwards table mcha was at the dictionary but not in the database, and se14 only showed option "create database". We used this functionality to create it again, and it worked. It created the table, in inactive status, I fixed the append structure and activated the table. Then I went to db02 to perform consistency check, here I knew that indexes and table views were lost and I had to create them again.
On the other hand, if you want to maintain your data, I think you have several options:
- contact system team in order to restore them from backup or
- before unlocking the table, you can save temporary tables created for adjustment (tables like QCMMCHA ...) that contains data, or
- correct the conversion problem and continue adjustment (in my case I couldn't fix the problem, I tried to modify the append that caused the problem but I could not activate again)
Hope this helps you. -
the /BI0/SCRM_PRCTYP table in DDIC was locked. cant figure out what to do to unlock it. Can someone help
Thanks,\I'm not sure what you mean by "Is Locked"? What is the error message and what are you doing to get it.
You can see the locks in SM12. You can also delete them there. Just be careful not to remove a lock that is actually being used by a user. That could cause some database inconsistencies.
Regards,
Adam -
How to block a single table for a single user
Hi all.
I want to block a single Z table for a single user. How to do this? If he/she tries to display data using SE16 or SE11 Tcode he/she should get an error message.
Regards,
Prajwal K.Hi Prajwal,
We can use the function modules ENQUEUE_E_TABLE for locking tables and the function module DEQUEUE_E_TABLE for unlocking tables. With this method, we don't need to lock objects in order to lock the tables. In other words, any table can be locked/unlocked using these function modules.
Check this sample code:
*Locking Table*
data:
varkey like rstable-varkey.
varkey = sy-mandt.
locking the tables............................
call function 'ENQUEUE_E_TABLE'
exporting
MODE_RSTABLE = 'E'
tabname = 'MARA'
varkey = varkey
X_TABNAME = ' '
X_VARKEY = ' '
_SCOPE = '2'
_WAIT = ' '
_COLLECT = 'X'
exceptions
foreign_lock = 1
system_failure = 2
others = 3.
Hope this helps you.
Regards,
Chandra Sekhar -
Changing the length of a key field in a table
Hi,
I want to increase the length of the field from 2 to 4 in a standard SAP table and deliver it to the customers. This field is a key field in table. This field from this table is also used in view and view clusters.
What is the implication of changing the length to the customers. The customers would have already data in this field and they should not loose any data. Will the existing data for customers remain at length 2 or do they have to do some conversion?
Regards,
Srini.
Edited by: Srinivasa Raghavachar on Feb 7, 2008 12:45 PMhi,
The database table can be adjusted to the changed definition in the ABAP Dictionary in three different
ways:
By deleting the database table and creating it again. The table on the database is deleted, the inactive
table is activated in the ABAP Dictionary, and the table is created again on the database. Data
existing in the table is lost.
By changing the database catalog (ALTER TABLE). The definition of the table on the database is
simply changed. Existing data is retained. However, indexes on the table might have to be built again.
By converting the table. This is the most time-consuming way to adjust a structure.
If the table does not contain any data, it is deleted in the database and created again with its new
structure. If data exists in the table, there is an attempt to adjust the structure with ALTER TABLE. If the
database system used is not able to do so, the structure is adjusted by converting the table.
Field 1 Field 2, Field 3
NUMC,6 CHAR 8 CHAR, 60
Field 1 Field 2 Field 3
NUMC,6 CHAR, 8 CHAR,30
The following example shows the steps necessary during conversion.
Starting situation: Table TAB was changed in the ABAP Dictionary. The length of field 3 was reduced
from 60 to 30 places.
The ABAP Dictionary therefore has an active (field 3 has a length of 60 places) and an inactive (field 3
still has 30 places) version of the table.
The active version of the table was created in the database, which means that field 3 currently has 60
places in the database. A secondary index with the ID A11, which was also created in the database, is
defined for the table in the ABAP Dictionary.
The table already contains data.
Step 1: The table is locked against further structure changes. If the conversion terminates due to an
error, the table remains locked. This lock mechanism prevents further structure changes from being
made before the conversion has been completed correctly. Data could be lost in such a case.
Step 2: The table in the database is renamed. All the indexes on the table are deleted. The name of the
new (temporary) table is defined by the prefix QCM and the table name. The name of the temporary
Step 3: The inactive version of the table is activated in the ABAP Dictionary. The table is created on the
database with its new structure and with the primary index. The structure of the database table is the
same as the structure in the ABAP Dictinary after this step. The database table, however, does not
contain any data.
The system also tries to set a database lock for the table being converted. If the lock is set, application
programs cannot write to the table during the conversion.
The conversion is continued, however, even if the database lock cannot be set. In such a case
application programs can write to the table. Since in such a case not all of the data might have been
loaded back into the table, the table data might be inconsistent.
You should therefore always make sure that no applications access the table being converted
during the conversion process.
Step 4: The data is loaded back from the temporary table (QCM table) to the new table (with MOVECORRESPONDING).
The data exists in the database table and in the temporary table after this step.
When you reduce the size of fields, for example, the extra places are truncated when you reload the
data.
Since the data exists in both the original table and temporary table during the conversion, the storage
requirements increase during the process. You should therefore verify that sufficient space is available in
the corresponding tablespace before converting large tables.
There is a database commit after 16 MB when you copy the data from the QCM table to the original
table. A conversion process therefore needs 16 MB resources in the rollback segment. The existing
database lock is released with the Commit and then requested again before the next data area to be
converted is edited.
When you reduce the size of keys, only one record can be reloaded if there are several records whose
key cannot be distinguished. It is not possible to say which record this will be. In such a case you should
clean up the data of the table before converting.
Step 5: The secondary indexes defined in the ABAP Dictionary for the table are created again.
Step 6: The temporary table (QCM table) is deleted.
Step 7: The lock set at the beginning of the conversion is deleted.
If the conversion terminates, the table remains locked and a restart log is written.
Caution: The data of a table is not consistent during conversion. Programs therefore should not access
the table during conversion. Otherwise a program could for example use incorrect data when reading the
table since not all the records were copied back from the temporary table. Conversions therefore
should not run during production! You must at least deactivate all the applications that use tables to
be converted.
You must clean up terminated conversions. Programs that access the table might otherwise run
incorrectly. In this case you must find out why the conversion terminated (for example overflow of the
corresponding tablespace) and correct it. Then continue the terminated conversion.
Since the data exists in both the original table and temporary table during conversion, the storage
requirements increase during conversion. If the tablespace overflows when you reload the data from the
temporary table, the conversion will terminate. In this case you must extend the tablespace and start the
conversion in the database utility again.
If you shorten the key of a table (for example when you remove or shorten the field length of key fields),
you cannot distinguish between the new keys of existing records of the table. When you reload the data
from the temporary table, only one of these records can be loaded back into the table. It is not possible
to say which record this will be. If you want to copy certain records, you have to clean up the table
before the conversion.
During a conversion, the data is copied back to the database table from the temporary table with the
ABAP statement MOVE-CORRESPONDING. Therefore only those type changes that can be executed
with MOVE-CORRESPONDING are allowed. All other type changes cause the conversion to be
terminated when the data is loaded back into the original table. In this case you have to recreate the old
state prior to conversion. Using database tools, you have to delete the table, rename the QCM table to
its old name, reconstruct the runtime object (in the database utility), set the table structure in the
Dictionary back to its old state and then activate the table.
If a conversion terminates, the lock entry for the table set in the first step is retained. The table can no
longer be edited with the maintenance tools of the ABAP Dictionary (Transaction SE11).
A terminated conversion can be analyzed with the database utility (Transaction SE14) and then
resumed. The database utility provides an analysis tool with which you can find the cause of the error
and the current state of all the tables involved in the conversion.
You can usually find the precise reason for termination in the object log. If the object log does not
provide any information about the cause of the error, you have to analyze the syslog or the short dumps.
If there is a terminated conversion, two options are displayed as pushbuttons in the database utility:
After correcting the error, you can resume the conversion where it terminated with the Continue
adjustment option.
There is also the Unlock table option. This option only deletes the existing lock entry for the table .
You should never choose Unlock table for a terminated conversion if the data only exists in the
temporary table, i.e. if the conversion terminated in steps 3 or 4. table for table TAB is therefore QCMTAB.
Hope this is helpful,Do reward. -
Help on locking MySQL tables (many can read, but only one can write) Java
Hi there,
I have a question regarding locking of tables so that only one person can write to the file, but many are able to read the files (or tables entities).
I am not sure if I need to lock the tables in my Java code or do I lock the tables within the MySQL syntax. I'm just a little confused on the matter.
This java code is a working prototype of inserting a customer data into the database and that works fine. I just don't know how to implement it so that only one person can update the table at a time.
Here is the Customer.java code that I have written.
Help would be greatly appreciated, thanks so much.
package business;
//~--- non-JDK imports --------------------------------------------------------
import shared.info.CustomerInfo;
//~--- JDK imports ------------------------------------------------------------
import java.sql.*;
* @author
public class Customer {
static Connection con = DBConnection.getConnection();
private CustomerInfo info = new CustomerInfo();
private String customerID;
private String firstName;
private String lastName;
private String email;
private String addressID;
private String homePhone;
private String workPhone;
private String unitNum;
private String streetNum;
private String streetName;
private String city;
private String provinceState;
private String country;
private String zipPostalCode;
public Customer(String id) {
try {
PreparedStatement pstmt = con.prepareStatement("SELECT * FROM " +
"Customer NATURAL JOIN Address WHERE CustomerID = ?");
pstmt.setString(1, id);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
customerID = rs.getString("CustomerID");
firstName = rs.getString("FirstName");
lastName = rs.getString("LastName");
homePhone = rs.getString("HomePhone");
workPhone = rs.getString("WorkPhone");
email = rs.getString("Email");
city = rs.getString("City");
provinceState = rs.getString("ProvinceState");
country = rs.getString("Country");
zipPostalCode = rs.getString("ZipPostalCode");
unitNum = rs.getString("UnitNum");
streetNum = rs.getString("StreetNum");
streetName = rs.getString("StreetName");
addressID = rs.getString("AddressId");
} catch (SQLException e) {
e.printStackTrace();
info.setCustomerID(customerID);
info.setFirstName(firstName);
info.setLastName(lastName);
info.setHomePhone(homePhone);
info.setWorkPhone(workPhone);
info.setEmail(email);
info.setCity(city);
info.setProvinceState(provinceState);
info.setCountry(country);
info.setZipPostalCode(zipPostalCode);
info.setUnitNum(unitNum);
info.setStreetNum(streetNum);
info.setStreetName(streetName);
info.setAddressID(addressID);
public static void addCustomer(CustomerInfo cust) {
try {
int id = -1;
PreparedStatement pstmt = con.prepareStatement("INSERT INTO Address" +
"(UnitNum, StreetNum, StreetName, City, ProvinceState, Country," +
" ZipPostalCode) VALUES(?, ?, ?, ?, ?, ?, ?)");
pstmt.setString(1, cust.getUnitNum());
pstmt.setString(2, cust.getStreetNum());
pstmt.setString(3, cust.getStreetName());
pstmt.setString(4, cust.getCity());
pstmt.setString(5, cust.getProvinceState());
pstmt.setString(6, cust.getCountry());
pstmt.setString(7, cust.getZipPostalCode());
pstmt.executeUpdate();
ResultSet rs = pstmt.getGeneratedKeys();
rs.next();
id = rs.getInt(1);
pstmt = con.prepareStatement("INSERT INTO Customer" +
"(FirstName, LastName, HomePhone, WorkPhone, Email, AddressID)"
+ "VALUES(?, ?, ?, ?, ?, ?)");
pstmt.setString(1, cust.getFirstName());
pstmt.setString(2, cust.getLastName());
pstmt.setString(3, cust.getHomePhone());
pstmt.setString(4, cust.getWorkPhone());
pstmt.setString(5, cust.getEmail());
pstmt.setInt(6, id);
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
public void setFirstName(String newName) {
try {
PreparedStatement pstmt = con.prepareStatement("UPDATE Customer"
+ " SET FirstName = ? WHERE CustomerID = ?");
pstmt.setString(1, newName);
pstmt.setString(2, customerID);
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
firstName = newName;
public void setLastName(String newName) {
try {
PreparedStatement pstmt = con.prepareStatement("UPDATE Customer"
+ " SET LastName = ? WHERE CustomerID = ?");
pstmt.setString(1, newName);
pstmt.setString(2, customerID);
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
lastName = newName;
public String getFirstName() {
return firstName;
public String getLastName() {
return lastName;
public void setHomePhone(String number) {
try {
PreparedStatement pstmt = con.prepareStatement("UPDATE Customer"
+ " SET HomePhone = ? WHERE CustomerID = ?");
pstmt.setString(1, number);
pstmt.setString(2, customerID);
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
homePhone = number;
public String getHomePhone() {
return homePhone;
public void setWorkPhone(String number) {
try {
PreparedStatement pstmt = con.prepareStatement("UPDATE Customer"
+ " SET WorkPhone = ? WHERE CustomerID = ?");
pstmt.setString(1, number);
pstmt.setString(2, customerID);
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
workPhone = number;
public String getWorkPhone() {
return workPhone;
public void setEmail(String email) {
try {
PreparedStatement pstmt = con.prepareStatement("UPDATE Customer" + " SET Email = ? WHERE CustomerID = ?");
pstmt.setString(1, email);
pstmt.setString(2, customerID);
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
this.email = email;
public String getEmail() {
return email;
public void setUnitNum(String num) {
try {
PreparedStatement pstmt = con.prepareStatement("UPDATE Address" + " SET UnitNum = ? WHERE AddressId = ?");
pstmt.setString(1, num);
pstmt.setString(2, addressID);
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
unitNum = num;
public String getUnitNum() {
return unitNum;
public void setCity(String city) {
try {
PreparedStatement pstmt = con.prepareStatement("UPDATE Address" + " SET City = ? WHERE AddressId = ?");
pstmt.setString(1, city);
pstmt.setString(2, addressID);
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
this.city = city;
public String getCity() {
return city;
public void setStreetNum(String num) {
try {
PreparedStatement pstmt = con.prepareStatement("UPDATE Address" + " SET StreetNum = ? WHERE AddressId = ?");
pstmt.setString(1, num);
pstmt.setString(2, addressID);
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
streetNum = num;
public String getStreetNum() {
return streetNum;
public void setStreetName(String name) {
try {
PreparedStatement pstmt = con.prepareStatement("UPDATE Address"
+ " SET StreetName = ? WHERE AddressId = ?");
pstmt.setString(1, name);
pstmt.setString(2, addressID);
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
streetName = name;
public String getStreetName() {
return streetName;
public void setZipPostalCode(String code) {
try {
PreparedStatement pstmt = con.prepareStatement("UPDATE Address"
+ " SET ZipPostalCode = ? WHERE AddressId = ?");
pstmt.setString(1, code);
pstmt.setString(2, addressID);
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
zipPostalCode = code;
public String getZipPostalCode() {
return zipPostalCode;
public CustomerInfo getInfo(){
return info;
static void deleteCustomer(String customerId) {
try{
PreparedStatement pstmt = con.prepareStatement("DELETE FROM Customer" +
" WHERE CustomerId = ?");
pstmt.setString(1, customerId);
pstmt.executeUpdate();
}catch(SQLException e){
e.printStackTrace();
static void updateCustomer(CustomerInfo custInf) {
try{
PreparedStatement pstmt = con.prepareStatement("UPDATE customer" +
" SET firstName = ?, SET lastName = ?," +
" SET homePhone = ?, SET workPhone = ?, SET email = ?" +
" WHERE CustomerId = ?");
pstmt.setString(1, custInf.getFirstName());
pstmt.setString(2, custInf.getLastName());
pstmt.setString(3, custInf.getHomePhone());
pstmt.setString(4, custInf.getWorkPhone());
pstmt.setString(5, custInf.getEmail());
pstmt.setString(6, custInf.getCustomerID());
pstmt.executeUpdate();
pstmt = con.prepareStatement("UPDATE address" +
" SET unitNum = ?, SET StreetNum = ?, SET StreetName = ?," +
" SET city = ?,SET Province = ?,SET country = ?,SET ZipPostalCode = ?" +
" WHERE AddressId = ?");
pstmt.setString(1, custInf.getUnitNum());
pstmt.setString(2, custInf.getStreetNum());
pstmt.setString(3, custInf.getStreetName());
pstmt.setString(4, custInf.getCity());
pstmt.setString(5, custInf.getProvinceState());
pstmt.setString(6, custInf.getCountry());
pstmt.setString(7, custInf.getZipPostalCode());
pstmt.setString(8, custInf.getAddressID());
pstmt.executeUpdate();
}catch(SQLException e){
e.printStackTrace();
}In addition, here is my customer sql table.
-- Table structure for table `customer`
DROP TABLE IF EXISTS `customer`;
CREATE TABLE `customer` (
`CustomerID` mediumint(9) NOT NULL auto_increment,
`FirstName` varchar(20) NOT NULL,
`LastName` varchar(20) NOT NULL,
`HomePhone` varchar(11) NOT NULL,
`WorkPhone` varchar(11) default NULL,
`Email` varchar(20) NOT NULL,
`AddressID` mediumint(9) default NULL,
PRIMARY KEY (`CustomerID`),
KEY `AddressID` (`AddressID`),
CONSTRAINT `customer_ibfk_1` FOREIGN KEY (`AddressID`) REFERENCES `address` (`AddressID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- Dumping data for table `customer`
LOCK TABLES `customer` WRITE;
/*!40000 ALTER TABLE `customer` DISABLE KEYS */;
/*!40000 ALTER TABLE `customer` ENABLE KEYS */;
UNLOCK TABLES;to the best of my knowledge, this is something related to the database and not the programming. If you'd want to be the only user to read and edit the table, speicify only one user with that privilege and make it password protected. User must enter the password to write to the tables.
-
Hi everyone
I am a little confused by a situtation I have come across in one of our bespoke tables. I was under the impression that all fields in a table that are marked as Key form a Primary Key and therefore it is <b>impossible</b> to create records where these key fields contain duplciate data. However, I have found a bespoke table that is used for logging exception messages that appears to hold records with duplicates in the Key fields. Has anyone else come across this or have any idea how it might be happening? When creating a table is possible to specify a non-unique key in the same way you might for an internal table?! If it is relevant, the table is updated from a program that locks and unlocks the table before and afer the insert takes place and can be caused by both batch and manual changes.
Thanks
AndyThanks Roopesh
I understood the [ACCEPTING DUPLICATE KEYS] flag to mean that a a 'bulk' insert would not fail if a duplicate entry was identified but instead would set subrc to 4, skip the record in question and continue with subsequent records. If this is the case it still should not actually create duplciate entries - surely in doing so referential integrity is being violated...
Here is the section of code that performs the insert if that helps at all:
*lock table and insert processing log details
CALL FUNCTION 'ENQUEUE_EZLG_T024E'
EXPORTING
MODE_ZLG_T024 = 'E'
MANDT = SY-MANDT
EMPLOYER_REG_NO = zlg_t024-EMPLOYER_REG_NO
GRANT_CLAIM_NO = zlg_t024-GRANT_CLAIM_NO
ITEM = zlg_t024-ITEM
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.
insert zlg_t024.
* unlock table.
CALL FUNCTION 'DEQUEUE_EZLG_T024E'
EXPORTING
MODE_ZLG_T024 = 'E'
MANDT = SY-MANDT
EMPLOYER_REG_NO = zlg_t024-EMPLOYER_REG_NO
GRANT_CLAIM_NO = zlg_t024-GRANT_CLAIM_NO
ITEM = zlg_t024-ITEM
Kind regards
Andy -
Is there any function module to lock t024 table
is there lock object for t024 table?otherwise any fm for locking t024 table?
Hi Naren,
<b>Good ... check out the following documentation
Lock objects are used to lock the database table while making the modifications on the database table.
you can create your own lock objects using SE11.
if you create lock objects on any table system will create two function modules.
1.ENQUEUE....
2.DEQUEUE.....
first one is used to lock the table
second one used to removing lock on the table.
lock Table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = table_name
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
Unlock Table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
tabname = table_name
check this link :
http://help.sap.com/saphelp_40b/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
_SCOPE = 1: The lock is not sent to the update program. The lock is removed when the transaction is ended.
_SCOPE = 2: The lock is sent to the update program. The update program is responsible for removing the lock. The dialog program which requested the lock no longer has an influence on the lock behavior. This is the standard setting for the ENQUEUE function module.
_SCOPE = 3: The lock
Re: lock objects
Managingin lock entries
http://help.sap.com/saphelp_nw04/helpdata/en/37/a2e3ae344411d3acb00000e83539c3/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/cb/168237d30d974be10000009b38f8cf/frameset.htm</b>
Good Luck and thanks
AK -
Insert & Update while Locking tables
Update & Insert
Is it possible for me to insert a record and update 2 fields in another record, whil locking the database tables for the process to take place?
If so, how?
Thanks
PeteI don't know which database server you are using. But in MySQL, you can do something like this:
<?php
function get_next_number( $field = 'id' )
$id = 0;
//Lock the table for write
mysql_query('LOCK TABLES name_of_table WRITE');
$sql = 'SELECT '.$field.' FROM name_of_table ORDER BY '.$field.' DESC LIMIT 1';
$query = mysql_query($sql);
if ( mysql_num_rows($query) > 0 )
$row = mysql_fetch_row($query);
//Get the $field value
$id = $row[0];
//Unlock tables
mysql_query('UNLOCK TABLES');
return ++$id;
?>
I didn't test this function, but the idea is that
Check if you are connected to MySQL server
Regards,
Rafael -
Replace Table Data With Search
I want to run a search but only on a selected 8 cells, and want to change all the words "Blue" to "Red", even I select those cells when I hit Search it seems to replace all of the cells... Any ideas anyone?
Numbers won't do a find/replace limited to the selection.
Two ways of accomplishing this:
1. Don't use "Replace all". Instead,click "Find Next", then "Replace & Find"for each occurrence you want to change, and "Find next" on each that you wish to stay the same.
2. To limit the changes to a single table, select each of the tables you do NOT wish to change and go Arrange > Lock. When all are locked, proceed with the Find/Replace, using Replace All. All occurrences on the unlocked table will be replaced. All data on the Locked table(s) will remain unchanged.
Regards,
Barry -
Could anybody check and tell me whether Function Module ENQUEUE_E_TABLE
and DEQUEUE_E_TABLE are working fine and if it is so let me know the Parameters used for it.
Full reward points for issue solver.
Regards,
Amolhi..
check out the following documentation
Lock objects are used to lock the database table while making the modifications on the database table.
you can create your own lock objects using SE11.
if you create lock objects on any table system will create two function modules.
1.ENQUEUE....
2.DEQUEUE.....
first one is used to lock the table
second one used to removing lock on the table.
lock Table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = table_name
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
Unlock Table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
tabname = table_name
check this link :
http://help.sap.com/saphelp_40b/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
_SCOPE = 1: The lock is not sent to the update program. The lock is removed when the transaction is ended.
_SCOPE = 2: The lock is sent to the update program. The update program is responsible for removing the lock. The dialog program which requested the lock no longer has an influence on the lock behavior. This is the standard setting for the ENQUEUE function module.
_SCOPE = 3: The lock
Re: lock objects
Managingin lock entries
http://help.sap.com/saphelp_nw04/helpdata/en/37/a2e3ae344411d3acb00000e83539c3/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/cb/168237d30d974be10000009b38f8cf/frameset.htm
<b>Reward points if useful</b>
Regards
Ashu -
MYSQL backup, mysql -e "FLUSH TABLES WITH READ LOCK" doesnt work
I want to backup mysql locking tables first using flush tables with readlock, then do rsync and then unlock tables.
I want to do it automatically using script.
When I log in to mysql using: mysql -u root -p
the command:
FLUSH TABLES WITH READ LOCK;
works and locks the tables...but when I create my.cnf with login information to mysql:
[client]
user=root
password=xxx
the command:
mysql -e "SHOW DATABASES"
works and shows the databases....
but when I run this command:
mysql -e "FLUSH TABLES WITH READ LOCK"
it doesnt lock the tables...why?
thanksAre calling the 'mysql -e' command as your user or as root? If you call it as root (typical for a backup script), then the .my.cnf file needs to be in /root instead of $HOME.
Scott -
Hi All
I have to update table ADRC from another internal table of type ADRC.
My question is by which Function Module i can put a lock on ADRC and then release after update.
Regards
Jai<b>Lock table</b>
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = table_name
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
<b> Unlock Table</b>
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
tabname = table_name
chk this BAPI
<b>BAPI_BUPA_ADDRESS_CHANGE</b>
Message was edited by:
Chandrasekhar Jagarlamudi -
How can we lock the table?? how can we lock the record
Hi
how can we lock the complete table?? how can we lock the record ?/
Thanks
RamaLock objects are used to lock the database table while making the modifications on the database table.
you can create your own lock objects using SE11.
if you create lock objects on any table system will create two function modules.
1.ENQUEUE....
2.DEQUEUE.....
first one is used to lock the table
second one used to removing lock on the table.
lock Table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = table_name
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
Unlock Table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
tabname = table_name
check this link :
http://help.sap.com/saphelp_40b/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
_SCOPE = 1: The lock is not sent to the update program. The lock is removed when the transaction is ended.
_SCOPE = 2: The lock is sent to the update program. The update program is responsible for removing the lock. The dialog program which requested the lock no longer has an influence on the lock behavior. This is the standard setting for the ENQUEUE function module.
_SCOPE = 3: The lock
Re: lock objects
Reward if this helps. -
Hi,
I am writing program to upload data from excel to custom tables.
Here i add/ update/delete records from the table based on entries from excel sheet.
While i run this program, how do i maintain locks on the table, so that any other user is not modifying the tables at the same time.
Points will be awarded immediately.
Thanks<b>Lock objects</b> are used to lock the database table while making the modifications on the database table.
you can create your own lock objects using SE11.
if you create lock objects on any table system will create two function modules.
<b>1.ENQUEUE....
2.DEQUEUE.....</b>
first one is used to lock the table
second one used to removing lock on the table.
<b>This lock object</b> facilitates synchronous process. That is suppose if you are changing the table entries, and simultaneously there might be several programs running in the background or by anything else which also does changes to the same table. In this case you can lock the table so that other program will not able to update/insert/ do any other operation unless or until your program executes successfully.
You can create lock objects for this purpose in transaction SE11. SAP by default create 2 function modules. One for locking ( Enqueue) and other for unlocking ( Dequeue ). You can call these function module in appropriate places in your program.
ex...
lock Table
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = table_name
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
Unlock Table
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
tabname = table_name
<b><u>check the below links:</u></b>
http://help.sap.com/saphelp_40b/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
Re: lock objects
Regards,
Moqeeth.
Maybe you are looking for
-
How to import an Quarkxpress 5 file into Indesign CS3
Hello, I am in trouble when trying to open with Indesign CS3 for windows a file created with Quarkxpress 5 for Mac. Do you have any hint? (file attached) thanks for support
-
Ipod nano video and radio????
hi, i have a ipod radio and i was wondering if you can putt a movie on it and watch it or can you putt radio stations from itunes on youre ipod?
-
HS : Connecting from 9.2.0.8 database on AIX to MS SQL 2008R2
Hello , We have a requirement to connect from 9.2.0.8 database on AIX to MS SQL 2008R2 . Source : Oracle : 9.2.0.8 (64 bit) OS : AIX - 4.3.3.0/5.3.0.0 (64-bit) Target : MS SQL : 2008R2 OS : Windows 2008 (64-bit) 1] Can we use - Database Gateway for S
-
COGS Posting at the time of Invoicing
Hello Experts, We have a requirement wherein the COGS Posting should happen at the time of Invoicing. Our requirement is as below. At the time of Post Goods Issue Stock in Transit A/c Dr Finished Goods A/c Cr At the time of Invoicing we are ex
-
Lightroom 1.2 WHEN?
Ok we have all added our 2 cents for fine tuning Lightroom 1.1. Fall and heavy business is coming. When will 1.2 be released?