Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

To get the File path dynamically

Hi all,

I am using the <b>Gui_upload function, and i want to get the file dynamically from the search help</b>,

So please help me in finding the answer.

Thanks,

Girish

Tags:
replied

Hai Girish

Check the following Code

DATA: I_FILETABLE TYPE FILETABLE,

V_RC TYPE I.

PARAMETERS: P_FILE LIKE RLGRAP-FILENAME. "local file with contracts

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG

EXPORTING

WINDOW_TITLE = 'Find File'

DEFAULT_EXTENSION = 'C:\'

DEFAULT_FILENAME = ''

FILE_FILTER = ',..'

  • INITIAL_DIRECTORY =

  • MULTISELECTION =

  • WITH_ENCODING =

CHANGING

FILE_TABLE = I_FILETABLE

RC = V_RC

  • USER_ACTION =

  • FILE_ENCODING =

EXCEPTIONS

FILE_OPEN_DIALOG_FAILED = 1

CNTL_ERROR = 2

ERROR_NO_GUI = 3

NOT_SUPPORTED_BY_GUI = 4

others = 5

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

READ TABLE I_FILETABLE INTO P_FILE INDEX 1.

Thanks & Regards

Sreenivasulu P

Message was edited by: Sreenivasulu Ponnadi

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question