‎2007 Jun 13 3:05 PM
Hi,
Is there any function module available to get the current month or is there any other way to get the current month in a program?
Thanks..
Uma.
‎2007 Jun 13 3:07 PM
‎2007 Jun 13 3:07 PM
‎2007 Jun 13 3:10 PM
and if you accidentaly want to work with other dates you can use
CALL FUNCTION 'GET_CURRENT_YEAR'
EXPORTING
bukrs = so_bukrs-low
date = it_catsdb-workdate
IMPORTING
currm = h_currmonth
curry = h_curryear
‎2007 Jun 13 3:11 PM
If you want to get month name :
Use Rich program:
report zrich_0001 .
data: current_month(2) TYPE N.
current_month = sy-datum+4(2).
write:/ current_month.
pass current_month to fm ,you will get month name
MONTH_NAMES_GET
‎2007 Jun 13 3:19 PM
Hi,
Please try this FM CACS_DATE_GET_YEAR_MONTH.
Regards,
Ferry Lianto
‎2007 Jun 13 3:23 PM
Hi Uma,
try this:
DATA: month_table type table of T247 with header line.
data: idx like sy-tabix.
*
CALL FUNCTION 'MONTH_NAMES_GET'
TABLES
MONTH_NAMES = month_table.
*
idx = sy-datum+4(2).
read table month_table index idx.
*
write: / 'actual month =', month_table-LTX.
Regards, Dieter
another way is this:
tables: T247.
*
select single * from t247 where spras = sy-langu
and MNR = sy-datum+4(2).
*
write: / 'actual month =', t247-LTX.
regards, Dieter
Message was edited by:
Dieter Gröhn
‎2007 Jun 13 4:12 PM
Hi,
Try with this code:
data: var(4) type d.
var = sy-datum+4(2).
write: sy-datum.
write: / var1.
Regards,
Bhaskar