Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC Selection screen in module pool screen

Former Member
0 Likes
595

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

4 REPLIES 4
Read only

vinoth_aruldass
Contributor
0 Likes
565

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

Read only

0 Likes
565

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

Read only

0 Likes
565

Thank you vaibhav did the same got it

Read only

0 Likes
565

Thank you vinoth for ur reply