cancel
Showing results for 
Search instead for 
Did you mean: 

Date comparision

Former Member
0 Kudos

Hi All,

I want to comparision two dates..

I have Invoice Date and LR date..i want that LR Date must not be less than Invoice Date...what should be condition for it..

Ex:-

Invoice Date - 15.04.2008 ......LR Date 20.04.2008 - Correct

Invoice Date - 15.04.2008 ......LR Date 10.04.2008 - Wrong (should not taken).

Plz tell me coding part..

Thanks..

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member217544
Active Contributor
0 Kudos

You can use the Function module

FIMA_DAYS_AND_MONTHS_AND_YEARS- This function module will give the difference of dates in days, months and years.

Pass 'Invoice date' to I_DATE_FROM parameter

and 'LR Date' to I_DATE_TO paramater of the function module.

Output will be as foolows:

If the LR date is greater than Invoice date

E_DAYS will be greater than 0.

So you can continue the logic by checking this condition.

( If E_DAYS > 0.)

Reward if useful.

Thanks & regards,

Swarna Munukoti

Former Member
0 Kudos

You can use the operations LT,GT, LE,GE but both LR and Invoice dates should be of type Date and both are of same format

Former Member
0 Kudos

use function module for calculate difference between two dates by DAYETWEEN_TWO_DATES..within this you just pass invoice date and LR date and get the result into some parameter like p_date.

write condition like:

p_date = invoice date - LR date.

if p_date LE 0.

error message.

endif.

try this...it may helps you.

Former Member
0 Kudos

Hi,

do this way ...


if v_inv_dat ge v_lr_dat.
<<< do something >>>
endif.

Former Member
0 Kudos

Hi,

You can use normat LE and GE operators itself.

IF w_date GE w_invoicedate.

write 'Correct date'.

Else.

Write 'Incorrect date'.

ENDIF.

Thanks and Regards,

Lakshmi.