‎2008 Dec 10 5:09 AM
Hi All,
I'm working on consumption report. User needs month-wise consumption.
table MKPF contains data date wise.(eg- 01.03.08 ......)
i should pass only month (eg.. 03) then it should pick the values from (01.03.08 to 31.03.08).
how to validate this one.
Regards
Suprith
‎2008 Dec 10 5:11 AM
Hi,
Use this.
data: date(10) type c value '01.03.1982',
month_value type i.
IF month_value = date3(2).
..write code here.
ENDIF
‎2008 Dec 10 5:11 AM
Hi,
Use this.
data: date(10) type c value '01.03.1982',
month_value type i.
IF month_value = date3(2).
..write code here.
ENDIF
‎2008 Dec 10 5:13 AM
HI,
Check this code..
To validate the Month..
IF NOT p_month IS INITIAL.
IF NOT ( p_month(2) BETWEEN '01' AND '12' ).
MESSAGE e016(pn) WITH 'Enter Valid Month'(e06).
ENDIF.
ENDIF.
To build the dates
From date
CONCATENATE sy-datum(4) 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.
‎2008 Dec 10 5:13 AM
‎2008 Dec 10 5:18 AM
Hi suprith,
Just try with this it may help u.
you use date4(2) for month, and date6(2) for dayfor day.
Regards,
vasavi.v
‎2008 Dec 10 5:20 AM
In Selection screen user will be entering only month
Eg- 03.
how to capture this n pass into MKPF-budat
‎2008 Dec 10 5:20 AM
‎2008 Dec 10 5:23 AM
Hi,
You can use the 'LIKE' statement in the where clause of the select statement.
1. Get the current year.
2. Concatenate current year and month ( input ) - YYYYMM.
3. Use select statement like this:
SELECT * FROM MKPF .....
.......
WHERE BUDAT LIKE 'YYYYMM_ _'.
Regards,
Vadivelan B
Edited by: Vadivelan B on Dec 10, 2008 6:24 AM