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

a month selection

Former Member
0 Likes
1,346

hello everyone,

i need to make a selection of a number of a mounth ( Mounth 6 or 7 or 8 ) but the problem is that in the database table (bkpf) we have an entire date (DD/MM/YYYY) , how to do to make a select and the parameter of month selection is the number of the mounth.

thank you.

12 REPLIES 12
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,290

hi,

there are two ways to go:

1. convert the month to dates (I hope you have year as well), you can use FMs FIRST_DAY_IN_PERIOD_GET and LAST_DAY_IN_PERIOD_GET.

2. use field MONAT (which stands for month) form table BKPF

hope this helps

ec

Read only

Former Member
0 Likes
1,290

IN PARAMETERS TAKE 2 CHAR..

THEN WHILE VALIDATING TAKE ENTIRE DATE

THEN USE LIKE THIS TO GET MONTH

DATE3(2)

Read only

prasanth_kasturi
Active Contributor
0 Likes
1,290

hi,

bring the date from database and use the OFFSET to get the month

month = date+4(2).

and you have the number of the month

regards

prasanth

Read only

Former Member
0 Likes
1,290

Hi,

Try this way

Parameters:p_month(2) type c.

Data:w_date type sy-datum.

Concatenate '%' p_month '%' into w_date.

Select * from BKPF into table itab where date like w_date.

Regards,

Sujit

Read only

Former Member
0 Likes
1,290

for each month selected put de first date of the month and the last day of the month in a range with BETWEEN. Use the range in the where clause of the select.

Best Regards

Guido

Edited by: G. Bouman on Sep 12, 2008 11:12 AM

Read only

Former Member
0 Likes
1,290

Hi,

Just select all by other criteria as "fetch".

LOOP AT itab.

IF itab-date+4(2) NE parameter_date.

DELETE itab.

ENDIF.

ENDLOOP.

Regards,

Alin.

Read only

Former Member
0 Likes
1,290

Hi,

we ca use the offset concept to find the month and store in some other variable.

example:

date is dd/mm/yyyy.

then var1 = date+0(3).

this will give month.

thanx.

Read only

Former Member
0 Likes
1,290

ok

Read only

0 Likes
1,290

what is ok after two months?

Read only

Former Member
0 Likes
1,290

no answer.

i've received no response

Read only

0 Likes
1,290

>

> no answer.

> i've received no response

I think this is the joke of the year... you got eigth answers...

Read only

0 Likes
1,290

Actually he meant :

i've received no(Nine in hindi) response

I think this is the joke for the seconds... he got no(Nine) answers now(including mine)...;-)

Cheers