Application Development and Automation 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: 
Read only

FM to get the application server path?

Former Member
0 Likes
4,263

Hi,

Is there a way/FM to find a path of the application server? As it wud be dynamic for each user?

Hi,

Is there a way/FM to find a path of the application server? As it wud be dynamic for each user?

9 REPLIES 9
Read only

Former Member
0 Likes
1,912

Hi,

Try the Fun Module FIND_DB_APPLICATION_SERVER

Regards,

Anji

Read only

0 Likes
1,912

Call function 'F4_DXFILENAME_TOPRECURSION'

Exporting

i_location_flag = ' '

i_server = ' '

i_path = ' '

Filemask = '.'

Fileoperation = 'R'

Importing

  • O_LOCATION_FLAG =

  • O_SERVER =

o_path = p_file*

  • ABEND_FLAG =

exceptions

rfc_error = 1

others = 2.

  • Parameter name to which you want to assign the output of the function module

Read only

Former Member
0 Likes
1,912

F4_DXFILENAME_TOPRECURSION <- use this

FIND_DB_APPLICATION_SERVER for default path

Ramesh.

Read only

0 Likes
1,912

This FM gives me somethng like this sapds31_S31_31

that's not wht I want. I want the path which comes by default when u click on the browse button it's like


BNGRDC-S-01006\Chethana.Shivamurthy$\cached\Profile Data\SapWorkDir\

I want to fetch this path. Is this possible? how?

Read only

Former Member
0 Likes
1,912

Hi,

May be check this,

F4_FILENAME_SERVER “ File Path on Server

Regards,

Vinail. K

Read only

0 Likes
1,912

Hi,

What input I shud give for this FM? I just want application server default path so that I concatenate a file name and store my file there. I'm not getting whch file name I have to give for this?

Just tried with local file name and application server file name but it gives an error.

Read only

0 Likes
1,912

Hi refer this code sampel.

<b>Get list of files within specific directory(Application server)

ABAP code for retrieving list of files contained within specific Application server directory(SAP). </b>

REPORT  ZDIRFILES    .


PARAMETER: p_fdir            type pfeflnamel DEFAULT '/usr/sap/tmp'.

data: begin of it_filedir occurs 10.
        include structure salfldir.
data: end of it_filedir.


************************************************************************
*START-OF-SELECTION
START-OF-SELECTION.
* Get Current Directory Listing for OUT Dir
  call function 'RZL_READ_DIR_LOCAL'
       exporting
            name     = p_fdir
       tables
            file_tbl = it_filedir.

* List of files are contained within table it_filedir
  loop at it_filedir.
    write: / it_filedir-NAME.
  endloop.

http://www.sapdevelopment.co.uk/file/file_getdirfiles.htm

http://www.sapdevelopment.co.uk/file/file_disall.htm

Hope this solves ur problem. Reward points if this helps.

Read only

Former Member
0 Likes
1,912

hi,,

CALL FUNCTION 'FILE_GET_NAME_USING_PATH'

EXPORTING

CLIENT = SY-MANDT

LOGICAL_PATH = P_LPATH "logical path

OPERATING_SYSTEM = SY-OPSYS

FILE_NAME = 'XXX' "file name

IMPORTING

FILE_NAME_WITH_PATH = LV_FILE

EXCEPTIONS

PATH_NOT_FOUND = 1

MISSING_PARAMETER = 2

OPERATING_SYSTEM_NOT_FOUND = 3

FILE_SYSTEM_NOT_FOUND = 4

OTHERS = 5.

IF SY-SUBRC <> 0.

*--error.

endif.

__________________________________________________________

You could simply try opening it. If sy-subrc <> 0, then you know that the path/filename is not found.

open dataset d1........

if sy-subrc <> 0.

write:/ 'File path not found'.

endif.

__________________________________________________________________

Try FM

RKZ_GET_POSITION_SEQ_FILE...

Also try

giving the file path without the .txt extension.

Hope it works...

_________________________________________________________________

You can use this SUBST_GET_FILE_LIST

use fm EPS_GET_DIRECTORY_LISTING

Please see this example

http://www.sapdevelopment.co.uk/file/file_disall.htm

sri

Read only

former_member189059
Active Contributor
0 Likes
1,912

the simplest way would be to run transaction CG3Y and see what path is shown there by default