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

Update the database table

Former Member
0 Likes
1,164

Hi,

I want to update the table bseg.I have the values of belnr,gjahr and bukrs.If i use the keyword "Update" performance issue is occured.How to update the table is someother way.Plz help

1 ACCEPTED SOLUTION
Read only

awin_prabhu
Active Contributor
0 Likes
1,128

Have u tried MODIFY dbtab FROM TABLE itab.

Also try using BAPI's for updating database.

11 REPLIES 11
Read only

Former Member
0 Likes
1,128

hi,

its not a gud practive to directly update the database table...

instead use some function module to update the database tables.....

then you will not get any performance issues

Regards,

Siddarth

Read only

awin_prabhu
Active Contributor
0 Likes
1,129

Have u tried MODIFY dbtab FROM TABLE itab.

Also try using BAPI's for updating database.

Read only

0 Likes
1,128

I tired to use as

MODIFY bseg from gw_bkpf.

gi_bkpf is of type bkpf.This is throwing error.How to correct it

Read only

0 Likes
1,128

hi ,

please check the data type of gw_bkpf... it should be of type bseg.

use the code given below...

data : w_bseg type bseg.

move-corresponding gw_bkpf to w_bseg.
modify bseg from w_bseg.

Regards,

Siddarth

Read only

0 Likes
1,128

Declare work area of type BSEG . Error is becz u r updating table with workarea of different type

Read only

0 Likes
1,128

Thanks this is working out.In addition to this have to set a value of the field when i modify the table.In the "Update" statement we have the option is there any way to do the same in MODIFY also

Read only

0 Likes
1,128

typoes: begin of tyt_bseg,

belnr type bseg-belnr,

end of ty_bseg.

data:it_bseg type standard table of ty_bseg,

wa_bsefg type ty_bseg.

loop at it_bseg into wa_bseg .

modify bseg from wa_bseg.

endloop.

Read only

Former Member
0 Likes
1,128

Y ur not using Modify Key word as u said this is not much performance.

Read only

_IvanFemia_
Active Contributor
0 Likes
1,128

Hi,

do not update standard table directly, some inconsistences may occur... Find a BAPI that is useful for you!!!

Regards,

Ivan

Read only

Former Member
0 Likes
1,128

Hi,

The MODIFY statement will scan all records in database table before making an UPDATE or an INSERT. That's why you are having performance issues. If you are able to know wether your current record already exists or not use INSERT or UPDATE instead.

DESPITE ALL THIS, YOU SHOULD NEVER UPDATE DIRECTLY A STANDARD DATABASE TABLE.

Use FI function modules or batch input to upadate your data.

Issa

Read only

Former Member
0 Likes
1,128

use

modify <dtab> from table <itab>.

Regards,

Lalit Mohan Gupta.