Application Development 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: 

Update Statement

Former Member
0 Kudos

Hi ,

I am using update statement to update a feild in a table

e.g.

UPDATE mara

SET <feild_name> = <value>

WHERE matnr IN g_r_matnr.

where g_r_matnr is a range for matnr.

When the number of records in the range is less the program works fine , but when it is large it results in a dump.

What i am planning to do is split this range into smaller sections and the use it , could you suggest some other alternative for it.

Regards

Arun

6 REPLIES 6

Former Member
0 Kudos

Hi,

You can try out loop at table where matnr in r_manr.

Update inside the loop based on index.

Cheers,

Sudhakar

anversha_s
Active Contributor
0 Kudos

hi,

1 . dont use UPDATE statement in standard SAP tables.

2. Use only MODIFY statement.

Regards

Anver

0 Kudos

Hi Anversha ,

Yes it is generally recommended to use the Modify command , but in my case i want to a large number of records and the feild to be modified is only 1 , so if i used the modify command i will first have to retreive all the data from the table MARA and the use this command.

Because is feel transporting addition does not work when we update database tables.

Regards

Arun

Former Member
0 Kudos

.hi,maybe you could check first the number of records prior your plan splitting your ranges, if the the records described less than range then no need to splitting

Former Member
0 Kudos

Arun,

data : v_num type i.

ranges : v_temp for .......

loop the range

i = i + 1.

v_temp-sign = 'EQ'

v_temp-option = 'I'

v_temp-low = 'EQ'

appen v_temp.

if i eq '2000'.

UPDATE mara

SET <feild_name> = <value>

WHERE matnr IN g_r_matnr.

clear i.

endloop.

Pls. mark if useful

Former Member
0 Kudos

THANKS A LOT