06-27-2008 6:31 AM
hi
my req.ment is if i enter the date i have to diplay the three future months
example : input 25/06/2008
my output should be july
August
September
so is there any fm, or sample program. which is rewardful.
thx
sat
06-27-2008 6:38 AM
Hi,
You can use MONTH_NAMES_GET.
You may need some coding to get the long text for the month names.
Regards,
Subramanian
06-27-2008 6:38 AM
06-27-2008 6:40 AM
Check the sample code..
REPORT z_sdn.
data: text type T247-LTX.
PARAMETERS p_date type sy-datum.
do 3 times.
p_date+4(2) = p_date+4(2) + 1.
CALL FUNCTION 'ISP_GET_MONTH_NAME'
EXPORTING
DATE = p_date
language = sy-langu
IMPORTING
LONGTEXT = TEXT
EXCEPTIONS
CALENDAR_ID = 1
DATE_ERROR = 2
NOT_FOUND = 3
WRONG_INPUT = 4
.
write text.
enddo.
06-27-2008 6:40 AM
hi,
using FM MONTH_NAMES_GET you will get month names and corresponding numbers. you can build the logic to get next three months.
Reward if find useful
06-27-2008 6:41 AM
hi,
pick the month value by using offset.
month = date+3(2).
This will give you the month. Pass that value in a select statement and print the necessary output. PLz Take necessary care for Nov And Dec.
Reward if Helpful.
Sumit Agarwal
06-27-2008 6:54 AM
data: itab like t247 occurs 0 with header line.
parameters: date like sy-datum.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
* IMPORTING
* RETURN_CODE =
TABLES
month_names = itab
* 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.
loop at itab.
if date+4(2) = itab-mnr.
write:/ itab-ltx.
endif.
endloop.
06-27-2008 7:19 AM
Hi,
Use the following function module.
Please check FM RP_CALC_DATE_IN_INTERVAL.
data: wa_date like sy-datum.
call function 'RP_CALC_DATE_IN_INTERVAL'
exporting
date = sy-datum
days = 0
months = 3
signum = '+'
years = 0
importing
calc_date = wa_date.
write: / wa_date.
Regards,
Raj.
06-27-2008 1:23 PM
you can use this simple code....
data:
imp_dt1 type EEIND,
imp_dt2 type EEIND,
imp_dt3 type EEIND,
l_date1 type sydatum,
l_date2 type sydatum,
l_date3 type sydatum.
write sy-datum to imp_dt1.
write sy-datum to imp_dt2.
write sy-datum to imp_dt3.
CALL FUNCTION 'DATE_IN_FUTURE'
EXPORTING
anzahl_tage = 29
import_datum = imp_dt1
IMPORTING
EXPORT_DATUM_INT_FORMAT = l_date1
.
CALL FUNCTION 'DATE_IN_FUTURE'
EXPORTING
anzahl_tage = 58
import_datum = imp_dt1
IMPORTING
EXPORT_DATUM_INT_FORMAT = l_date2
.
CALL FUNCTION 'DATE_IN_FUTURE'
EXPORTING
anzahl_tage = 80
import_datum = imp_dt1
IMPORTING
EXPORT_DATUM_INT_FORMAT = l_date3
.
write: l_date14(2) , l_date24(2) , l_date3+4(2).
now you can specify month according to that...
like if 01 then January 02 Feb....
You may find any other way but this is the simplest one.....
reward points if it helps...