2008 May 19 8:45 AM
HI
I HAVE TO DISPLAY FOR ALL EMPLOYEE NAMES whose birth date is TODAY'S DATE AND MONTH.
since birth day comes once in a year, i need to use only day and month in the select querry, but on date field offset indicator does not work.
my coding.
PARAMETER ZDOB LIKE SY-DATUM.
SELECT EMPNAME FROM ZTAB INTO TABLE ZXTAB WHERE DOB6(0) EQ ZDOB6(0).
BUT WITH HIS SELECT QUERRY OFFSET INDICATOR DOES NOT WORK BECAUSE DOB IS A DATE FIELD.
HOW TO SOLVE THIS PROBLEM.
THANX
ROCKY
HI
I HAVE TO DISPLAY FOR ALL EMPLOYEE NAMES whose birth date is TODAY'S DATE AND MONTH.
since birth day comes once in a year, i need to use only day and month in the select querry, but on date field offset indicator does not work.
my coding.
PARAMETER ZDOB LIKE SY-DATUM.
SELECT EMPNAME FROM ZTAB INTO TABLE ZXTAB WHERE DOB6(0) EQ ZDOB6(0).
BUT WITH HIS SELECT QUERRY OFFSET INDICATOR DOES NOT WORK BECAUSE DOB IS A DATE FIELD.
HOW TO SOLVE THIS PROBLEM.
THANX
ROCKY
2008 May 19 8:52 AM
hi
offset works with date field ,
i think u r select query has problem
write it like as
SELECT EMPNAME FROM ZTAB INTO TABLE ZXTAB WHERE DOB5(4) EQ ZDOB5(4).
BUT WITH HIS SELECT QUERRY OFFSET INDICATOR DOES NOT WORK BECAUSE DOB IS A DATE FIELD.
reward if helpful.
2008 May 19 8:55 AM
hi check this...
PARAMETER: ZDOB LIKE SY-DATUM.
SELECT EMPNAME
FROM ZTAB
INTO TABLE ZXTAB
WHERE dob = sy-datum .
this is enough bcoz the date consists the date month and year ..no need to give the offset vqalues..
regards,
venkat .
2008 May 19 9:04 AM
U cannot use offset in where condition of a select ..
Get all the employees ... and then filter data ..
or get dates (current day and month and ) along with years
into a range and write a select ..
r_date-sign = 'I'
r_date-option = 'EQ'.
r_date-low = sy-datum.
append r_date.
r_date-low0(4) = sy-datum0(4) - 1.
append r_date.
r_date-low0(4) = sy-datum0(4) - 2.
append r_date.
2008 May 19 9:29 AM
Hi Plese find the code...
REPORT zabc12.
TABLES mseg.
select-options r_date for sy-datum.
r_date-sign = 'I'.
R_DATE-OPTION = 'EQ'.
r_date-low = sy-datum.
APPEND r_date.
r_date-low0(4) = sy-datum0(4) - 1.
APPEND r_date.
r_date-low0(4) = sy-datum0(4) - 2.
APPEND r_date.
SELECT EMPNAME
FROM ZTAB
INTO TABLE ztab
WHERE dob IN r_date.