2006 Oct 26 5:00 PM
I use F4_filename FM to help the user browse for files .
The requirement is :
There is a variant that has the Dir path :
corp-abc\sap-abap\.
The user wants that when he uses this variant and does an F4 , just the files listed in this directory should pop up for his selection ...?
2006 Oct 26 5:07 PM
YOu can alternative use the Class method:
CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG which has export parameters like:
INITIAL_DIRECTORY etc
Regards,
ravi
I use F4_filename FM to help the user browse for files .
The requirement is :
There is a variant that has the Dir path :
corp-abc\sap-abap\.
The user wants that when he uses this variant and does an F4 , just the files listed in this directory should pop up for his selection ...?
2006 Oct 26 5:07 PM
YOu can alternative use the Class method:
CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG which has export parameters like:
INITIAL_DIRECTORY etc
Regards,
ravi
2006 Oct 26 5:22 PM
hi,
Check out this
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
DEFAULT_FILENAME = '\corp-abcsap-abap'
CHANGING
FILE_TABLE = ITAB_FILE1_TABLE
RC = RC_FILE
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.Regards,
Santosh
2006 Oct 26 5:46 PM
Thanks for the replies ,
It works now
Message was edited by: SAP BEE
2006 Oct 26 5:53 PM
hi, try this code
parameters : filename like rlgrap-filename obligatory.
at selection-screen on value-request for filename.
perform get_file.
*&---------------------------------------------------------------------*
*& Form get_file
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form get_file.
call function 'KD_GET_FILENAME_ON_F4'
exporting
mask = '*.*'
changing
file_name = filename
exceptions
mask_too_long = 1
others = 2.
call function 'WS_UPLOAD'
exporting
filename = filename
filetype = 'DAT'
tables
data_tab = itab
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_table_width = 4
invalid_type = 5
no_batch = 6
unknown_error = 7
others = 8.
endform. " get_file
ibrahim