01-09-2008 10:55 AM
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
01-09-2008 11:02 AM
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
01-09-2008 11:02 AM
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
01-09-2008 11:30 AM
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
01-09-2008 11:05 AM
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
01-09-2008 11:33 AM
01-09-2008 11:40 AM