Skip to Content
0
Former Member
Jul 01, 2007 at 11:46 AM

modification of db table

12 Views

hi,

i have a reuirement of updating the data base tables.

i have 2 screens , in the first screen i have 4 push buttons '\

'CREATE' 'DELETE' 'CHANGE' 'EXPIRE' 'DISPLAY'

and in 2nd screen i have tabstrip with 8 tabs, and a table control in each

tab.

now if i click on change button,

the changes which i have done in screen has to get updated in data

base tables, but only one change is getting changed.

like if i have 3 changes , only 1 is getting updated in db table.

my code is below,i have written it in PAI of the screen.

LOOP AT gt_fin_prod INTO gs_fin_prod WHERE status EQ c_old.

  • CHECK gs_admn_patnr-status EQ space.

READ TABLE gt_fin_prod_old INTO gs_fin_prod_old

WITH KEY fin_prod = gs_fin_prod-fin_prod

status = c_old.

IF sy-subrc EQ 0.

gs_fin_prod_f-fin_prod = gs_fin_prod-fin_prod.

gs_fin_prod_f-fin_prod_desc = gs_fin_prod-fin_prod_desc.

APPEND gs_fin_prod_f TO gt_fin_prod_f.

CLEAR: gs_fin_prod, gs_fin_prod_f.

ENDIF.

ENDLOOP.

CHECK NOT gt_fin_prod_f[] IS INITIAL.

  • Modify data base table Zfin_products

MODIFY zfin_products FROM TABLE gt_fin_prod_f.

IF sy-subrc EQ 0.

  • Set record status as OLD in all lines of ITAB

gv_change = c_x.

CLEAR gs_fin_prod.

REFRESH gt_fin_prod_f.

ENDIF.

please tel me any thing wrong,

its urgent.