Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

hi abap

Former Member
0 Likes
635

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

4 REPLIES 4
Read only

Former Member
0 Likes
613

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.

Read only

Former Member
0 Likes
613

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 .

Read only

Former Member
0 Likes
613

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.

Read only

Former Member
0 Likes
613

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.