<?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: Find pattern in a string in ABAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795678#M40429</link>
    <description>&lt;P&gt;i think Irrespective of comparing you can get your desired pattern by using certain function modules so , when user enters in any format the code in your prog can convert into desired format so comparison may not required.&lt;/P&gt;&lt;P&gt;For format conversion there are lot of FM available u can check on google or go on this thread&lt;/P&gt;&lt;P&gt;&lt;A href="https://archive.sap.com/discussions/thread/387802" target="test_blank"&gt;https://archive.sap.com/discussions/thread/387802&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Feb 2019 11:06:20 GMT</pubDate>
    <dc:creator>former_member596005</dc:creator>
    <dc:date>2019-02-01T11:06:20Z</dc:date>
    <item>
      <title>Find pattern in a string in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795672#M40423</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
  &lt;P&gt;I get an i_date with the following value from the table&lt;/P&gt;
  &lt;P&gt;ex: i_date = 'MM/DD/YYYY'. note: it can be changed by the user.&lt;/P&gt;
  &lt;P&gt;And o_date = '01/01/2019'.&lt;/P&gt;
  &lt;P&gt;How to find the patterns are matched or not. &lt;/P&gt;
  &lt;P&gt;I tried the below code, but I didn' t get my output. &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;
TABLES: map_rul.

data: i_date type string,
      o_date type string.


   o_date = '01/01/2019'.

select SINGLE low from map_rul into i_date where context = 'LOAD' and code = 'FORMAT'.

  write:/ 'Table date format:',i_date.
* Note: i_date value is 'MM/DD/YYYY'.

 if o_date cp i_date.
     WRITE: / 'Pattern matched'.
  else.
    write: / 'no pattern matched'.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;My code valuates the pattern and its value.&lt;/P&gt;
  &lt;P&gt;i just want to compare the pattern not a value.&lt;/P&gt;
  &lt;P&gt;any suggestions please...?&lt;/P&gt;
  &lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 09:47:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795672#M40423</guid>
      <dc:creator>former_member383962</dc:creator>
      <dc:date>2019-01-31T09:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Find pattern in a string in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795673#M40424</link>
      <description>&lt;P&gt;Have you read the ABAP help on CP? Does it anywhere say that you can use MM/DD/YY as a pattern? No - it doesn't. Always read the abap help if you don't know what a keyword does - don't guess and hope. You'll save time.&lt;/P&gt;&lt;P&gt;You could use the &lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmatches_functions.htm" target="_blank"&gt;matches&lt;/A&gt; function with a suitable regex. Probably if you search on the net for a date matching regex, you'll find it. &lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 10:21:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795673#M40424</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2019-01-31T10:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Find pattern in a string in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795674#M40425</link>
      <description>&lt;P&gt;Or even Find with a regular expression.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 13:07:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795674#M40425</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-01-31T13:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Find pattern in a string in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795675#M40426</link>
      <description>&lt;P&gt;To add to Matt's and Richard's mentions of regex (regular expression): check out program DEMO_REGEX_TOY in SE38 and play with the options. It comes with the documentation for what all - a lot! - is possible with regex. You can then use the demo-program and play with what you'd like to check.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 17:22:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795675#M40426</guid>
      <dc:creator>BaerbelWinkler</dc:creator>
      <dc:date>2019-01-31T17:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Find pattern in a string in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795676#M40427</link>
      <description>&lt;P&gt;You can refer code in FM DATE_CHECK_PLAUSIBILITY and write your own logic for checking date formats.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 20:50:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795676#M40427</guid>
      <dc:creator>monalisa_biswal</dc:creator>
      <dc:date>2019-01-31T20:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Find pattern in a string in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795677#M40428</link>
      <description>&lt;P&gt;A simple regex: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;\d{1,2}/\d{1,2}/\d{4}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2019 00:49:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795677#M40428</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2019-02-01T00:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Find pattern in a string in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795678#M40429</link>
      <description>&lt;P&gt;i think Irrespective of comparing you can get your desired pattern by using certain function modules so , when user enters in any format the code in your prog can convert into desired format so comparison may not required.&lt;/P&gt;&lt;P&gt;For format conversion there are lot of FM available u can check on google or go on this thread&lt;/P&gt;&lt;P&gt;&lt;A href="https://archive.sap.com/discussions/thread/387802" target="test_blank"&gt;https://archive.sap.com/discussions/thread/387802&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 11:06:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795678#M40429</guid>
      <dc:creator>former_member596005</dc:creator>
      <dc:date>2019-02-01T11:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Find pattern in a string in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795679#M40430</link>
      <description>&lt;P&gt;Thanks for all...&lt;/P&gt;&lt;P&gt;Issue is solved...&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 12:51:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-pattern-in-a-string-in-abap/m-p/795679#M40430</guid>
      <dc:creator>former_member383962</dc:creator>
      <dc:date>2019-02-06T12:51:31Z</dc:date>
    </item>
  </channel>
</rss>

