2005 Dec 09 3:01 AM
Hi,
I am entering the date in the select-options.
But in the report i want to display only Month & year of the particular entry in the select-options.
Can any one tell me how to display that?
I dont want to hard code for every month.Is there any SAP standard variables?
Points guaranteed
cheers
kaki
Message was edited by: Kaki R
2005 Dec 09 3:31 AM
tables : t247.
data:it_t247 type standard table of t247 with header line.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
IMPORTING
RETURN_CODE =
TABLES
month_names = it_t247
EXCEPTIONS
MONTH_NAMES_NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
read table it_t247 with key mnr = v_month.
v_mon_desc = it_t247-ktx.
concatenate v_mon_desc v_year
tables : t247.
data:it_t247 type standard table of t247 with header line.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
IMPORTING
RETURN_CODE =
TABLES
month_names = it_t247
EXCEPTIONS
MONTH_NAMES_NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
read table it_t247 with key mnr = v_month.
v_mon_desc = it_t247-ktx.
concatenate v_mon_desc v_year
2005 Dec 09 3:07 AM
select-options : s_date like sy-datum
system store it as yyyymmdd
v_month = s_date-low + 4(2).
v_year = s_date-low + 0(4).
Message was edited by: chandrasekhar jagarlamudi
2005 Dec 09 3:09 AM
Hi Shekhar,
I want to display with month like "jan 2005 to may 2005"
kaki
2005 Dec 09 3:14 AM
Hi ,
Use function
CACS_DATE_GET_YEAR_MONTH
this gives you month and year.
Then write a case statement as
Case Emonth.
When 01.
V_month = 'JAN'.
..... so on..
Endcase.
2005 Dec 09 3:19 AM
2005 Dec 09 3:31 AM
tables : t247.
data:it_t247 type standard table of t247 with header line.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
IMPORTING
RETURN_CODE =
TABLES
month_names = it_t247
EXCEPTIONS
MONTH_NAMES_NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
read table it_t247 with key mnr = v_month.
v_mon_desc = it_t247-ktx.
concatenate v_mon_desc v_year
2005 Dec 09 3:39 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |