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: 

Regarding F4 help for Presentation server and application server

Former Member
0 Kudos

Hi All,

I have one functionality to achieve for my presentation and application server fields in my selection screen.

If i press F4 on Presentation server field it should take me to all the directories and i should be able to select upto directoty and it should fell in my field on sel-scree.

Ex: C:\TEMP\DATA\

If i press F4 on Application server field it should take me to all the directories and i should be able to select upto directoty and it should fell in my field on sel-scree.

Ex: /SAP/FI/INBOUND/

How this funtionality can be achieved.

Note: I will not select any file i would rather select directory and user will type in file name once Directory fells into the field.

Thanks in advance.

Thanks,

Deep.

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

use the function FILE_GET_NAME , it is used for both the presentation server and Application server.

read the documentation of the function,

4 REPLIES 4

Former Member
0 Kudos

Hi,

Please use below class and method cl_gui_frontend_services=>file_open_dialog

Regards

jana

Former Member
0 Kudos

Hi

Try this:

- Selection-screen

SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME TITLE TEXT-T01.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(30) FOR FIELD P_PS.
SELECTION-SCREEN POSITION 1.
PARAMETERS: P_PS RADIOBUTTON GROUP R1 MODIF ID AAA.
SELECTION-SCREEN END   OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(25) TEXT1 FOR FIELD P_FILE1.
PARAMETERS: P_FILE1 LIKE RLGRAP-FILENAME MODIF ID AAA.
SELECTION-SCREEN END   OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(30) FOR FIELD P_AS.
SELECTION-SCREEN POSITION 1.
PARAMETERS: P_AS RADIOBUTTON GROUP R1 MODIF ID AAA.
SELECTION-SCREEN END   OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 5(25) TEXT2 FOR FIELD P_FILE2.
PARAMETERS: P_FILE2 LIKE RLGRAP-FILENAME MODIF ID AAA.
SELECTION-SCREEN END   OF LINE.
SELECTION-SCREEN END   OF BLOCK BL1.

- F4 for presentation server

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE1.

  DATA: T_FILE_IN TYPE FILETABLE,
        W_FILE_IN TYPE FILE_TABLE,
        RC        TYPE I.

  CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    CHANGING
      FILE_TABLE              = T_FILE_IN
      RC                      = RC
    EXCEPTIONS
      FILE_OPEN_DIALOG_FAILED = 1
      CNTL_ERROR              = 2
      ERROR_NO_GUI            = 3
      OTHERS                  = 4.

  IF SY-SUBRC = 0.
    CHECK RC = 1.
    READ TABLE T_FILE_IN INTO W_FILE_IN INDEX 1.
    MOVE W_FILE_IN TO P_FILE1.
  ENDIF.

- F4 for application server

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE2.

  CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
       IMPORTING
            SERVERFILE       = P_FILE2
       EXCEPTIONS
            CANCELED_BY_USER = 1
            OTHERS           = 2.
  IF SY-SUBRC <> 0.

  ENDIF.

Max

0 Kudos

Hi All,

It will give entire path with file name.

App. Server:

Ex: /SAP/FI/VATITEM01012008.txt will be displayed in case of App. Server. I just need to get /SAP/FI/ then user will type the file name to which output need to be passed.

Pres. Server:

Ex: C:\DATA\FI\VATITEM01012008.txt will be displayed in case of App. Server. I just need to get C:\DATA\FI\ then user will type the file name to which output need to be passed.

If it is not possible to achieve it by F4 then if i get /SAP/FI/VATITEM01012008.txt as my file path what is the logic to discard file name and i should get only upto last directoriey: /SAP/FI/

I have one more issue this is not related to above one.

Supoose i have 2 text fields in my selection screen:

1. Logical File path.

2. File for Logical File path.

If user enters F4 on 1st field he will get all the logical paths available in the system.

Then in the 2nd field if user presses F4 it should show all the files against 1st field logical file path directory. How can we achieve this!

Ex: In FILE Transaction : My logical file path is: ZLFTEST

I have assigned physical path as: /SAP/FI/DATA/IN/<FILENAME>

In our case if user selects ZLFTEST in 1st field and then presses F4 on 2nd field it should give me all the file names stored under /SAP/FI/DATA/IN/

How can we achieve this!

Thanks for your time on issue reolution.

Thanks in advance!

Thanks,

Deep.

former_member188685
Active Contributor
0 Kudos

use the function FILE_GET_NAME , it is used for both the presentation server and Application server.

read the documentation of the function,