2012 Dec 20 6:22 AM
Dear Friends,
There is an requirement It is like this I created screen in that screen I have to keep two Buttons(Upload & Post). When I click on Upload it should give a popup to select a file from desktop or computer once it is selected it should display on the screen and when i click on Post It should insert the records in ZTABLE. Can any one help on this Requirement. Thank you
Moderator message: please do more research before posting.
Message was edited by: Thomas Zloch
2012 Dec 20 6:35 AM
hi,
Its very simple . under usercommand of update you write a logic for getting a file
using fm
f4_filename.
after getting file transfer it to internal table.
under post command .
write a logic for updating the table.
Hope it helps,
Vinoth
2012 Dec 20 7:02 AM
hi sandeep ,
assuming your data file is excel.
use this fm for pop up to select file :
WS_FILENAME_GET or file_save_dialog
use this FM to read data from file to internal table.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
i_line_header = 'X'
i_tab_raw_data = i_tab_raw_data
i_filename = filename
TABLES
i_tab_converted_data = i_tab_converted_data
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
and once your records are in internal table you can insert or append them in database table.
regards
vaibhav
2012 Dec 20 8:03 AM
2012 Dec 20 8:04 AM