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 Statement

Former Member
0 Likes
595

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
Read only

Former Member
0 Likes
571

Hi,

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

Update inside the loop based on index.

Cheers,

Sudhakar

Read only

anversha_s
Active Contributor
0 Likes
571

hi,

1 . dont use UPDATE statement in standard SAP tables.

2. Use only MODIFY statement.

Regards

Anver

Read only

0 Likes
571

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

Read only

Former Member
0 Likes
571

.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

Read only

Former Member
0 Likes
571

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

Read only

Former Member
0 Likes
571

THANKS A LOT