Splitting full filename into path and filename

By S V Raja

Splitting of a full filename into path and the filename could be achieved using the function module SO_SPLIT_FILE_AND_PATH.

Sample code:

REPORT Zsplit_filename .

PARAMETERS: FILENAME TYPE RLGRAP-FILENAME .

DATA: STRIPPED TYPE RLGRAP-FILENAME.
DATA: FILE_PATH TYPE RLGRAP-FILENAME.


CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'
EXPORTING
FULL_NAME = FILENAME
IMPORTING
STRIPPED_NAME = STRIPPED
FILE_PATH = FILE_PATH
* EXCEPTIONS
* X_ERROR = 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.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image