2008 May 02 6:29 AM
Dear all,
I want a FM for comparing a date with today's date
that is if the date passed to the FM is less than sy-datum, i want to throw a warning message.
Can any one suggest
Dear all,
I want a FM for comparing a date with today's date
that is if the date passed to the FM is less than sy-datum, i want to throw a warning message.
Can any one suggest
2008 May 02 6:30 AM
you do a direct condition no need to any fm
if date GR sy-datum.
error message....
endif.
else check this FM
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
date1 = wa_citm_b-venddat
date2 = wa_citm_b-vbegdat
output_format = '04'
IMPORTING
months = lv_period
EXCEPTIONS
invalid_dates_specified = 1
OTHERS = 2.
2008 May 02 6:35 AM
Hi Rahul,
We will use FMs only if putting ur own logic is complex because somany things will happens in back end when u call a FM like it has to load whole function group to application server for first time execution in a session. So in this case do a direct comparision instead of FM.
IF w_date GT sy-datum..
MESSAGE w000 WITH 'Date must be less than or equal to current date.'
ENDIF.
Thanks,
Vinod.
2008 May 02 6:36 AM
why you want to use function module..use can if condition..
if urdate < sy-datum.
'Warning message'.
endif.
Regards
Sugumar G