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: 

equalent of F4_filename function module for application server file path

Former Member
0 Kudos

hi experts,

i am using cl_gui_frontend_services=>file_open_dialog

for bring file path dynamically for user, in front end.

same feature i want to give when i am trying upload file from application server.

kindly provide me function module or class method, which will do it.

thanks in advance

regards,

pavan

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use FM F4_DXFILENAME_TOPRECURSION

Sample code here

report ztest.

data : filename like DXFIELDS-LONGPATH.

data : begin of itab occurs 0,

a(200) type c,

end of itab.

*----


CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'

EXPORTING

I_LOCATION_FLAG = 'A'

*I_SERVER = '?'

*I_PATH =

FILEMASK = '.*'

*FILEOPERATION = 'R'

IMPORTING

*O_LOCATION_FLAG =

*O_SERVER =

O_PATH = filename

*ABEND_FLAG =

EXCEPTIONS

RFC_ERROR = 1

ERROR_WITH_GUI = 2

OTHERS = 3

.

*----


break-point.

open dataset filename for input in binary mode.

while sy-subrc = 0.

clear itab .

read dataset filename into itab.

append itab.

endwhile.

*----


CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE =

FILENAME = 'd:\abc.txt'

FILETYPE = 'BIN'

TABLES

DATA_TAB = itab

.

Regards,

Satish

5 REPLIES 5

Former Member
0 Kudos

Hi,

Use FM F4_DXFILENAME_TOPRECURSION

Sample code here

report ztest.

data : filename like DXFIELDS-LONGPATH.

data : begin of itab occurs 0,

a(200) type c,

end of itab.

*----


CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'

EXPORTING

I_LOCATION_FLAG = 'A'

*I_SERVER = '?'

*I_PATH =

FILEMASK = '.*'

*FILEOPERATION = 'R'

IMPORTING

*O_LOCATION_FLAG =

*O_SERVER =

O_PATH = filename

*ABEND_FLAG =

EXCEPTIONS

RFC_ERROR = 1

ERROR_WITH_GUI = 2

OTHERS = 3

.

*----


break-point.

open dataset filename for input in binary mode.

while sy-subrc = 0.

clear itab .

read dataset filename into itab.

append itab.

endwhile.

*----


CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE =

FILENAME = 'd:\abc.txt'

FILETYPE = 'BIN'

TABLES

DATA_TAB = itab

.

Regards,

Satish

0 Kudos

hi satish,

i called that class in at selection-screen on value-request for p_fname.

in which event i need to call the function module given by u.

same P-fname is takeing input for both presentation and application file depending on some conditions.

regards,

pavan

Former Member
0 Kudos

Hi Pavan Kumar,

If you need F4 help for selecting logical filepath, declare your parameter

tables : path.

parameters : var1 like path-pathintern.

If you want for physical filepath, you can try using pathextern

Regards,

Mohaiyuddin

former_member386202
Active Contributor
0 Kudos

Hi,

Use this FM WS_FILENAME_GET

Regards,

pRahsant

Former Member
0 Kudos

Use,

use transaction cg3y.

Thanks and Regards,