Retrieve list of files from the OS level that match the import parameters
Type of Object – Enhancement
Description – Retrieve list of files from the OS level that match the import parameters
Function module – ZSUBST_GET_FILE_LIST
Function Group – ZSAUS (Repository Switch Tools)
In Standard Function Module ‘SUBST_GET_FILE_LIST’, length of directory and filename to 75 characters.
In this Function Module we can give maximum length of directory and filename to 120 characters and retrieve the list of files from the OS level that match the import parameter.
Step 1 : Need to create a structure with name ZBC_S_RSFILLST
Table Details
Component | Typing Method | Data Type | Length | Short Description |
---|---|---|---|---|
DIRNAME | TYPES | CHAR | 120 | name of directory. (possibly t |
NAME | TYPES | CHAR | 120 | name of entry. (possibly trunc |
TYPE | TYPES | CHAR | 10 | ” type of entry. |
LEN | TYPES | NUMC | 8 | ” length in bytes. |
OWNER | TYPES | CHAR | 8 | ” owner of the entry. |
MTIME | TYPES | NUMC | 6 | last modification date, second |
FMODE | TYPES | CHAR | 9 | Like “rwx-r-x–x”: protection |
USEABLE | TYPES | CHAR | 1 | |
SUBRC | TYPES | CHAR | 4 | |
ERRNO | TYPES | CHAR | 3 | |
ERRMSG | TYPES | CHAR | 40 | |
MOD_DATE | TYPES | DATS | 8 | |
TYPES | CHAR | 8 | HH:MM:SS | |
SEEN | TYPES | CHAR | 1 | |
CHANGED | TYPES | CHAR | 1 |
Step 2: Create Function Group – ZBC_SAUS
Description: Repository Switch Tools
Step 3: Create a Function Module with name ‘ZBC_SUBST_GET_FILE_LIST’ copying from Standard Function Module ‘SUBST_GET_FILE_LIST’
Import Parameter
Change the Associated Type to CHAR120.
Tables Parameter
Add the structure ‘ZBC_S_RSFILLST’ in the Associated type.
Source Code Parameter
Change the field length DIRNAME and NAME to 120 in the structure of FILE.
SAVE and ACTIVATE.
This Function Module is mainly use in the Interface object.
Example of the usage:
Click Execute
WARNING
The original SAP FM used as origin of this one has been removed from SAP, as it has/had security issues.