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: 

FM for selecting file path from apps server dynamically

Former Member
0 Kudos

Hi all,

Is there any FM for selecting a file path from apps server directily in the selection-screen.

waiting for reply.

thanks & regards,

J.prakash.

11 REPLIES 11

Former Member
0 Kudos

Hi,

can anybody of u will tell how to use the FM 'TMP_GUI_DIRECTORY_LIST_FILES', i.e., a bit of code i need.

0 Kudos

Hi Prakash,

try this.

CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'

EXPORTING

DIRECTORY = T_DIREC

TABLES

FILE_TABLE = FILE_TABLE

DIR_TABLE = DIR_TABLE .

IF DIR_TABLE[] IS INITIAL.

CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'

EXPORTING

TEXTLINE1 = 'Please Enter Valid Directory'

TEXTLINE2 = 'Ex: d:\temp'.

MESSAGE e013(zmamin) WITH ''.

V_FLAG = ''.

Reward if useful.

Thanks

Aneesh.

Former Member
0 Kudos

Hi Prakash,

You need to use logical file name concept and after that ise Fm FILE_GET_NAME.

Reward points if useful.

Regards,

Atish

Former Member
0 Kudos

hi Prakash,

Here is d solution.

call FM : RZL_READ_DIR

pass the path in NAME(export parameter)

like C:\ - U will get all the files and folders in table parameter FILE_TBL

and size having 0000000000 are folders .

display these files and folders in any formate - i suggest - list display in popup window .

let user select any file /folder

if folder is selected call this FM once again - ohterwise if file is selected - get it in some variable

and do anything with it according to your requirement

Njoy..

Reward if it helps..

Former Member
0 Kudos
PARAMETERS: f_app(128).
 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR f_app.
  PERFORM get_fname_app.
 
 
FORM get_fname_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.
ENDFORM.                    "get_fname_app

0 Kudos

...

Former Member
0 Kudos

Hi Prakash,

try using this fn module .. '/SAPDMC/LSM_F4_SERVER_FILE'.

Regards,

Vidya.

Former Member
0 Kudos

Hi Prakash,

Check out this :

PARAMETERS : p_f2 LIKE rlgrap-filename.

CONSTANTS : c_mask TYPE char9 VALUE ',*.*,*.*.'.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_f2.

*-- Browse Application Server

PERFORM f1001_browse_appl_file.

&----


*& Form f1001_browse_appl_file

&----


  • text

----


FORM f1001_browse_appl_file .

DATA: lcl_directory TYPE char128.

lcl_directory = '/local'.

CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'

EXPORTING

directory = lcl_directory

filemask = c_mask

IMPORTING

serverfile = p_f2

EXCEPTIONS

canceled_by_user = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • MESSAGE e000(zmm) WITH text-039.

  • flg_app = 'X'.

ENDIF.

ENDFORM. " f1001_browse_appl_file

-SatyaPriya

Former Member
0 Kudos

Hi Prakash,

You can use the class CL_GUI_FRONTEND_SERVICES also for this, instead of using Function module..

Regards

Indrajit

0 Kudos

What method of CL_GUI_FRONTEND_SERVICES can i use for this?

Former Member
0 Kudos

"ABAP code for retrieving list of files contained within specific Application server
  " directory(SAP).


REPORT  ZDIRFILES    .


PARAMETER: p_fdir            type pfeflnamel DEFAULT '/usr/sap/tmp'.

data: begin of it_filedir occurs 10.
        include structure salfldir.
data: end of it_filedir.


************************************************************************
*START-OF-SELECTION
START-OF-SELECTION.
* Get Current Directory Listing for OUT Dir
  call function 'RZL_READ_DIR_LOCAL'
       exporting
            name     = p_fdir
       tables
            file_tbl = it_filedir.

* List of files are contained within table it_filedir
  loop at it_filedir.
    write: / it_filedir-NAME.
  endloop.

Reward points if it is usefull....

Girish