01-09-2015 1:07 PM
Hi,
I have given two parameters in the program " otype type hrp001 and date1 type dats".
I am using select option like this " SELECT * FROM HRP1000 INTO table itab where otype in otype and BEGDA < DATE1 AND ENDDA >= DATE1."
by using this i am not getting any records in the output.by removing the "date1" relation i am able to fetch all the records. So please help me to fix this issue.
01-09-2015 1:32 PM
Hi Vishnu,
Kindly check in SE16N whether the record is available in database.
Try the below code.
SELECT * FROM HRP1000 INTO table itab
where otype in otype and BEGDA <= DATE1 AND ENDDA >= DATE1
Regards
Rajkumar Narasimman
01-09-2015 1:32 PM
Hi Vishnu,
Kindly check in SE16N whether the record is available in database.
Try the below code.
SELECT * FROM HRP1000 INTO table itab
where otype in otype and BEGDA <= DATE1 AND ENDDA >= DATE1
Regards
Rajkumar Narasimman
01-09-2015 1:40 PM
If we use the if condition i am able to get the required output.
IF date1 IS NOT INITIAL.
SELECT * FROM hrp1000 INTO TABLE itab WHERE otype IN otype AND begda <= date1 AND endda >= date1.
ELSE .
SELECT * FROM hrp1000 INTO TABLE itab WHERE otype IN otype.
ENDIF.
Is their any way to fetch record without using the if condition.
01-09-2015 1:47 PM
Hi Vishnu,
Use the following statement before select statement, assign the current date value as shown below.
date1 = sy-datum.
Regards
Rajkumar Narasimman
01-09-2015 1:55 PM
This stems from the fact that the initial value of a date field is 00000000, so comparing this against the date values in HRP1000 will never find a match (00000000 being less than 01011900, the usual start date for unlimited HR records).
Your IF statement is a fine solution.
Regards,
Nick