*& ZCALMONTH_DELTAP01P02 - month difference
*&-------------------------------------- ------------------------
WHEN 'ZCALMONTH_DELTAP01P02'.
DATA:
dh TYPE d,
dl TYPE d,
res TYPE i.
IF I_STEP EQ 2.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE WITH KEY VNAM = 'ZCALMONTHP01'.
IF SY-SUBRC = 0.
CONCATENATE LOC_VAR_RANGE-LOW '01' INTO L_DATE.
IF L_DATE < '20080701'.
L_DATE = '20080701'.
ENDIF.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE WITH KEY VNAM = 'ZCALMONTHP02'.
IF SY-SUBRC = 0.
CONCATENATE LOC_VAR_RANGE-LOW '01' INTO H_DATE.
dh = H_DATE.
dl = L_DATE.
CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
EXPORTING
I_DATE_FROM = dl
* I_KEY_DAY_FROM =
I_DATE_TO = dh
* I_KEY_DAY_TO =
* I_FLG_SEPARATE = ' '
IMPORTING
* E_DAYS =
E_MONTHS = res
* E_YEARS =
.
L_S_RANGE-LOW = res + 1.
ELSE.
L_S_RANGE-LOW = 1.
ENDIF.
ELSE.
L_S_RANGE-LOW = 1.
ENDIF.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
*&--------------------------------------
WHEN 'ZCALMONTH_DELTAP01P02'.
DATA:
dh TYPE d,
dl TYPE d,
res TYPE i.
IF I_STEP EQ 2.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE WITH KEY VNAM = 'ZCALMONTHP01'.
IF SY-SUBRC = 0.
CONCATENATE LOC_VAR_RANGE-LOW '01' INTO L_DATE.
IF L_DATE < '20080701'.
L_DATE = '20080701'.
ENDIF.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE WITH KEY VNAM = 'ZCALMONTHP02'.
IF SY-SUBRC = 0.
CONCATENATE LOC_VAR_RANGE-LOW '01' INTO H_DATE.
dh = H_DATE.
dl = L_DATE.
CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
EXPORTING
I_DATE_FROM
* I_KEY_DAY_FROM =
I_DATE_TO
* I_KEY_DAY_TO =
* I_FLG_SEPARATE = '
IMPORTING
* E_DAYS =
E_MONTHS =
* E_YEARS =
.
L_S_RANGE-LOW = res + 1.
ELSE.
L_S_RANGE-LOW = 1.
ENDIF.
ELSE.
L_S_RANGE-LOW = 1.
ENDIF.
APPEND L_S_RANGE TO E_T_RANGE.
ENDIF.
No comments:
Post a Comment