<?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: To Split a variable to get the date. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761981#M905070</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Get strlen of the file and get the last 6 characters ..&lt;/P&gt;&lt;P&gt;I think month and year are stored at the last ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_len = strlen ( file1 ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_len = v_len - 6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_date = file1+v_len.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 May 2008 10:14:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-05T10:14:22Z</dc:date>
    <item>
      <title>To Split a variable to get the date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761979#M905068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    I have a variable 'file1'.This variable stores the names of the pdf files located in SAP directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The name of the file is like:'PDFST0000098357US81042008',&lt;/P&gt;&lt;P&gt; which containg order no ,sales org, month and date of that file creation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i have a requirement to extract that  month and year from this variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also some filenames have different format like'PDFIPF......' instead of 'PDFST.....'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so kindly suggest how to extract month and year from this variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:09:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761979#M905068</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T10:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: To Split a variable to get the date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761980#M905069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi use this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: month(2) , year (4),&lt;/P&gt;&lt;P&gt;data: tmp type i, len type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;len = strlen(file1).&lt;/P&gt;&lt;P&gt;tmp = len - 6.&lt;/P&gt;&lt;P&gt;month = file1+tmp(2).&lt;/P&gt;&lt;P&gt;tmp = tmp + 2.&lt;/P&gt;&lt;P&gt;year = file1+tmp(4).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:13:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761980#M905069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T10:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: To Split a variable to get the date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761981#M905070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Get strlen of the file and get the last 6 characters ..&lt;/P&gt;&lt;P&gt;I think month and year are stored at the last ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_len = strlen ( file1 ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_len = v_len - 6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_date = file1+v_len.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:14:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761981#M905070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T10:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: To Split a variable to get the date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761982#M905071</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;You can use fm STRING_REVERSE to reverse the name of the filename. Then go ahead and extact eight letters of the reversed string and once again reverse that, so at this you will get the date part in DDMMYYYY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again you can manipulate this date string to get back the original date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.  use string_reverse input filename, output reversed string.&lt;/P&gt;&lt;P&gt;2.  reversedstring+0(8) will extract date part ( reverse ).&lt;/P&gt;&lt;P&gt;3.  Again reverse this string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But seeing at the example, this would be tougher if the date in the filename is not in DDMMYYYY, meaning that if the date is 1st april 2008 then if the date format is DMYYYY(142008), then the logic would go for a toss.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;S. Chandramouli.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:18:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761982#M905071</guid>
      <dc:creator>former_member784222</dc:creator>
      <dc:date>2008-05-05T10:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: To Split a variable to get the date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761983#M905072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi rohan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u find the length of string , u have month an dyear at last only always, so u can easily cal the month , yr to diff strings&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into &amp;lt;string&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x = strlen&amp;lt;string&amp;gt;.&lt;/P&gt;&lt;P&gt;y = x - 6.&lt;/P&gt;&lt;P&gt;z = x - 4.&lt;/P&gt;&lt;P&gt;month = string + y(2).&lt;/P&gt;&lt;P&gt;year = string + z(4).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear string,x,y,z.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;chandu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:19:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761983#M905072</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T10:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: To Split a variable to get the date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761984#M905073</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;Try to use this code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_macro_name="DATA"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dharmishta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:22:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761984#M905073</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T10:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: To Split a variable to get the date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761985#M905074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But also sometimes the variable conatins 'pdfst0000096286us16c1'.&lt;/P&gt;&lt;P&gt;In such cases i have to add current year to that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:23:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761985#M905074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T10:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: To Split a variable to get the date.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761986#M905075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi after getting month and year in variables &lt;/P&gt;&lt;P&gt;do validation such as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have month in month and yar in year variable.&lt;/P&gt;&lt;P&gt;use ISP_GET_MONTH_NAME FM to validate month&lt;/P&gt;&lt;P&gt;and VALIDATE_YEAR to validate year &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if any one of fail use current month and year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 10:58:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-split-a-variable-to-get-the-date/m-p/3761986#M905075</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T10:58:22Z</dc:date>
    </item>
  </channel>
</rss>

