07-04-2008 7:43 AM
Is there a Function module in se37 which will ask user to enter the filepath from where a file has to be uploaded?
07-04-2008 7:47 AM
KD_GET_FILENAME_ON_F4
use this FM...
the below method can also be used for the same purpose...
CALL METHOD cl_guid->directory_browse
EXPORTING window_title = 'Test'
CHANGING selected_folder = wf_path2.
CALL METHOD cl_gui_cfw=>flush.
Reward points if helpful..
Edited by: Rudra Prasanna Mohapatra on Jul 4, 2008 8:48 AM
Edited by: Rudra Prasanna Mohapatra on Jul 4, 2008 8:51 AM
07-04-2008 8:02 AM
How to get the file path to be entered as a pop -up on the screen as it happens in downloading of file ..
Is there any FM for this purpose?
07-04-2008 7:51 AM
F4_FILENAME
<removed by moderator>
Edited by: Mike Pokraka on Aug 4, 2008 9:36 AM
07-04-2008 7:51 AM
07-04-2008 7:52 AM
hi ,
As one of my colleague (Kannaiah Kavuri )
said, it is 'F4_FILENAME'.
07-04-2008 7:55 AM
Hi Shweta,
You can even make use of WS_FILENAME_GET to get the F4 help for file available in Presentation server.
<removed by moderator>
Thanks,
Asha
Edited by: Mike Pokraka on Aug 4, 2008 9:36 AM
07-04-2008 7:55 AM
hi,
please refer the following code.
selection-screen: begin of block b1 .
parameters : p_file type rlgrap-filename.
selection-screen: end of block b1 .
at selection-screen on value-request for p_file.
perform get_f4 changing p_file.
form: get_f4 changing g_file type rlgrap-filename.
data : s_file type ibipparms-path.
call function 'F4_FILENAME'
exporting
program_name = syst-cprog
dynpro_number = syst-dynnr
importing
file_name = s_file.
g_file = s_file. .
endform.
hope it is useful.
regards,
sreelakshmi.
07-04-2008 8:06 AM
Hi,
plz check this work for you.
FORM get_filename .
*Select File For Upload
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = c_title
multiselection = abap_false
CHANGING
file_table = it_filename
rc = v_rc
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.
CLEAR p_file.
*Reading a table it_filename.
READ TABLE it_filename INTO wa_filename INDEX 1.
p_file = wa_filename-filename.
ENDFORM. " get_filename
<removed by moderator>
thanks,
dhanashri.
Edited by: Mike Pokraka on Aug 4, 2008 9:36 AM
07-04-2008 8:08 AM
Use this code which is used rarely.
It has the flexibility to select the file from application as well as presentation.
Please reward if useful.
==========
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
PERFORM GET_FILE_DETAILS. " File selection using F4
FORM GET_FILE_DETAILS .
DATA : PATH LIKE DXFIELDS-LONGPATH.
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
I_LOCATION_FLAG = ' '
I_SERVER = '?'
IMPORTING
O_PATH = PATH.
P_FILE = PATH.
IF SY-SUBRC <> 0.
WRITE:/ TEXT-007. " Error in File selection. File could not be selected.
ENDIF.
ENDFORM. " GET_FILE_DETAILS
07-04-2008 8:22 AM
F4_FILENAME has the disadvantage of supporting only 128 characters. Espacially UNC path con be quiete longer.
Better use cl_gui_frontend_services=>file_open_dialog