07-01-2008 12:44 PM
hai all,
i have to genrate a report in which i have to display the month with three character from the date given in select-options and in other report i have to display the week form the selected date.how can i do this.
pls reply as soon as possible.
with regards
sridhar.
07-01-2008 1:12 PM
Hi,
try this:
tables: T247.
DATA: WEEK LIKE SCAL-WEEK.
*
select single * from T247 where spras = sy-langu
and mnr = sy-datum+4(2).
*
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = sy-datum
IMPORTING
WEEK = WEEK.
*
write: / t247-mnr, t247-ktx, t247-ltx, week(4), week+4(2).
*
Regards, Dieter
07-01-2008 12:46 PM
hi ,
take any fields ref to data element SPMON.
ex.
s_spmon for MCS1-spmon.
regards
prabhu
07-01-2008 12:47 PM
hi,
Use the function module 'MONTH_NAMES_GET' to get the month names.
Regards,
Jaya Vani
07-01-2008 12:50 PM
Hi,
Chk
Data element SPMON period to analyse on month
Data elemetn SPWOC period to analyse on week.
Regards.
07-01-2008 12:52 PM
HI,
data: A type sy-datum value '20080630',
c(8).
c = a+4(2).
write:/ a, c.
Week i am not sure.. but you can capture month like this
match the value with table T247 field MNR... YOu will get the three digit month name,
Regards
VIjay
Edited by: Vijay on Jul 1, 2008 1:52 PM
Edited by: Vijay on Jul 1, 2008 1:54 PM
07-01-2008 12:56 PM
hi,
you have date in select-option.
so you will be having month no.
using MONTH_NAMES_GET function module you can get three char for that month and for week wat exactly you want to show??week no??
DATE_GET_WEEK is a function module to find the week no..
07-01-2008 1:12 PM
Hi,
try this:
tables: T247.
DATA: WEEK LIKE SCAL-WEEK.
*
select single * from T247 where spras = sy-langu
and mnr = sy-datum+4(2).
*
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = sy-datum
IMPORTING
WEEK = WEEK.
*
write: / t247-mnr, t247-ktx, t247-ltx, week(4), week+4(2).
*
Regards, Dieter
07-01-2008 2:04 PM
Hi
Ur problem is solved.
please check it.
REPORT z_interactive_alv.
data : v_date TYPE sy-datum,
l_week TYPE KWEEK,
i_month TYPE STANDARD TABLE OF T247 INITIAL SIZE 0,
wa_month TYPE T247,
l_mon TYPE FCKTX.
v_date = '20080701'.
APPEND wa_month to i_month.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
TABLES
month_names = i_month
EXCEPTIONS
MONTH_NAMES_NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc = 0.
read TABLE i_month INTO wa_month with key MNR = v_date+4(2).
IF sy-subrc = 0.
l_mon = wa_month-KTX.
ENDIF.
ENDIF.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
date = v_date
IMPORTING
WEEK = l_week
EXCEPTIONS
DATE_INVALID = 1
OTHERS = 2
.
WRITE : / 'Month = ', l_mon .
WRITE: / 'Week = ' , l_week+4(2).
07-02-2008 6:06 AM