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: 

FM to select a directory from application server

Former Member
0 Kudos

Hi all,

I need a FM to select a directoroy from application server and the name for the file I am going to create.

It must be something like the FM GUI_FILE_SAVE_DIALOG, but for sap server.

Can anyone help me?

Thanks in Advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Use the code below:

PARAMETERS: f_app(128).

AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_app.

PERFORM get_fname_app.

&----


*& Form get_fname_app

&----


  • text

----


FORM get_fname_app.

DATA: c_fnh_mask TYPE dxfields-filemask VALUE '.',

search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',

file_path LIKE dxfields-longpath.

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.

ENDFORM. "get_fname_app

Hope it helps.

Lokesh

6 REPLIES 6

Former Member
0 Kudos

Hi,

There is no function module available to upload the documents to Application server. You need to use OPEN DATASET.....

Regards,

Satish

Former Member
0 Kudos

Hi

use

<b>CG3Z</b> transaction to place files on application server from presentation

or have to use OPEN DATASET, READ and TRANSFER dataset concepts

Regards

Anji

Former Member
0 Kudos

Hi ,

You can use FM F4_DXFILENAME_TOPRECURSION. This FM will provide you with the option to choos apllication server and the corresponding directory. You can try to test it stand alone in SE37 with default parameters and check if it suits your requirement.

<b>Reward points if useful</b>

Regards

Saket Sharma

null

null

Former Member
0 Kudos

Use the code below:

PARAMETERS: f_app(128).

AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_app.

PERFORM get_fname_app.

&----


*& Form get_fname_app

&----


  • text

----


FORM get_fname_app.

DATA: c_fnh_mask TYPE dxfields-filemask VALUE '.',

search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',

file_path LIKE dxfields-longpath.

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.

ENDFORM. "get_fname_app

Hope it helps.

Lokesh

0 Kudos

thank you Lokesh!

Former Member
0 Kudos

Hi again,

Thanks for all the answers.

Unfortunately, that's not help me, because F4_DXFILENAME_TOPRECURSION, let me choose one file that exist in the system, but I need to choose a directory and the name of a file i am going to create, so this file does not exist in the system.