Skip to Content
0
Former Member
Nov 13, 2006 at 05:50 PM

FM - duration_determine

212 Views

Hi,

I am trying to execute a FM in tansfer routine to get the total number of days in current fiscal period/year. But I am not getting the result. I want the result to be assigned to an infoobject

Pleasecheck the code and give me the solution. thanks in advance

DATA: DYS TYPE I.

CALL FUNCTION 'DURATION_DETERMINE'

EXPORTING

UNIT = SPACE

FACTORY_CALENDAR = 'US'

IMPORTING

DURATION = DYS

CHANGING

START_DATE = SY-DATUM

START_TIME = SY-UZEIT

END_DATE = SY-DATUM

END_TIME = SY-UZEIT

EXCEPTIONS

FACTORY_CALENDAR_NOT_FOUND = 1

DATE_OUT_OF_CALENDAR_RANGE = 2

DATE_NOT_VALID = 3

UNIT_CONVERSION_ERROR = 4

SI_UNIT_MISSING = 5

PARAMETERS_NOT_VALID = 6

OTHERS = 7

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

RESULT = DYS.