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: 

Folder on application server

Former Member
0 Kudos
116

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!

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos
69

Hi Chris,

You can use the method: DIRECTORY_EXIST of the CLASS: CL_GUI_FRONTEND_SERVICES.

Regards,

Ravi

Former Member
0 Kudos
69

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

Former Member
0 Kudos
69

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

Former Member
0 Kudos
69

this FM RZL_READ_DIR_LOCAL should work