Open all | Close all

Get list of files within specific directory(Application server)


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

*&---------------------------------------------------------------------*
*& Report  ZDIRFILES                                                   *
*&---------------------------------------------------------------------*
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.


SAP ABAP development help
More SAP ABAP development help and information


ABAP code and information
More SAP ABAP development tips and tricks

 
 

Number of SAP Development Users currently online hit counters