‎2008 May 20 5:56 PM
Hi, I need a function that returns the month of the date that I pass as parameter.
For example:
Function X
Input: dats
Output: integer (month of date input)
Can someone help me?
Thanks
‎2008 May 20 6:00 PM
is more easy do this..
data: month type integer.
move dats+4(2) to month.
‎2008 May 20 6:00 PM
is more easy do this..
data: month type integer.
move dats+4(2) to month.
‎2008 May 20 6:00 PM
Hi,
Have a look on the following code, I think this is the solution
Display the month in word format.
27/03/2008 displays it as 27 Mar 2008.
data: date1(15),
date2(15).
*CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'
EXPORTING
input = sy-datum
IMPORTING
OUTPUT = date1
.
*write:/ date1.
*write:/ date1 using edit mask '__ ___ ____'.
*concatenate date10(2) date12(3) date1+5 into date2 separated by
*space.
*write:/ date2.
OR
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
input = sy-datum
IMPORTING
OUTPUT = date1
.
write:/ date1.
Reward,if useful.
Thanks,
Chandu
‎2008 May 20 6:41 PM
Try this FM ISP_GET_MONTH_NAME but it is there in ECC6.0 only
or try this
IF ( DATE IS INITIAL ) AND ( MONTH_NUMBER IS INITIAL ).
RAISE WRONG_INPUT.
ENDIF.
*
IF NOT MONTH_NUMBER IS INITIAL.
IF ( MONTH_NUMBER < '01' ) OR ( MONTH_NUMBER > '12' ).
RAISE WRONG_INPUT.
ENDIF.
IF ( NOT DATE IS INITIAL ) AND ( DATE+4(2) <> MONTH_NUMBER ).
RAISE WRONG_INPUT.
ENDIF.
ENDIF.
*
IF NOT DATE IS INITIAL.
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
DATE = DATE
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1
OTHERS = 2.
IF SY-SUBRC NE 0.
RAISE DATE_ERROR.
ENDIF.
MONTH_NUMBER = DATE+4(2).
ENDIF.
*
SELECT SINGLE * FROM T247 WHERE SPRAS = LANGUAGE
AND MNR = MONTH_NUMBER.
IF SY-SUBRC NE 0.
SELECT SINGLE * FROM T247 WHERE SPRAS = SY-LANGU
AND MNR = MONTH_NUMBER.
IF SY-SUBRC NE 0.
RAISE NOT_FOUND.
ENDIF.
ENDIF.
SHORTTEXT = T247-KTX.
LONGTEXT = T247-LTX.
LANGU_BACK = T247-SPRAS.
Edited by: S@N on May 20, 2008 7:45 PM
‎2008 May 20 6:52 PM
hi check this..
REPORT ZMONTH.
DATA X_MONTH(11).
CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'
EXPORTING
INPUT = SY-DATUM
IMPORTING
OUTPUT = X_MONTH.
regards,
venkat