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: 

F4 help for Application Server Directory

Former Member
0 Kudos

Hi All,

I am having a Selection screen with a Parameter. This parameter will have a Directory name of Application server. Now if I press F4 on Parameter, i want to see

available directory on application server.

Please provide any sample code.

Thanks in advance.

5 REPLIES 5

Former Member
0 Kudos

Hi Vipin,

check this FM's

<u>Files on App.Server</u>

<b>F4_DXFILENAME_TOPRECURSION</b>

<u>Directories on App.Server</u>

<b>/SAPDMC/LSM_F4_SERVER_FILE</b>

Check this thread for sample code.

Simple Code

REPORT ZEXCEL .

*DATA : P_NAME LIKE dxfields-longpath.

*DATA : BEGIN OF itab OCCURS 0,

  • a(1000) TYPE c,

  • END OF itab.

PARAMETERS: P_NAME LIKE dxfields-longpath.

data: itab type string.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_NAME.

CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'

EXPORTING

DIRECTORY = ' '

FILEMASK = ' '

IMPORTING

SERVERFILE = P_NAME

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.

OPEN DATASET P_NAME FOR INPUT IN BINARY MODE.

WHILE sy-subrc = 0.

do.

READ DATASET P_NAME INTO itab.

enddo.

ENDWHILE.

CLSOE DATASET P_NAME.

Regards,

Raghav

Former Member
0 Kudos

Hi Vipin,

You can refer these links,

Hope this helps...

Regards,

Hema.

    • Reward points if it is useful.

Former Member
0 Kudos

One more to add: <b>EPS_GET_DIRECTORY_LISTING</b>

Regards

Eswar

Former Member
0 Kudos

Hi Vipin,

Use the following code for F4 on parameter:

DATA: f_path TYPE string .

IF f_path IS INITIAL.

f_path = '\..'.

ENDIF.

CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'

EXPORTING

directory = f_path

IMPORTING

serverfile = p_file_path <Parameter for File Name>

EXCEPTIONS

canceled_by_user = 1

OTHERS = 2.

Regards,

Chetan.

PS:Reward points if this helps.

Former Member
0 Kudos

1. p_file TYPE localfile ,

2. CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'

EXPORTING

directory = space

filemask = space

IMPORTING

serverfile = p_file

EXCEPTIONS

canceled_by_user = 1

OTHERS = 2.

g_physical_path = p_file. " Set the file path

may be this code is helpful for you.