‎2009 Nov 10 6:06 AM
Hi to all,
i have created table control with wizard. and i'm uploading the data into table control from excel ****, after upload function i'm getting all rows from excel sheet to table control and i'm saving this into on customized table now my requirement is that i need to do copy-paste function within table control itself. Suppose user copy some rows from table control and again paste within same table control, how shall i achieve this functionality? how can i use mark field or cursor-field from table control structure?
Thanks in Advance...
‎2009 Nov 10 6:33 AM
Hi,
You could try something like this
Have two buttons 'COPY' and 'PASTE' as sub functional buttons for the table control. Go to the layout of your table control -> Check the w/sel column and give a name lets say 'MARK'. We get the selection column on the table control.
In your TOP, declare a field for 'MARK' in your internal table (that which is in synch with your table control) like this
data: begin of it_tab occurs 0,
check(1) type c,
--------------
end of it_tab.
Now, in the PAI inside the module enclosed with LOOP...ENDLOOP for the table control, write the functionality.
PROCESS BEFORE OUTPUT.
LOOP AT it_tab WITH CONTROL tcl.
MODULE check_data.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE clear_internal_table.
LOOP AT it_tab.
MODULE it_itab_mod.
ENDLOOP.
MODULE clear_internal_table INPUT.
clear it_tab[].
ENDMODULE.
MODULE it_itab_mod INPUT.
wa_tab-check = mark. "Transfer the status of mark field on table control to internal table that is select the fields you want to copy
case sy-ucomm.
when 'F_COPY'.
if wa_tab-check = 'X'.
wa_tab_temp = wa_tab.
append wa_tab_temp to it_tab_temp.
endif.
endcase.
ENDMODULE.
MODULE check_data OUTPUT.
if sy-ucomm eq 'F_PASTE'.
ztable-field1 = wa_tab-field1.
ztable-field2 = wa_tab-field2.
endif.
ENDMODULE.
P.S. This is just a rough template. Try building on the core logic according to your requirement and convenience.
‎2009 Nov 10 6:45 AM
Hi,
I want to use ctrlC and ctrlV keys within table control. Please suggest.
Thanks
‎2009 Nov 10 6:58 AM
Hi,
To my knowledge I dont know of a method that can capture such keyboard events (except for a few ).
‎2009 Nov 10 7:16 AM
i tried with CL_TABLECONTROL class but it's not working. i dont know which exact method or attribute i need to use for this..do you have any idea
‎2009 Nov 10 7:36 AM
>
> uploading the data into table control from excel ****,
>
This is a professional forum. Kindly check your spelling
‎2009 Nov 10 8:59 AM
please ignore the above.Done by mistake
Pranjal11 wrote:uploading the data into table control from excel sheet,