‎2008 Apr 29 5:28 AM
I wish to restrict my user on selection screen.
As soon as user enters the date range it should validate that date range should not be greater than one month.
select-options : mbadat for eban-badat.
At SELECTION-SCREEN.
if mbadat is not INITIAL.
perform check_month.
endif.
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
DATE1 = mbadat-high
DATE2 = mbadat-low
OUTPUT_FORMAT = '05'
IMPORTING
YEARS =
MONTHS = v_months
DAYS = v_days
EXCEPTIONS
INVALID_DATES_SPECIFIED = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF v_days > 31.
MESSAGE 'Date Range should be less than 1 Month' TYPE 'E'.
ENDIF.
Gives a DUMP messg
Function parameter "DAYS" is unknown.
What happened?
Error in ABAP application program.
The current ABAP program "ZSPURREQ" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
Function module "HR_HK_DIFF_BT_2_DATES" was called
with the parameter "DAYS".
This parameter is not defined.
‎2008 Apr 29 5:33 AM
Hi,
Please remove the comment before "importing"...it will work,
Because of the comment it is not recognising "days" as a parameter...
Pls check and revert
Regards
Byju
‎2008 Apr 29 5:33 AM
Hi,
Please remove the comment before "importing"...it will work,
Because of the comment it is not recognising "days" as a parameter...
Pls check and revert
Regards
Byju