Application Development 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: 

Upload text file

sergio_cifuentes
Participant
0 Kudos

Hi i need to upload a file, i'm using the function 'GUI_UPLOAD', but i'm using a specific file path i need that my program let the user select the file i.e. like a popup window to select the file and get the file path in some variable or something like that.

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos

Hi Sergio,

Please check this sample code.


PARAMETERS P_FILE LIKE RLGRAP-FILENAME. 

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

CALL FUNCTION 'WS_FILENAME_GET'
  EXPORTING
    DEF_PATH = P_FILE
    MASK = ',*.*.'
    MODE = '0 '
    TITLE = 'Choose File'
  IMPORTING
    FILENAME = P_FILE
  EXCEPTIONS
    INV_WINSYS = 1
    NO_BATCH = 2
    SELECTION_CANCEL = 3
    SELECTION_ERROR = 4
    OTHERS = 5. 

Also check this links.

http://www.sapdevelopment.co.uk/file/file_fmfile.htm

http://www.sapdevelopment.co.uk/file/file_uptabpc.htm

Hope this will help.

Regards,

Ferry Lianto

2 REPLIES 2

ferry_lianto
Active Contributor
0 Kudos

Hi Sergio,

Please check this sample code.


PARAMETERS P_FILE LIKE RLGRAP-FILENAME. 

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

CALL FUNCTION 'WS_FILENAME_GET'
  EXPORTING
    DEF_PATH = P_FILE
    MASK = ',*.*.'
    MODE = '0 '
    TITLE = 'Choose File'
  IMPORTING
    FILENAME = P_FILE
  EXCEPTIONS
    INV_WINSYS = 1
    NO_BATCH = 2
    SELECTION_CANCEL = 3
    SELECTION_ERROR = 4
    OTHERS = 5. 

Also check this links.

http://www.sapdevelopment.co.uk/file/file_fmfile.htm

http://www.sapdevelopment.co.uk/file/file_uptabpc.htm

Hope this will help.

Regards,

Ferry Lianto

0 Kudos

Thanks, that's exactly what i want.