<?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: date in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626150#M603435</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;  Use this funcation module. and here is the complete code.. put this code in the initialization section .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : LV_LASTMONTH TYPE SY-DATUM,&lt;/P&gt;&lt;P&gt;       LV_MONTH(2) TYPE N,&lt;/P&gt;&lt;P&gt;       LV_LASTDAY TYPE SY-DATUM..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LV_LASTMONTH = SY-DATUM.&lt;/P&gt;&lt;P&gt;LV_MONTH = LV_LASTMONTH+4(2).&lt;/P&gt;&lt;P&gt;LV_MONTH = LV_MONTH - 1.&lt;/P&gt;&lt;P&gt;LV_LASTMONTH+4(2) = LV_MONTH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    DAY_IN                  = LV_LASTMONTH&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   LAST_DAY_OF_MONTH       = LV_LASTDAY&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DAY_IN_NOT_VALID        = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OTHERS                  = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jul 2007 13:15:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-24T13:15:42Z</dc:date>
    <item>
      <title>date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626145#M603430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to display the last date of previous month in the selection screen. For example today date is 24.07.2007 I need to display 30.06.2006. If the last month contains 31 days then I need to display 31.06.2006 like that. How to prepare the logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 12:59:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626145#M603430</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T12:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626146#M603431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;DATA: L_DATE LIKE SY-DATUM,&lt;/P&gt;&lt;P&gt;L_YEAR(4) TYPE n,&lt;/P&gt;&lt;P&gt;L_MONTH(3) TYPE n,&lt;/P&gt;&lt;P&gt;L_MONYR(7) TYPE n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;L_DATE = sy-datum. (here l_date = "input you give")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_year = l_date(4).&lt;/P&gt;&lt;P&gt;l_month = l_date+4(2).&lt;/P&gt;&lt;P&gt;L_MONTH = L_MONTH - 1.&lt;/P&gt;&lt;P&gt;IF L_MONTH LT 1.&lt;/P&gt;&lt;P&gt;L_YEAR = L_YEAR - 1.&lt;/P&gt;&lt;P&gt;L_MONTH = 12.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Roja Velagapudi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 13:01:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626146#M603431</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T13:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626147#M603432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey bharat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this FM to get the date .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;calculating past 1 month date&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      DATE      = sy-datum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      DAYS      = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      MONTHS    = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SIGNUM    = '-'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      YEARS     = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALC_DATE = v_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards if helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Azad.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 13:02:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626147#M603432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T13:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626148#M603433</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;Check the following link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/determine-last-day-of-the-previous-month.htm" target="test_blank"&gt;http://www.sap-img.com/abap/determine-last-day-of-the-previous-month.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhaskar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 13:02:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626148#M603433</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T13:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626149#M603434</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;There's a function module 'OIL_LAST_DAY_OF_PREVIOUS_MONTH' that is used to determine the last day of the previous month. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Sample:&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;parameters : date1 like sy-datum. 

CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH' 
     EXPORTING 
          I_DATE_OLD = date1 
    IMPORTING 
         E_DATE_NEW = date1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 13:03:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626149#M603434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T13:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626150#M603435</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;  Use this funcation module. and here is the complete code.. put this code in the initialization section .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : LV_LASTMONTH TYPE SY-DATUM,&lt;/P&gt;&lt;P&gt;       LV_MONTH(2) TYPE N,&lt;/P&gt;&lt;P&gt;       LV_LASTDAY TYPE SY-DATUM..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LV_LASTMONTH = SY-DATUM.&lt;/P&gt;&lt;P&gt;LV_MONTH = LV_LASTMONTH+4(2).&lt;/P&gt;&lt;P&gt;LV_MONTH = LV_MONTH - 1.&lt;/P&gt;&lt;P&gt;LV_LASTMONTH+4(2) = LV_MONTH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    DAY_IN                  = LV_LASTMONTH&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   LAST_DAY_OF_MONTH       = LV_LASTDAY&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DAY_IN_NOT_VALID        = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  OTHERS                  = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 13:15:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626150#M603435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T13:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626151#M603436</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 the function module "RP_CALC_DATE_IN_INTERVAL" to calculate the previous month and function module "RP_LAST_DAY_OF_MONTHS" to get the last date of the month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using this code.&lt;/P&gt;&lt;P&gt;Data :      m_date type sy-datum,&lt;/P&gt;&lt;P&gt;	         Last_date type sy-datum.&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;P&gt;*calculating previous1 month date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATE = sy-datum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DAYS = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MONTHS = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SIGNUM = '-'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YEARS = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALC_DATE = m_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the last date of the month&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;#145;RP_LAST_DAY_OF_MONTHS&amp;#146;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DAY_IN =  m_date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LAST_DAY_OF_MONTH = last_date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if it was useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hema.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 13:16:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626151#M603436</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T13:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626152#M603437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Are you talking about hardcoding the date in selection-screen??&lt;/P&gt;&lt;P&gt;If you have a variant you can activate dynamic date calculation for the date variable, so that the selection screen will be populated automatically.&lt;/P&gt;&lt;P&gt;Goto SE38 - select variant - selection variable- check dynamic selection.- give the option u need&lt;/P&gt;&lt;P&gt; Let me know if you need help on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 13:48:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/date/m-p/2626152#M603437</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T13:48:29Z</dc:date>
    </item>
  </channel>
</rss>

