<?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: scripts in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/1613149#M274793</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is very simple since all date type fields in abap (in tables - type 'DATS', in programs - type d, also sy-datum in system table, etc.) are treated as simple numbers (integers, if u will...).&lt;/P&gt;&lt;P&gt;This means that if u check the value of these fields (in debugger) u will find the date today is 20060914 - this is YYYYMMDD format but it is treated as a number. With numbers u can do arithmetic operations: add, sub, etc.&lt;/P&gt;&lt;P&gt;Now all u have to do is add 7 and get the date u r looking for...&lt;/P&gt;&lt;P&gt;U don't have to check if it went to the next month or year since the system knows to do that. For example: if your field, mhnk-ausdt, has 30th dec 2006 in it, after adding 2 the result will be 1st jan 2007.&lt;/P&gt;&lt;P&gt;The system will calculate 20061230 + 2 and the result is 20070101.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this covers it...&lt;/P&gt;&lt;P&gt;Igal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Pls reward if it helps)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Sep 2006 19:10:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-14T19:10:20Z</dc:date>
    <item>
      <title>scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/1613145#M274789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi to all,&lt;/P&gt;&lt;P&gt;pplz help me in the issue,&lt;/P&gt;&lt;P&gt;i am having a field 'mhnk-ausdt' it is rundate in dunning &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need mhnk-ausdt + 7th day day like ex&lt;/P&gt;&lt;P&gt;mhnk-ausdt is 14th sep and 7th day of it is 21st sep&lt;/P&gt;&lt;P&gt;how can i achieve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;kiran kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: kiran kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2006 17:50:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/1613145#M274789</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-14T17:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/1613146#M274790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the function module DATE_IN_FUTURE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can add 7 days to the date you pass.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2006 18:51:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/1613146#M274790</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-14T18:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/1613147#M274791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to add 7 days to field 'MHNK-AUSDT' can be done by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MHNK-AUSDT = MHNK-AUSDT + 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above statement will add 7 days to the date. The above statement has to writted in the print program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to add the 7 days to the date in the form then you have to use PERFORM control command by passing the 'MHNK-AUSDT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SAPSCRIPT:&lt;/P&gt;&lt;P&gt;/: DEFINE &amp;amp;V_DATE&amp;amp; &lt;/P&gt;&lt;P&gt;/: PERFORM GET_DATE IN PROGRAM ZPROG&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;MHNK-AUSDT&amp;amp;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;V_DATE&amp;amp;&lt;/P&gt;&lt;P&gt;/: ENDPERFORM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Coding of the calling ABAP program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZPROG.

FORM GET_DATE TABLES IN_PAR STUCTURE ITCSY
                     OUT_PAR STRUCTURE ITCSY.
data: l_date like sy-datum.
*-- if the date is in MM/DD/YYYY format


READ TABLE IN_PAR WITH KEY &amp;#145;MHNK-AUSDT&amp;#146;.

IF SY-SUBRC = 0.
l_date+0(4) = IN_PAR-VALUE+6(4).
l_date+4(2) = IN_PAR-VALUE+0(2).
l_date+6(2) = IN_PAR-VALUE+3(2).
ENDIF.
l_date = l_date + 7.

READ TABLE OUT_PAR WITH KEY &amp;#145;V_DATE&amp;#146;.
IF SY-SUBRC = 0.
  write l_date to OUT_PAR-VALUE.
  MODIFY OUT_PAR INDEX SY-TABIX.
ENDIF.

ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2006 18:58:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/1613147#M274791</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-14T18:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/1613148#M274792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sid&lt;/P&gt;&lt;P&gt;how to use perfrom control command for getting the desired date&lt;/P&gt;&lt;P&gt;tahnks in advance,&lt;/P&gt;&lt;P&gt;kiran kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2006 19:02:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/1613148#M274792</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-14T19:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/1613149#M274793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is very simple since all date type fields in abap (in tables - type 'DATS', in programs - type d, also sy-datum in system table, etc.) are treated as simple numbers (integers, if u will...).&lt;/P&gt;&lt;P&gt;This means that if u check the value of these fields (in debugger) u will find the date today is 20060914 - this is YYYYMMDD format but it is treated as a number. With numbers u can do arithmetic operations: add, sub, etc.&lt;/P&gt;&lt;P&gt;Now all u have to do is add 7 and get the date u r looking for...&lt;/P&gt;&lt;P&gt;U don't have to check if it went to the next month or year since the system knows to do that. For example: if your field, mhnk-ausdt, has 30th dec 2006 in it, after adding 2 the result will be 1st jan 2007.&lt;/P&gt;&lt;P&gt;The system will calculate 20061230 + 2 and the result is 20070101.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this covers it...&lt;/P&gt;&lt;P&gt;Igal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Pls reward if it helps)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2006 19:10:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/1613149#M274793</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-14T19:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: scripts</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/1613150#M274794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;/: DEFINE &amp;amp;V_DATE&amp;amp; &lt;/P&gt;&lt;P&gt;/: PERFORM GET_DATE IN PROGRAM ZPROG&lt;/P&gt;&lt;P&gt;/: USING &amp;amp;MHNK-AUSDT&amp;amp;&lt;/P&gt;&lt;P&gt;/: CHANGING &amp;amp;V_DATE&amp;amp;&lt;/P&gt;&lt;P&gt;/: ENDPERFORM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coding of the calling ABAP program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZPROG.&lt;/P&gt;&lt;P&gt;FORM GET_DATE TABLES IN_PAR STUCTURE ITCSY&lt;/P&gt;&lt;P&gt;                     OUT_PAR STRUCTURE ITCSY.&lt;/P&gt;&lt;P&gt;data: l_date like sy-datum.&lt;/P&gt;&lt;P&gt;*-- if the date is in MM/DD/YYYY format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE IN_PAR WITH KEY &amp;#145;MHNK-AUSDT&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;l_date&lt;EM&gt;0(4) = IN_PAR-VALUE&lt;/EM&gt;6(4).&lt;/P&gt;&lt;P&gt;l_date&lt;EM&gt;4(2) = IN_PAR-VALUE&lt;/EM&gt;0(2).&lt;/P&gt;&lt;P&gt;l_date&lt;EM&gt;6(2) = IN_PAR-VALUE&lt;/EM&gt;3(2).&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;l_date = l_date + 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE OUT_PAR WITH KEY &amp;#145;V_DATE&amp;#146;.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;  write l_date to OUT_PAR-VALUE.&lt;/P&gt;&lt;P&gt;  MODIFY OUT_PAR INDEX SY-TABIX.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2006 19:10:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/scripts/m-p/1613150#M274794</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-14T19:10:20Z</dc:date>
    </item>
  </channel>
</rss>

