2007 Apr 10 2:25 PM
Hello friends,
I'd like to know if a FM could allow me to check if a folder exists on an application server.
If there's no FM available can you tell me how to check?
Thanks in advance abapers!
Hi..
You just try to execute this function module it will give you list of directories present in Application server
F4_DXFILENAME_TOPRECURSION
And see this following Example to use this FM
DATA: c_fnh_mask TYPE dxfields-filemask VALUE '.',
search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',
file_path LIKE dxfields-longpath.
report y_test.
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
i_location_flag = 'A'
i_server = ' '
i_path = search_dir
filemask = c_fnh_mask
fileoperation = 'R'
IMPORTING
o_path = file_path
EXCEPTIONS
rfc_error = 1
OTHERS = 2.
IF sy-subrc EQ 0.
f_app = file_path.
ENDIF.
and
You can use t/code CG3Y to download a file from application server to presentation server and t/code CG3Z to upload a file to a application server from presentation server.
You can also use this FM GUI_DOWNLOAD or method CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD.
In the class CL_GUI_FRONTEND_SERVICES you can find others methods, for example:
FILE_GET_VERSION
FILE_OPEN_DIALOG
FILE_SAVE_DIALOG
GET_COMPUTER_NAME
GET_DESKTOP_DIRECTORY
Hope this will help.
If it helps reward with Points
Regards Rk
2007 Apr 10 2:28 PM
Hi Chris,
You can use the method: DIRECTORY_EXIST of the CLASS: CL_GUI_FRONTEND_SERVICES.
Regards,
Ravi
2007 Apr 10 2:30 PM
Hi,
Use the function module '/SAPDMC/LSM_F4_SERVER_FILE' for F4 help for Application server files. you need to write this in the AT SELECTION_SCREEN on FIELD REQUEST.
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
directory = ' '
filemask = ' '
IMPORTING
serverfile = p_afile
EXCEPTIONS
canceled_by_user = 1
OTHERS = 2.
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
Sudheer
2007 Apr 10 2:32 PM
Hi..
You just try to execute this function module it will give you list of directories present in Application server
F4_DXFILENAME_TOPRECURSION
And see this following Example to use this FM
DATA: c_fnh_mask TYPE dxfields-filemask VALUE '.',
search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',
file_path LIKE dxfields-longpath.
report y_test.
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
i_location_flag = 'A'
i_server = ' '
i_path = search_dir
filemask = c_fnh_mask
fileoperation = 'R'
IMPORTING
o_path = file_path
EXCEPTIONS
rfc_error = 1
OTHERS = 2.
IF sy-subrc EQ 0.
f_app = file_path.
ENDIF.
and
You can use t/code CG3Y to download a file from application server to presentation server and t/code CG3Z to upload a file to a application server from presentation server.
You can also use this FM GUI_DOWNLOAD or method CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD.
In the class CL_GUI_FRONTEND_SERVICES you can find others methods, for example:
FILE_GET_VERSION
FILE_OPEN_DIALOG
FILE_SAVE_DIALOG
GET_COMPUTER_NAME
GET_DESKTOP_DIRECTORY
Hope this will help.
If it helps reward with Points
Regards Rk
2007 Apr 10 2:35 PM
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |