09-18-2014 7:10 AM
Hello expert,
I've tried provide statement and macro both work fine. Now i want to do a select statement using bedga and endda entered on screen.
"getting all employee personal number & normal hours employee only
SELECT pernr
FROM pa0007
INTO TABLE gt_007
WHERE begda <= p_begda AND endda > p_endda.
Is this the right way? Because here we are dealing with with period interval not just comparing date, please let me know if this is correct
09-18-2014 9:41 AM
Almost correct. You need to eliminate all infotypes starting beyond the selection screen date range or ending before the selection screen date range.
SELECT pernr
FROM pa0007
INTO TABLE gt_007
where begda le p_endda "infotype starts before screen end date
and endda ge p_begda. "and ends after screen start date
09-18-2014 9:41 AM
Almost correct. You need to eliminate all infotypes starting beyond the selection screen date range or ending before the selection screen date range.
SELECT pernr
FROM pa0007
INTO TABLE gt_007
where begda le p_endda "infotype starts before screen end date
and endda ge p_begda. "and ends after screen start date
09-18-2014 10:09 AM
Hi,
The matter to look into is just the START DATE i.e BEGDA. ENDDA of screen parameter is of no importance because for few infotypes like 0015, BEGDA and ENDDA are same.
So,
Use query like this :
SELECT PERNR
INTO TABLE GT_007
FROM PA0007
WHERE BEGDA LE P_BEGDA
AND ENDDA GE P_BEGDA.
This where statement will fetch correct data for all infotypes.