Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Updating Database Table

Former Member
0 Likes
1,579

Hi All,

i have a program which Updates BSEG-ZUONR ,


UPDATE BSEG SET ZUONR = 'value'
where cond1
and cond2.

i have executed the program and it is working fine , but after 12 hrs i tested and it wasnt updating that particular field.

and i again retested after sometime it is working.

I somewhere read that , update database table will be dealt with locks and it is sensible if multiple ppl are accesing that table.

so is there any standard procedure or code or Function Module which can take care of all these issues.

and iam not getting any error messages or warnings , as in authorizations or something like that.

if there are any issues like this where can i get that status.

Thanks in Advance.

Kishore Kumar Yerra.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,398

Having you tried using the MODIFY statement instead?

Regards,

Rich Heilman

11 REPLIES 11
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,399

Having you tried using the MODIFY statement instead?

Regards,

Rich Heilman

Read only

0 Likes
1,398

Also use COMMIT WORK AND WAIT once you modify the record.

Read only

0 Likes
1,398

hi

since i have several where statements and conditions ,

and the code is inside a loop and a read table.

i thought update would be appropriate , and there is no bar on it.

Thanks in Advance

Kishore Kumar Yerra

Read only

Former Member
0 Likes
1,398

Hi

I think you should do a BDC program for trx FB09 to change that field.

If you want to change a value of BSEG, you have to change that value for the same field of account index table:

BSIS/BSAS for CO.GE

BSIK/BSAK for vendor

BSID/BSAD for customer

ZUONR field is a key for that tables.

Max

Read only

0 Likes
1,398

Max is right - you could be digging yourself into a hole you won't be able to get out of. Use BDC.

Rob

Read only

0 Likes
1,398

I updated a single assignment for a single document with a performance trace on. It did 13 inserts and 7 updates to SAP tables.

(Also 7 deletes).

Rob

Message was edited by: Rob Burbank

Read only

Former Member
0 Likes
1,398

hi kishore,

UPDATE BSEG SET ZUONR = 'value'

where cond1and cond2.

WHAT IS YOUR WHERE CONDITION?

IF YOU DON'T PROVIDE CORRECT CONDITION IT WON'T WORK.

REGARDS

VIJAY

Read only

0 Likes
1,398

hi

i have checked all the conditions and all of them are correct and i have tested hardcoding it both in program and also in Debug mode , but no results

Thanks in Advance

Kishore Kumar Yerra.

Read only

0 Likes
1,398

Could you please post your code , so we can take a look and suggest you something .

Thanks

Read only

former_member181966
Active Contributor
0 Likes
1,398

Try to use 'MODIFY' and also hardcode the value for "1" Record and see the effect . You’ll definitely able to do it . I am sure you must be missing some of the main condition , like belnr or any thing .

Thanks

Read only

Former Member
0 Likes
1,398

Hi Kishore

Use Commit Statement. It works. Example:

UPDATE BSEG SET ZUONR = 'value'

where cond1

and cond2.

Commit Work.

"Changes to lines made with the UPDATE command only become final after a database commit (see Logical Unit of Work (LUW)). Prior to this, any database update can be canceled by a database rollback (see Programming Transactions). "

Suresh B Mannem