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: 

AL11 Directory F4 Help.

Former Member
0 Kudos
8,716

Hi,

How to implement F4 help for file path and name in report section screen?.

1. Report have file path and name filed in slection screen. I want to show directories in application server

as a F4 help.

parameters: P_APP type filepath-pathintern.

which displaying only some entries which are there in FILEPATH table.

Please advise how to implement AL11 f4 help.

Regards,

RC.

5 REPLIES 5

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
1,261

In my system I can reach it the same way I reach files on the PC. If you can get to your application server thru the network, then this will work for you as well. The file path must be valid.



report zrich_0003.

parameters: p_file1 type localfile .


at selection-screen on value-request for p_file1.

  data: start type string.
  data: ifiletable type filetable.
  data: xfiletable like line of ifiletable.
  data: return type i.


  start = '\<ip_address>qfilesvr400<system_name>usrsapTST'.

  call method cl_gui_frontend_services=>file_open_dialog
   exporting
*    WINDOW_TITLE            =
*    DEFAULT_EXTENSION       =
*    DEFAULT_FILENAME        =
*    FILE_FILTER             =
      initial_directory       = start
*    MULTISELECTION          =
    changing
      file_table              = ifiletable
      rc                      = return
*    USER_ACTION             =
*  EXCEPTIONS
*    FILE_OPEN_DIALOG_FAILED = 1
*    CNTL_ERROR              = 2
*    ERROR_NO_GUI            = 3
*    others                  = 4
          .
  if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.

  read table ifiletable into xfiletable index 1.

  p_file1 = xfiletable.


We are running on an AS400

Regards,

Rich Heilman

Lakshmant1
Active Contributor
0 Kudos
1,261

Hi Ravi,

You can try /SAPDMC/LSM_F4_SERVER_FILE function module.

Thanks

Lakshman

1,261

Yep, that will work too.



report zrich_0003.

parameters: p_file1 type localfile .


at selection-screen on value-request for p_file1.

  call function '/SAPDMC/LSM_F4_SERVER_FILE'
    EXPORTING
      DIRECTORY              = '/usr/sap/tst'
*     FILEMASK               = ' '
    IMPORTING
      SERVERFILE             = p_file1
*   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.

Regards,

Rich Heilman

0 Kudos
1,261

Hi Lakshman,

Function /SAPDMC/LSM_F4_SERVER_FILE is opening application server. But, when we are closing directory without choosing any path is leading to dump.

0 Kudos
1,261

Function not released by SAP, you should not use it