‎2008 Mar 10 10:35 AM
*requirement.-:* i created one table (ztable) and used all the fields on screen of my module pool program. during the execution of my program when i am my making entries in all fields and pressing save pushbutton all the data should be store in data base table (ztable).
if possible write some code to store the data in database table.
‎2008 Mar 10 11:22 AM
hi,
do u have table control or simple I/O field on screen?
if I/O field then in user_command module of PAI,
write like this
MODULE user_command_1000 INPUT.
CASE ok_code.
WHEN 'SAVE' OR 'SV'.
itab_mast-clnt = sy-mandt.
itab_mast-srno = srn.
itab_mast-comp_code = zform_track_mast-comp_code.
itab_mast-form_type = ifmtp-form_type.
itab_mast-form_series = form_series.
itab_mast-form_no = form_no.
itab_mast-form_date = zform_track_mast-form_date.
itab_mast-rcvd_issu = 'I'.
itab_mast-form_amt = form_amt.
INSERT INTO zform_track_mast VALUES itab_mast.
CLEAR ok_code.
CLEAR zform_track_mast-comp_code.
CLEAR zform_track_mast-form_date.
CLEAR ifmtp-form_type.
CLEAR form_series.
CLEAR form_no.
CLEAR form_amt.
CLEAR itab_mast.
REFRESH itab_mast.
ENDCASE.
ENDMODULE. " USER_COMMAND_1000 INPUT
reward if usefull.......
Edited by: Dhwani shah on Mar 10, 2008 12:23 PM
‎2008 Mar 10 11:25 AM
‎2008 Mar 11 10:49 AM
Hi Prakash,
Declare data types as
data : itab type standard table of mara,
wa type mara,
okcode type syucomm.
in layout for the following fields , give the names of the screen fields as
field1 '1001' ( insert this values)
field2 'FERT' (insert this values)
process after input .
refresh itab.
case okcode.
when 'SAVE'.
wa-matnr = Field1.
wa-mtart = Field2.
append wa to itab.
clear wa.
endcase.
INSERT ZMARA FROM TABLE itab.
this will work,
reward points