06-29-2006 4:28 PM
hi friends,
i have created a custom table. and for it i need to have a custom maintenence transactions.the custom transaction should consits of insert, copy a row and upload....
but i dont think we have an upload feature in SM30,
now my doubt is how can I solve this,,, by any other method & dilaog program being my last priority.
Please let me know if u guys get some idea
Thanks in advance
Tina
06-29-2006 4:35 PM
Hi,
use FM : GUI_UPLOAD to upload data into table , you can do this with normal report programming. for insert,copy and delete use SM30 functionality.
create a tansaction for table maintenance and call this transaction from report , implement the upload code also in that report.
Laxman
06-29-2006 4:36 PM
Upload? What does that do. Do you want to upload an entry into a table?
Sudha
06-29-2006 4:42 PM
yes sudha,
need to upload the data into the table.And user requirement is he wants all of them to be in a same transaction screen.
Even though I create a custom transaction and refer it for SM30 ,,, i need to upload a file and make entries in to the table....
Any idea of how do we need to implement it?
06-29-2006 5:07 PM
06-29-2006 5:09 PM
Tina,
Looks like you have not seen my answer, doesn't that work for you.
Regards,
Ravi
06-29-2006 5:10 PM
Hi
U can use the fm GUI_UPLOAD to read and store the file in internla table, after transfer the data from internal table to database table. This is an example:
PARAMETERS: P_FILE(120).
DATA: FILENAME TYPE STRING.
DATA: T_FILE LIKE TABLE OF <ZTABLE>.
START-OF-SELECTION.
FILENAME = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FILENAME
TABLES
DATA_TAB = T_FILE.
INSERT <ZTABLE> FROM T_FILE.
You can use this program only if the file have the same structure of Z-TABLE, otherwise you have to elaborate the data of T_FILE before inserting in the database.
Max
06-29-2006 4:36 PM
You can do this using a report program which will display the data in a ALV Grid.
For the upload functionality add a custom button and code it to accept a file and update the internal table there by updating the display.
Take a look at BCEDIT programs for a editable ALV grid.
Finally when you hit the save button you can update the database table and commit the work
Regards,
Ravi
Note : Please mark the helpful answers
Message was edited by: Ravikumar Allampallam
06-29-2006 5:15 PM
Hi Tina,
In case you have missed Ravi's post, here is a skeleton of the logic.
1) Have a button on a screen for upload.
2) In the PAI section of that scren, on the click of the button
case sy-ucomm.
when '<FCODE for buuton>;.
call function 'GUI_UPLOAD'
exporting filename = p_filename
tables data_tab = itab
endcase.
4)do a bdc for the custom trsnaction
5) Use call transaction/bdc session for the upload.
Regards,
ravi