Skip to Content
0
Former Member
Feb 12, 2007 at 07:14 AM

plz modify this program to update the table fields

25 Views

ata : fs_zfm_handy like zfm_handy,

fs_zfmkstel like zfmkstel,

fs_temp_zfm_handy like zfm_handy,

fs_temp_zfmkstel like zfmkstel.

data : t_table1 like table of fs_zfm_handy.

data : save_ok like sy-ucomm,

ok_code like sy-ucomm.

data : f1_rec type n.

call screen 200.

module status_0100 output.

set pf-status 'ZSTATUS'.

endmodule.

MODULE USER_COMMAND_0100 INPUT.

SAVE_OK = OK_CODE.

CLEAR OK_CODE.

*

CASE OK_CODE.

when 'SAVE'.

IF f1_rec ne 1.

update zfm_handy from fs_temp_zfm_handy.

update zfmkstel from fs_temp_zfmkstel.

endif.

when 'others'.

if fs_temp_zfm_handy-telnum ne fs_zfm_handy-telnum or

fs_temp_zfm_handy-kartnr ne fs_zfm_handy-kartnr.

clear f1_rec.

if fs_zfm_handy-telnum is not initial.

if fs_zfm_handy-kartnr is initial.

select * from zfm_handy into table t_table1 where telnum = fs_temp_zfm_handy-telnum.

endif.

endif.

IF sy-subrc EQ 0 and sy-dbcnt GT 1.

Write : / ' Please provide the second key field also '.

ELSEIF

sy-subrc EQ 0 and sy-dbcnt EQ 1.

read table t_table1 into fs_zfm_handy index 1.

endif.

endif.

endcase.

endmodule.