<?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: Problem in function module. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/4391177#M1044161</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sakti,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please replace ur FM with below FM. It will work perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: EDAYS   LIKE VTBBEWE-ATAGE,
      EMONTHS LIKE VTBBEWE-ATAGE,
      EYEARS  LIKE VTBBEWE-ATAGE.

PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
            TODATE   LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.

call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
  exporting
    i_date_from          = FROMDATE
    i_date_to            = TODATE
*   I_FLG_SEPARATE       = ' '
  IMPORTING
    E_DAYS               = EDAYS
    E_MONTHS             = EMONTHS
    E_YEARS              = EYEARS.


WRITE:/ 'Difference in Days   ', EDAYS.
WRITE:/ 'Difference in Months ', EMONTHS.
WRITE:/ 'Difference in Years  ', EYEARS.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anversha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 24 Aug 2008 09:10:10 GMT</pubDate>
    <dc:creator>anversha_s</dc:creator>
    <dc:date>2008-08-24T09:10:10Z</dc:date>
    <item>
      <title>Problem in function module.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/4391176#M1044160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used this function module "C14B_DIFF_BT_2_DATES"  to find out the difference between the two dates.&lt;/P&gt;&lt;P&gt;I have declared two local variables as like in the function module for those two dates and fetched the no of the months in between those dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here comes the problem while I am checking in function module individually in se37 its working fine. But while using this function module in my  report the no. of months which is returning is not correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have declared same as like that of in the function module but the values are not correct.Where is the actual error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sakthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Aug 2008 08:59:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/4391176#M1044160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-24T08:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in function module.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/4391177#M1044161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sakti,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please replace ur FM with below FM. It will work perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: EDAYS   LIKE VTBBEWE-ATAGE,
      EMONTHS LIKE VTBBEWE-ATAGE,
      EYEARS  LIKE VTBBEWE-ATAGE.

PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
            TODATE   LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.

call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
  exporting
    i_date_from          = FROMDATE
    i_date_to            = TODATE
*   I_FLG_SEPARATE       = ' '
  IMPORTING
    E_DAYS               = EDAYS
    E_MONTHS             = EMONTHS
    E_YEARS              = EYEARS.


WRITE:/ 'Difference in Days   ', EDAYS.
WRITE:/ 'Difference in Months ', EMONTHS.
WRITE:/ 'Difference in Years  ', EYEARS.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anversha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Aug 2008 09:10:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/4391177#M1044161</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2008-08-24T09:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in function module.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/4391178#M1044162</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 this Snippet&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA :
  w_d TYPE sy-datum,
  w_d2 TYPE sy-datum,
  w_days TYPE i,
  w_months TYPE i,
  w_years TYPE i.

w_d = '20080810'.
w_d2  = sy-datum .

CALL FUNCTION 'C14B_DIFF_BT_2_DATES'
  EXPORTING
    i_date_from               = w_d
    i_date_to                 = w_d2
  IMPORTING
    e_days                    = w_days
    e_months                  = w_months
    e_years                   = w_years
  EXCEPTIONS
    plausibility_check_failed = 1.

WRITE /:
  w_days,
  w_months,
  w_years.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;output is 14&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Aug 2008 09:11:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/4391178#M1044162</guid>
      <dc:creator>bpawanchand</dc:creator>
      <dc:date>2008-08-24T09:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in function module.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/4391179#M1044163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it is working fine, error lies in your code.&lt;/P&gt;&lt;P&gt;add 1 day extra to the i_date_to and see ..&lt;/P&gt;&lt;P&gt;check this code..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ZTEST_DATE_DIIF.

data: i_date_from type sy-datum,
      i_date_to type sy-datum.
data: e_days type i,
      e_months type i,
      e_years type i.

 i_date_to = '20090101'.
 i_date_from = '20080101'.


CALL FUNCTION 'C14B_DIFF_BT_2_DATES'
  EXPORTING
    i_date_from                     = i_date_from
    i_date_to                       = i_date_to
 IMPORTING
   E_DAYS                          = E_DAYS
   E_MONTHS                        = E_MONTHS
   E_YEARS                         = E_YEARS
 EXCEPTIONS
   PLAUSIBILITY_CHECK_FAILED       = 1
          .
write:/ e_days, e_months, e_years.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Aug 2008 09:12:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/4391179#M1044163</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-24T09:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in function module.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/4391180#M1044164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem Solved.&lt;/P&gt;&lt;P&gt;Thanks for all your answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you received your valuable points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sakthi&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Aug 2008 09:20:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/4391180#M1044164</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-24T09:20:29Z</dc:date>
    </item>
  </channel>
</rss>

