Skip to Content
author's profile photo
Former Member

what does the function module split_filename do?

what does the function module split_filename do?

Add comment
10|10000 characters needed characters exceeded

6 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Jul 03, 2007 at 11:17 AM

    Hi,

    It splits the file name Loke,

    full Name = 'C:\TEMP\TMP\TEST.XLS'

    Path shell be 'C:\TEMP\TMP'

    File shell be 'TEST.XLS'.

    Sample code :

    PARAMETERS: FULLNAME TYPE RLGRAP-FILENAME .

    DATA: STRIPPED TYPE RLGRAP-FILENAME.

    DATA: FILE_PATH TYPE RLGRAP-FILENAME.

    CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'

    EXPORTING

    FULL_NAME = FULLNAME

    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.

    Thanks,

    Reward If Helpful.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      It splits the file name with extension AND the Path.

      If Filename is <b>C:\documents and settings\folder\filename.txt</b>

      CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'

      EXPORTING

      FULL_NAME = "Your Entire Filename of Type FULL_NAME"

      IMPORTING

      STRIPPED_NAME = "Your FileName" "i.e.Filename.txt

      FILE_PATH = "Your File Path" "C:\documents and settings\folder

      • 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.

  • author's profile photo
    Former Member
    Posted on Jul 03, 2007 at 11:18 AM

    This FM splits the Filename and extension

    say your filename is TEST.TXT, output will be

    TEST

    TXT

    Message was edited by:

    Chandrasekhar Jagarlamudi

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Jul 03, 2007 at 11:20 AM

    Hi,

    This FM splits the file name and its extension.

    example:

    /oracle/BCE/saptrace/background/alert_BCE.log

    It will return

    PURE_FILENAME: alert_BCE

    PURE_EXTENSION:log

    Regards,

    Vinodh

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Jul 03, 2007 at 11:21 AM

    The function module splits the complete filename into filename and extension.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 22, 2007 at 01:25 PM

    HI THERE,

    THIS MIGHT GIVE YOU A BETTER IDEA

    PUT THE FILE NAME IN THE SCREEN C:\Documents and Settings\arehman\Desktop\New Folder

    REPORT ZAS_FILENAME.

    PARAMETERS: FULLNAME TYPE RLGRAP-FILENAME .

    *DATA: STRIPPED TYPE RLGRAP-FILENAME.

    *DATA: FILE_PATH TYPE RLGRAP-FILENAME.

    DATA: STRIPPED TYPE STRING.

    DATA: FILE_PATH TYPE STRING.

    CALL FUNCTION 'SO_SPLIT_FILE_AND_PATH'

    EXPORTING

    FULL_NAME = FULLNAME

    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.

    write:/'FILENAME', STRIPPED,/'FILE_PATH', FILE_PATH.

    HOPE THE MIGHT HELP

    ANUJ

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 22, 2007 at 02:24 PM

    Hi Sai,

    For simpler understanding.

    go to SE37, Enter SO_SPLIT_FILE_AND_PATH and execute.

    In next screen, give any file name and path in your system eg \Documents and Settings\USR\Desktop\test.txt ...

    and execute.

    you can see results for yourself.

    you can also test other simple funtional modules for yourself like simlar way.

    Award me. If helpful.

    Regards

    Venkat

    Add comment
    10|10000 characters needed characters exceeded