Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem in FM ( DAYS_BETWEEN_TWO_DATES )

Former Member
0 Likes
787

Hi all,

I write a code like below but i still get runtime error. so please help me out



 CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
        EXPORTING
          i_datum_bis = S_BUDAT-low
          i_datum_von = S_BUDAT-high
        IMPORTING
          e_tage      = date.

          if t_out-erfmg6 GT '0.00'.
            t_out-erfmg4 = t_out-erfmg6 / date.
          ENDIF.

          if t_out-erfmg2 GT '0.00'.
            t_out-erfmg5 = t_out-erfmg2 / t_out-erfmg4.
          ENDIF.

And my input date is 01.01.2008 to 05.01.2008

"but the error getting like you divide value with 0 "

so please help me out how can i pass the parrameter in this function module

Thanks in Advance

Keyur

Edited by: keyur chauhan on Jul 21, 2010 11:49 AM

Edited by: keyur chauhan on Jul 21, 2010 1:37 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
596

Hi,

if t_out-erfmg2 GT '0.00'.

t_out-erfmg5 = t_out-erfmg2 / t_out-erfmg4.

ENDIF.

In above statement check the value of 't_out-erfmg4' in debug mode, may it's holding value 'zero(0)' and it's try to deviding with zero(0).

So it going to dump.

Thanks,

Amjad.

Hi all,

I write a code like below but i still get runtime error. so please help me out



 CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
        EXPORTING
          i_datum_bis = S_BUDAT-low
          i_datum_von = S_BUDAT-high
        IMPORTING
          e_tage      = date.

          if t_out-erfmg6 GT '0.00'.
            t_out-erfmg4 = t_out-erfmg6 / date.
          ENDIF.

          if t_out-erfmg2 GT '0.00'.
            t_out-erfmg5 = t_out-erfmg2 / t_out-erfmg4.
          ENDIF.

And my input date is 01.01.2008 to 05.01.2008

"but the error getting like you divide value with 0 "

so please help me out how can i pass the parrameter in this function module

Thanks in Advance

Keyur

Edited by: keyur chauhan on Jul 21, 2010 11:49 AM

Edited by: keyur chauhan on Jul 21, 2010 1:37 PM

2 REPLIES 2
Read only

Former Member
0 Likes
597

Hi,

if t_out-erfmg2 GT '0.00'.

t_out-erfmg5 = t_out-erfmg2 / t_out-erfmg4.

ENDIF.

In above statement check the value of 't_out-erfmg4' in debug mode, may it's holding value 'zero(0)' and it's try to deviding with zero(0).

So it going to dump.

Thanks,

Amjad.

Read only

0 Likes
596

hi

thanks for your reply

now i get result but i put any date in my date filed this FM get 9 days default

if i get one day or if i get 1 years in both input it's take 9 days

so how can i get proper out put .

Please help me out

And again thanks for your reply