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

month display

Former Member
0 Likes
940

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
918

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

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

6 REPLIES 6
Read only

Former Member
0 Likes
918

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

Read only

0 Likes
918

Hi Shekhar,

I want to display with month like "jan 2005 to may 2005"

kaki

Read only

Former Member
0 Likes
918

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.

Read only

Former Member
0 Likes
918

use FM MONTH_NAMES_GET

u con concatenate with the year

Read only

Former Member
0 Likes
919

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

Read only

0 Likes
918

Thanks for all replies..

Points allowted

cheers

kaki