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 select a path

Former Member
0 Likes
1,391

Is there function module only to select a path to do whatever you want with it?

thank you

Is there function module only to select a path to do whatever you want with it?

thank you

10 REPLIES 10
Read only

Former Member
0 Likes
1,356

Hi Maria ,

I am not clear with what exactly you mean.

Regards

Arun

Read only

Former Member
0 Likes
1,356

hi

check this FM

'F4_FILENAME'

example

DATA: F_FILE TYPE RLGRAP-FILENAME.

CALL FUNCTION 'F4_FILENAME'

IMPORTING

FILE_NAME = F_FILE.

regards

Sachin

Message was edited by:

Sachin Dhingra

Message was edited by:

Sachin Dhingra

Read only

Former Member
0 Likes
1,356
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    EXPORTING
      INITIAL_DIRECTORY       = GV_PATH
    CHANGING
      FILE_TABLE              = IT_FILETABLE
      RC                      = LV_RC
    EXCEPTIONS
      FILE_OPEN_DIALOG_FAILED = 1
      CNTL_ERROR              = 2
      ERROR_NO_GUI            = 3
      NOT_SUPPORTED_BY_GUI    = 4
      OTHERS                  = 5.
  IF SY-SUBRC = 0.
    READ TABLE IT_FILETABLE INTO L_FILE INDEX 1.
  ENDIF.
Read only

Former Member
0 Likes
1,356

HI Maria,

<b>Presentation Server:</b>

CONSTANTS: lcl_path TYPE char20 VALUE 'C:'.

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

def_path = lcl_path

mask = c_mask "',.,..'

mode = c_mode

title = text-006

IMPORTING

filename = p_f1

EXCEPTIONS

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 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.

flg_pre = c_x.

ENDIF.

Pick up the file path for the file in the <b>application server</b>

DATA: lcl_directory TYPE char128.

lcl_directory = p_direct.

CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'

EXPORTING

directory = lcl_directory

filemask = c_mask

IMPORTING

serverfile = p_f2

EXCEPTIONS

canceled_by_user = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • MESSAGE e000(zmm) WITH text-039.

  • flg_app = 'X'.

ENDIF.

Reward points if this Helps.

Manish

Message was edited by:

Manish Kumar

Read only

Former Member
0 Likes
1,356

Hi Maria,

for PATH-Slection use:

CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE

Hope it helps.

Regards, Dieter

An example:

PARAMETERS: P_FILE LIKE RLGRAP-FILENAME DEFAULT 'C:TMP'.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

*

DATA : TI TYPE STRING,

FO TYPE STRING.

*

TI = 'Windows Directory'.

*

CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE

EXPORTING

WINDOW_TITLE = TI

INITIAL_FOLDER = 'C:TMP'

CHANGING

SELECTED_FOLDER = FO

EXCEPTIONS

CNTL_ERROR = 1

ERROR_NO_GUI = 2

OTHERS = 3.

*

CALL METHOD CL_GUI_CFW=>FLUSH.

IF SY-SUBRC <> 0.

WRITE: / 'ERROR', SY-SUBRC.

ENDIF.

*

P_FILE = FO.

*

Regards, Dieter

Message was edited by:

Dieter Gröhn

Read only

Former Member
0 Likes
1,356

Hi,

Use the FM WS_QUERY. It will helps to you.

Regards

Bhupal Reddy

Read only

Former Member
0 Likes
1,356

Hi,

the FM <b>F4_DXFILENAME_TOPRECURSION</b> can be used for a file on the presentation- and applicationserver.

Regards,

Stefan

Read only

Former Member
0 Likes
1,356

Hi,

I always use these:

/SAPDMC/LSM_F4_FRONTEND_FILE

/SAPDMC/LSM_F4_SERVER_FILE

Kind regards, Rob Dielemans

Read only

Former Member
0 Likes
1,356

Hi Maria,

does your problem still exist?

regards, Dieter

Read only

0 Likes
1,356

Hi!

CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE is useful. Thank you very much