‎2008 Dec 27 6:57 AM
Dear friends
i have to update entered data in table control to data base table please suggest some modification in my coding for the same
following is my coding
report zrb_ins_data.
data wa_tmp_rebset type zrb_hed.
data wa_tmp_rebset1 type zrebate_items.
types:begin of st_hdr,
bukrs type zrb_hed-bukrs,
sch_typ type zrb_hed-sch_typ,
sch_desc type zrb_hed-sch_desc,
sch_no type zrb_hed-sch_no,
vtweg type zrb_hed-vtweg,
vkorg type zrb_hed-vkorg,
vkbur type zrb_hed-vkbur,
vkgrp type zrb_hed-vkgrp,
spart type zrb_hed-spart,
regio type zrb_hed-regio,
ort02 type zrb_hed-ort02,
ort01 type zrb_hed-ort01,
kunnr type zrb_hed-kunnr,
konzs type zrb_hed-konzs,
matkl type zrb_hed-matkl,
matnr type zrb_hed-matnr,
lifsk type zrb_hed-lifsk,
shtyp type zrb_hed-shtyp,
from_date type zrb_hed-from_date,
to_date type zrb_hed-to_date,
hkont type zrb_hed-hkont,
aufnr type zrb_hed-aufnr,
end of st_hdr.
types : begin of st_itm,
item_id type zrebate_items-sch_no,
sch_no type zrebate_items-sch_no,
from_dat type zrebate_items-from_dat,
to_dat type zrebate_items-to_dat,
type type zrebate_items-type,
qty_per_rate type zrebate_items-qty_per_rate,
key1 type zrebate_items-key1,
curr_com type zrebate_items-curr_com,
key2 type zrebate_items-key2,
qty_per_rate1 type zrebate_items-qty_per_rate1,
curr_com1 type zrebate_items-curr_com1,
end of st_itm.
data:it_hdr type table of st_hdr with header line,
wa_hdr type st_hdr,
it_itm type table of st_itm with header line,
wa_itm type st_itm.
controls ztbl type tableview using screen 1000.
*CALL SCREEN 1000.
&----
*& Module STATUS_1000 OUTPUT
&----
text
----
module status_1000 output.
set pf-status 'SYMBOL'.
set titlebar 'xxx'.
endmodule. " STATUS_1000 OUTPUT
&----
*& Module USER_COMMAND_1000 INPUT
&----
text
----
*module USER_COMMAND_1000 input.
&----
*& Module get_data OUTPUT
&----
text
----
&----
*& Module user_command_1000 INPUT
&----
text
----
module user_command_1000 input.
case sy-ucomm.
when 'EXEC'.
perform get_data.
endcase.
endmodule
&----
*& Form GET_DATA
&----
text
----
--> p1 text
<-- p2 text
----
form get_data .
move-corresponding wa_hdr to wa_tmp_rebset.
modify zrb_hed from wa_tmp_rebset.
move-corresponding wa_itm to wa_tmp_rebset1.
wa_tmp_rebset1-item_id = 'TS1234'.
wa_tmp_rebset1-sch_no = wa_hdr-sch_no.
wa_tmp_rebset1-from_dat = wa_itm-from_dat.
wa_tmp_rebset1-to_dat = wa_itm-to_dat.
append wa_itm to it_itm.
modify zrebate_items from wa_tmp_rebset1.
endform.
‎2008 Dec 27 7:05 AM
‎2008 Dec 27 7:16 AM
hi
this is not the way.
1st you will have to get data in internal table of table control in PAI b4 user command.
then at user command you can loop the internal table and move the data to your z table and modify it.