2007 Dec 14 8:03 AM
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.
[code]
start-of-selection.
perform get_values.
perform get_data.
perform calculate_fill_table.
end-of-selection.
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.
endloop.
[/code]
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.
[code]
start-of-selection.
perform get_values.
perform get_data.
perform calculate_fill_table.
end-of-selection.
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.
endloop.
[/code]
2007 Dec 14 8:24 AM
Use COMMIT WORK after modify.
Clear Work Area After using append/modify statements.
Regards,
Satish
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |