2008 Mar 16 5:35 AM
hi to all
Can we paste data in fields of table control which is copied from non-sap (like excel) systems. Could u pls tell me, is it possible to take data from clipborad and paste into table control fields thru coding. If so pls give me the sample code.
thnx
Shubha
hi to all
Can we paste data in fields of table control which is copied from non-sap (like excel) systems. Could u pls tell me, is it possible to take data from clipborad and paste into table control fields thru coding. If so pls give me the sample code.
thnx
Shubha
2008 Mar 16 5:49 AM
Hi,
Follow these steps:-
1. First U need to upload in excel sheet to an Internal table
- For this u need a I/O field on screen and browse button to locate the excel sheet from drives.
- Write a module in PAI of screen as follows:
Module button_click.
In SE38 program code as follows:
Module button_browse.
if sy-ucomm = 'BROW'. "FCODE for browse button
call function from class cl_gui_frontend_services called file_open_dialog. it requests a file.
After, above function returns the filename and assign this file name to I/O field on screen.
endif.
2. Use one more button called Upload(UPL)
- write code in the above same Module button_click.
if sy-ucomm = 'UPL'.
if I/O field ne ''.
call function gui_upload.
here provide the name of internal table of table control to above function module.
refresh control <table control name> from screen <screen no>.
endif.
Bye
Thats All.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |