‎2007 Oct 22 7:34 AM
hi friends,
i am working on loom weekly report, i have a select option for date.
now since it is weekly report i have to check whether the dates entered are proper,i mean if the difference between them is 7 days then its fine,else i have to give an error.
my problem is during month end,is there any function module which will return me the number of days between the dates entered.
pls ask for clarification if u have not understood my problem
‎2007 Oct 22 7:39 AM
‎2007 Oct 22 7:38 AM
I think no need to go for FM
just check first date and add7 in that SAP will do automatically and give date after 7 th day and check that date if not for second date by user then give error message
FUNCTION MODULES
http://www.erpgenie.com/abap/functions.htm
http://www.sapdevelopment.co.uk/fmodules/fmssap.htm
http://www.erpgenie.com/abap/index.htm
http://www.geocities.com/victorav15/sapr3/abapfun.html
Rewards if useful............
Minal Nampalliwar
‎2007 Oct 22 7:39 AM
‎2007 Oct 22 7:39 AM
use SD_DATETIME_DIFFERENCE to get the date diff...
the input to this FM are as follows...
DATE1 10.02.2007
TIME1 00:00:01
DATE2 01.03.2007
TIME2 23:59:59
output for this is
DATEDIFF 19
TIMEDIFF 24
EARLIEST 1
‎2007 Oct 22 7:39 AM
DATA : CHECK_DAYS type I.
AT SELECTION SCREEN OUTPUT.
Clear CHECK_DAYS.
CHECK_DAYS = P_DATE2 -P_DATE1.
IF CHECK_DAYS NE ' 7'.
Error.
ENDIF.
‎2007 Oct 22 7:45 AM
hi amit,
check out the number of days by:
no_of_days = s_date1 - s_date2.
if no_of_days <> 7.
write : ERROR.
endif.
regards,
sohi
‎2007 Oct 22 7:52 AM
Hi ,
Use Function module " HR_HK_DIFF_BT_2_DATES " and give output format
is ' 02 ' as a import parameters.
Regards,
Prashant