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

Function module to get Presentation server's directory on F4

Former Member
0 Likes
1,169

Hi,

Kindly tell me the Function Module to be used in the Selection screen parameter to get the "Local PC's Directory path".

I need only Directory path, because program will generate the file and send that into the selected directory.

Saurabh Garg

Hi,

Kindly tell me the Function Module to be used in the Selection screen parameter to get the "Local PC's Directory path".

I need only Directory path, because program will generate the file and send that into the selected directory.

Saurabh Garg

6 REPLIES 6
Read only

Former Member
0 Likes
867

Hi,

Check the below code.

parameters: p_file type rlgrap-filename.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'F4_FILENAME'

IMPORTING

file_name = p_file.

Read only

0 Likes
867

This Function Module is to get the Local PC's file name.

But I need ONLY DIRECTORY PATH

Read only

0 Likes
867

You can use the DIRECTORY_BROWSE or DIRECTORY_GET_CURRENT Method of the class CL_GUI_FRONTEND_SERVICES.

Arya

Read only

0 Likes
867

Hi,

I'm not supposed to use any Method.

There is an enhancement in the running program, I need FM which will serve the purpose.

Saurabh

Read only

Former Member
0 Likes
867

This program shows how to get F4 help from presentation server or application server

REPORT Z50651_FILENAMES_F4 MESSAGE-ID ZMSG_50651.

***********SELECTION SCREEN***********************

PARAMETERS : LOCAL RADIOBUTTON GROUP G1 USER-COMMAND UCOM1,

APPLN RADIOBUTTON GROUP G1 .

PARAMETERS : P_HEADER TYPE IBIPPARMS-PATH.

***********DATA DECLARATIONS*********************

DATA : V_FLAG,

V_HEADER1 TYPE DXFIELDS-LONGPATH,

V_HEADER TYPE IBIPPARMS-PATH.

AT SELECTION-SCREEN ON RADIOBUTTON GROUP G1.

PERFORM CHECK_RADIO.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_HEADER.

PERFORM GET_F4_HELP.

**************FORMS*********************************

&----


*& Form CHECK_RADIO

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM CHECK_RADIO .

CASE SY-UCOMM.

WHEN 'UCOM1'.

IF LOCAL = 'X'.

V_FLAG = 'L'.

ELSE.

V_FLAG = 'A'.

ENDIF.

ENDCASE.

ENDFORM. " CHECK_RADIO

&----


*& Form GET_F4_HELP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM GET_F4_HELP .

IF V_FLAG = 'L'.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

FIELD_NAME = 'P_HEADER'

IMPORTING

FILE_NAME = V_HEADER.

P_HEADER = V_HEADER.

ELSEIF V_FLAG = 'A'.

CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'

EXPORTING

I_LOCATION_FLAG = 'A'

I_SERVER = '?'

  • I_PATH =

FILEMASK = '.'

FILEOPERATION = 'R'

IMPORTING

  • O_LOCATION_FLAG =

  • O_SERVER =

O_PATH = V_HEADER1

  • ABEND_FLAG =

EXCEPTIONS

RFC_ERROR = 1

ERROR_WITH_GUI = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

ENDFORM. " GET_F4_HELP

Regards

Vasu

Read only

Former Member
0 Likes
867

NA