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

Upload text file

sergio_cifuentes
Participant
0 Likes
364

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
Read only

Former Member
0 Likes
339

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
Read only

Former Member
0 Likes
340

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

Read only

0 Likes
339

Thanks, that's exactly what i want.