<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Finding the file name with Regular Expression in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259030#M1214776</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls see the code below:&lt;/P&gt;&lt;P&gt;  DATA: LONG_FILENAME TYPE  DBMSGORA-FILENAME,&lt;/P&gt;&lt;P&gt;            PURE_FILENAME TYPE  SDBAH-ACTID,&lt;/P&gt;&lt;P&gt;            PURE_EXTENSION TYPE  SDBAD-FUNCT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: SHIFTN  TYPE I,&lt;/P&gt;&lt;P&gt;        DEL_SLASH(1)   VALUE '/',&lt;/P&gt;&lt;P&gt;        DEL_POINT(1) VALUE '.'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    SEARCH LONG_FILENAME FOR DEL_SLASH.&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC &amp;gt; 0.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    SHIFTN = SY-FDPOS + 1.&lt;/P&gt;&lt;P&gt;    SHIFT LONG_FILENAME BY SHIFTN PLACES LEFT.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SPLIT LONG_FILENAME AT DEL_POINT INTO PURE_FILENAME PURE_EXTENSION.&lt;/P&gt;&lt;P&gt;  CONDENSE PURE_FILENAME NO-GAPS.&lt;/P&gt;&lt;P&gt;  CONDENSE PURE_EXTENSION NO-GAPS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keerthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Mar 2009 08:50:03 GMT</pubDate>
    <dc:creator>keerthy_k</dc:creator>
    <dc:date>2009-03-06T08:50:03Z</dc:date>
    <item>
      <title>Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259022#M1214768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having some requirment to find the file name for the input provided parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my program i am having an input parameter for file name. This contains both the file name and file stored location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example : C:\Dokumente und Einstellungen\xs234fs\Desktop\TEST_123_44.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the above example string i need to find only the file name that is TEST_123_44.txt by using Regular expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know how to get this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you ver much in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Feroz.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 08:23:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259022#M1214768</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-06T08:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259023#M1214769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have attached an F4 help to the filename input param, in that you can use the FM: GUI_FILE_SAVE_DIALOG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this there is a return param FILENAME which contains the name of the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

      CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
       EXPORTING
         window_title            = TEXT-001
         default_extension       = p_extens
         default_file_name       = ls_deffile
         initial_directory       = ls_initdet
       IMPORTING
         filename                = ls_filename "This contains the filemame
         path                    = ls_path
         fullpath                = ls_fullpath
         user_action             = ls_usaction.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else if you have hardcoded the filename in the input field you can use rthe FM: PC_SPLIT_COMPLETE_FILENAME to split the filenames into different components&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Mar 6, 2009 9:31 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 08:27:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259023#M1214769</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-03-06T08:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259024#M1214770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not Sure about regular expression, but there is a FM which can split the file path:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PC_SPLIT_COMPLETE_FILENAME&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 08:28:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259024#M1214770</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-06T08:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259025#M1214771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;also check: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SO_SPLIT_FILE_AND_PATH&lt;/P&gt;&lt;P&gt;CH_SPLIT_FILENAME&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 08:30:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259025#M1214771</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-06T08:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259026#M1214772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Feroz,&lt;/P&gt;&lt;P&gt;There are many threads with the same question on SCN. Did you search before posting ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 08:36:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259026#M1214772</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-06T08:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259027#M1214773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Feroz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the following FM:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SPLIT_FILENAME'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          LONG_FILENAME  = DBMSGORA-FILENAME&lt;/P&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;P&gt;          PURE_FILENAME  = LOCAL_ACTID&lt;/P&gt;&lt;P&gt;          PURE_EXTENSION = LOCAL_FUNCT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here  PURE_FILENAME will give the name of the file(eg ABC&amp;gt;DOC) as ABC and  PURE_EXTENSION  will give the extension as DOC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keerthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 08:39:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259027#M1214773</guid>
      <dc:creator>keerthy_k</dc:creator>
      <dc:date>2009-03-06T08:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259028#M1214774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Advait Gode,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not see any Regular expression thread related to this. I have seen function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need this by Regular Expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Feroz.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 08:43:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259028#M1214774</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-06T08:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259029#M1214775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 08:46:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259029#M1214775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-06T08:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259030#M1214776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls see the code below:&lt;/P&gt;&lt;P&gt;  DATA: LONG_FILENAME TYPE  DBMSGORA-FILENAME,&lt;/P&gt;&lt;P&gt;            PURE_FILENAME TYPE  SDBAH-ACTID,&lt;/P&gt;&lt;P&gt;            PURE_EXTENSION TYPE  SDBAD-FUNCT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: SHIFTN  TYPE I,&lt;/P&gt;&lt;P&gt;        DEL_SLASH(1)   VALUE '/',&lt;/P&gt;&lt;P&gt;        DEL_POINT(1) VALUE '.'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    SEARCH LONG_FILENAME FOR DEL_SLASH.&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC &amp;gt; 0.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    SHIFTN = SY-FDPOS + 1.&lt;/P&gt;&lt;P&gt;    SHIFT LONG_FILENAME BY SHIFTN PLACES LEFT.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SPLIT LONG_FILENAME AT DEL_POINT INTO PURE_FILENAME PURE_EXTENSION.&lt;/P&gt;&lt;P&gt;  CONDENSE PURE_FILENAME NO-GAPS.&lt;/P&gt;&lt;P&gt;  CONDENSE PURE_EXTENSION NO-GAPS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keerthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 08:50:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259030#M1214776</guid>
      <dc:creator>keerthy_k</dc:creator>
      <dc:date>2009-03-06T08:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259031#M1214777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Before anyone else posts an answer, the original poster is wanting to know how do this using &lt;SPAN __default_attr="16" __jive_macro_name="size"&gt;REGULAR EXPRESSIONS&lt;/SPAN&gt;.  Further references to split, or function modules will be deleted.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm tempted to remove the points, but seeing as the OP has seen fit to give them for the repeated wrong answers, that's up to him.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 09:06:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259031#M1214777</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-03-06T09:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259032#M1214778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've done a quick search on google, using keywords &lt;STRONG&gt;regex filename&lt;/STRONG&gt; and it seems the best advice is to not use regex for this purpose as it is difficult construct one that catches all.  I certainly couldn't find one that works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 09:13:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259032#M1214778</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-03-06T09:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259033#M1214779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May i know which rule i broke while answering this question?..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 10:10:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259033#M1214779</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-06T10:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259034#M1214780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't find any of your reply in the above posts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can we smell something here ? ( If you are supporting for some other ...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 16:11:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259034#M1214780</guid>
      <dc:creator>GauthamV</dc:creator>
      <dc:date>2009-03-06T16:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259035#M1214781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am interested in possibility of finding a solution through regex expression .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggested a link which has been deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So waiting for aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2009 16:13:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259035#M1214781</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-06T16:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Finding the file name with Regular Expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259036#M1214782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was searching for the same thing but I didn't find it. It took a bit but I made one that works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPLACE ALL OCCURRENCES OF REGEX '[\w:\\,\\,\/][\w,\s,[:punct:]]*[\\,\/]' in l_str_file with ''.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Erik Peterson on Jul 24, 2009 7:47 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2009 11:47:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-the-file-name-with-regular-expression/m-p/5259036#M1214782</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-24T11:47:18Z</dc:date>
    </item>
  </channel>
</rss>

