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.
Showing results for 
Search instead for 
Did you mean: 

Modify Table In Background Works Incorrect

Active Participant
0 Kudos

Hi Experts,

I have a Transparent Y* table with three primary key and some quantity fields.

program works daily in background job, selects some data from vbak, vbap etc. and inserts two new records every day using sytax "modify Y* from S_Y*".

I'm creating two records into internal table to insert to Y* table, but program inserts two records and modifies old two records.

When trying to run program in foreground all things are normallay.



perform get_values.

perform get_data.

perform calculate_fill_table.


perform update_table.

I am filling internal table with to records manually which will update the Y table.

form calculate_fill_table.




calc_values-abmpeur = ( calc_values-abmptl / 1000 ) / $a01_kur.

append calc_values. "Record One

clear calc_values.




calc_values-abmpeur = ( calc_values-abmptl / 1000 ) / $a03_kur.

append calc_values. "Record Two

endform. " calculate_fill_table

form update_table.

sort calc_values by key.

loop at calc_values.

clear i_sm.

i_sm-kvgr1 = calc_values-key. "Y* Table primary key

i_sm-upto = sy_datum. "Y* Table primary key

i_sm-fperi = $period. "Y* Table primary key

i_sm-tinvoiced = calc_values-ciroton. "Quantity Field




modify ysipraporsm from i_sm.




Former Member
0 Kudos

Use COMMIT WORK after modify.

Clear Work Area After using append/modify statements.