‎2008 Jun 30 1:46 PM
Dear all,
I have a necessiy that I want to search the pa0002 table for records corresponding to present day and current month to obtain birthday of people.
The gbmon and gbtag fields of pa0002 are the month and day of birth of the people.
So we can find the no. of people who were born on that day.
But I am facing a problem as I am not able to get any values in the internal table under consideration.
Please do help me as soon as possible.
Thanks and Regards,
Soumyadeep.
‎2008 Jun 30 2:25 PM
Hello Ghosh,
Please try the following code
TABLES : pa0002.
data: it_bbuddies like standard table of p0002 with header line.
data: date type sy-datum,
date1(2) type n,
date2(2) type n.
date = sy-datum.
date1 = date+4(2).
date2 = date+6(2).
SELECT vorna FROM pa0002 INTO CORRESPONDING FIELDS OF table it_bbuddies
WHERE gbmon = date1 AND gbtag = date2.
LOOP AT it_bbuddies.
write:/ it_bbuddies-vorna.
ENDLOOP.When u see in the debug mode i observed tht gbmon and gbtag are becoming zeros. But check it in the table entries. The entries are correct.
Hope it helps you
Regards
Indu.
Edited by: Indu Rayepudi on Jun 30, 2008 3:30 PM
‎2008 Jun 30 1:48 PM
why r u not able to get the values in internal table. Maybe ur coding error...
check out once.
‎2008 Jun 30 1:51 PM
hi,
what is ur problem.
if u give day and month details u will get details from that table so based on that write simple select statement.
‎2008 Jun 30 1:55 PM
TABLES : pa0002.
IF mode = 'DIS'.
date = sy-datum.
date1 = date+4(2).
date2 = date+6(2).
date3 = date+5(1).
LOOP AT it_bbuddies.
SELECT SINGLE vorna FROM pa0002 INTO CORRESPONDING FIELDS OF it_bbuddies WHERE gbmon = date1 AND gbtag = date2.
APPEND it_bbuddies.
ENDLOOP.
This is the code Im using . Please do let me know what is the problem with this code.
ENDIF.
‎2008 Jun 30 1:56 PM
GBJHR Year
GBMON Month
GBTAG Day
Are the fields from the table PA0002
take the values into internal table.
Now u can do anything with this field like
finding the no. of ppl having Bday on month of 10 (ie oct)
with where GBMON = '10'
or day nd month
where GBMON = '10'
and GBTAG = '26'.
U can do anything
Thanks & Regards
vinsee
‎2008 Jun 30 1:59 PM
I know what ur saying Vinsee. But my requirement is that I have to select people whose birthday is on the current day.
n the code which i attached is not working.
‎2008 Jun 30 1:58 PM
select query is wrong..
into corressponding fields of table itab.
‎2008 Jun 30 2:25 PM
Hello Ghosh,
Please try the following code
TABLES : pa0002.
data: it_bbuddies like standard table of p0002 with header line.
data: date type sy-datum,
date1(2) type n,
date2(2) type n.
date = sy-datum.
date1 = date+4(2).
date2 = date+6(2).
SELECT vorna FROM pa0002 INTO CORRESPONDING FIELDS OF table it_bbuddies
WHERE gbmon = date1 AND gbtag = date2.
LOOP AT it_bbuddies.
write:/ it_bbuddies-vorna.
ENDLOOP.When u see in the debug mode i observed tht gbmon and gbtag are becoming zeros. But check it in the table entries. The entries are correct.
Hope it helps you
Regards
Indu.
Edited by: Indu Rayepudi on Jun 30, 2008 3:30 PM
‎2008 Jul 01 6:39 AM
Thanks a lot Indu,
it helped.
i will stay in touch with u in future for any abap related issues. Hope u dont mind.