12-10-2008 6:55 AM
Hi all,
In selection screen i'm passing month nad year field.
if it 03 2008 means. it should fetch the values of mkpf from 01.03.2008 to 31.03.2008.
how to do this
Regards
Suprith
12-10-2008 6:59 AM
HI,
You are getting the month and year from the selection screen like 03.2008
in the program split the month and year
ranges r_date for sy-datum.
p_month = p_date(2).
p_year = p+3(4).
To build the dates
From date
CONCATENATE p_year p_month(2) '01' INTO g_begda.
To Date
CALL FUNCTION 'LAST_DAY_OF_MONTHS' "#EC
EXPORTING
day_in = g_begda
IMPORTING
last_day_of_month = g_endda
EXCEPTIONS
day_in_no_date = 1
OTHERS = 2.
r_date-sign = 'I'.
r_date-option = 'BT'.
r_date-low = g_begda .
r_date-high = g_endda .
append r_date.
then use the r_date in mkpf data selection
Edited by: avinash kodarapu on Dec 10, 2008 12:29 PM
12-10-2008 6:59 AM
Based on value of month you can create 2 variable l_start and l_end where l_start is the first day of the month and l_end is the last day. This last day can be calculated by using function RP_LAST_DAY_OF_MONTHS .
With these values you can read the MKPF table.
regards,
hans
12-10-2008 6:59 AM
Hi
in the selection screen you can give the date field as S_DATE and then you can directly provide the input valuse in S_Date-low and S_date-high.
Neha
12-10-2008 6:59 AM
HI,
You are getting the month and year from the selection screen like 03.2008
in the program split the month and year
ranges r_date for sy-datum.
p_month = p_date(2).
p_year = p+3(4).
To build the dates
From date
CONCATENATE p_year p_month(2) '01' INTO g_begda.
To Date
CALL FUNCTION 'LAST_DAY_OF_MONTHS' "#EC
EXPORTING
day_in = g_begda
IMPORTING
last_day_of_month = g_endda
EXCEPTIONS
day_in_no_date = 1
OTHERS = 2.
r_date-sign = 'I'.
r_date-option = 'BT'.
r_date-low = g_begda .
r_date-high = g_endda .
append r_date.
then use the r_date in mkpf data selection
Edited by: avinash kodarapu on Dec 10, 2008 12:29 PM