‎2008 May 08 7:47 PM
Hi Everyone,
I am trying to change field VERME(available stock) in LQUA table. The requirement is whenever the value is less than zero in VERME, we should change that to 0.
I know its not good to update the DB table directly, but there is no other alternative. The scope is very limited and I am trying to write some program just for this only purpose.
Have you guys any sample program for this requirement?
Thanks
Kumar.
‎2008 May 08 9:15 PM
select all the rows where VERME LT 0 together with the whole key in an internal table. Change the field VERME to zero.
Next use UPDATE statement like this:
UPDATE dbtable FROM TABLE db_itab.
If you have a lot of records that need to be updated, you might want to consider to select packages of a 1000 records at once.
‎2008 May 08 9:15 PM
select all the rows where VERME LT 0 together with the whole key in an internal table. Change the field VERME to zero.
Next use UPDATE statement like this:
UPDATE dbtable FROM TABLE db_itab.
If you have a lot of records that need to be updated, you might want to consider to select packages of a 1000 records at once.
‎2008 May 09 1:30 AM
While updating any data base , You should use the Lock Object concept also. So is some one else also trying to update the same table it doesn't give you short dump.
‎2008 May 09 12:24 PM
Hi,
You can update a database table by first locking the table using Function module
ENQUEUE_TABLE_E
by passing table name.
Then update record in table using statement
update LQUA set VERME = 0
WHERE VERME le 0.
After this statement unlock the database table using function module
DEQUEUE_TABLE_E.
Reward points if answer is helpfull.
Regads,
Mukul Sharma
‎2008 May 16 11:51 AM
hi,
you can use the lock object concept here firsst create one lock object in se11 and
update a database table by first locking the table using Function module
ENQUEUE_En by passing table name.Then update record in table using statement
update LQUA set VERME = 0WHERE VERME le 0.After this statement unlock the database table using function module
DEQUEUE_dE.
may be useful,
regards,
dilip
‎2008 May 22 9:45 PM
Closing the thread because no longer in search for that answer.