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: 

reg : one selection screen object ?

Former Member
0 Kudos

hi friends..

in my selection screen there is 2 radio button..

and one parameter..

by click the first button.. i want to select one file from application server

(i.e)path in the parameter

by click the second button.. i want to select one file from presentation server

(i.e)path in the parameter

3 REPLIES 3

Former Member
0 Kudos
parameters : p_file like rlgrap-filename.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  CALL FUNCTION 'F4_FILENAME'
       EXPORTING
            program_name  = v_repid
            dynpro_number = syst-dynnr
            field_name    = 'P_FILE'
       IMPORTING
            file_name     = p_file.

Former Member
0 Kudos
this is for application server

AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_app.
 

  DATA: c_fnh_mask TYPE dxfields-filemask VALUE '*.*',
  search_dir TYPE dxfields-longpath VALUE '/sapglobal/users',
  file_path LIKE dxfields-longpath.
 
  CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
    EXPORTING
      i_location_flag = 'A'
      i_server        = ' '
      i_path          = search_dir
      filemask        = c_fnh_mask
      fileoperation   = 'R'
    IMPORTING
      o_path          = file_path
    EXCEPTIONS
      rfc_error       = 1
      OTHERS          = 2.
  IF sy-subrc EQ 0.
    f_app = file_path.
  ENDIF.

ferry_lianto
Active Contributor
0 Kudos

Hi,

Use the following routine to provide F4 help depending on a parameter that tells you if the file is on application server or presentation server.


form f4_value_request_for_file using file type c.
 
  if p_local = 'X'.
*-- F4 for desktop file
    call function '/SAPDMC/LSM_F4_FRONTEND_FILE'
         exporting
              pathname         = ' '
         changing
              pathfile         = file
         exceptions
              canceled_by_user = 1
              system_error     = 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.
  else.
*-- F4 for server file
    call function '/SAPDMC/LSM_F4_SERVER_FILE'
         exporting
              directory        = ' '
              filemask         = ' '
         importing
              serverfile       = file
         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.
  endif.
 
endform.                     " F4_VALUE_REQUEST_FOR_FILE

Regards,

Ferry Lianto