cancel
Showing results for 
Search instead for 
Did you mean: 

Update DB table from internal table in AMDP

VijayRao
Participant
0 Kudos
2,532

Hi,

I am trying to update a table from AMDP and the "ZMYTABLE1" has about 100,000 records.

Is this a good way to use UPDATE? Is this update called for each line or is does this use an array update?

This takes a long time to update and the program runs for more than 20 mins to update. Is there any better way?

FYI: ZMYTABLE is a table that has over 300 fields.

Accepted Solutions (0)

Answers (1)

Answers (1)

michael_koehler2
Participant
0 Kudos

Hi Vijay,

Not sure, but the explicit SET and the WHERE clause might be the performance problem here, causing comparisons for every row / column combination.

Try a block update like that:

UPDATE <dbtab> FROM TABLE <itab>.

No SET, no WHERE, no alias. Make sure <itab> has the same structure as <dbtab> and is filled with ALL the correct data in all columns. If necessary, do a pre-read first, to merge any incoming partial values.

See also the link: Alternative 3: ...from table <itab> for an example.

ABAP Keyword Help: UPDATE

Hope that helps,
Mike


VijayRao
Participant
0 Kudos

Hi Mike,

Thanks for your inputs. The syntax you have provided does not work in AMDP class. The reason I believe is that <itab> is not recognized as an internal table in AMDP instead it is considered as a tables parameter.

Regards,

Vijay

michael_koehler2
Participant
0 Kudos

...sorry, my bad - that comes from not reading the question correctly. I was under the impression we were talking about ABAP Open SQL... this AMDP thing was not on my radar screen. Now it is 😉