*&---------------------------------------------------------------------*
*& 子例程池 Z_VAR_EXAMPLE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
PROGRAM z_var_zcalday_v094 .
*&---------------------------------------------------------------------*
*& Subroutine Pool Z_VAR_ZLDATE
*&
*&---------------------------------------------------------------------*
* Program ID : Z_VAR_ZLDATE
* Program Title : User exit for ZLDATE
* Development ID :
* Description : Exit for variable ZLDATE
*======================================================================
* CHANGE HISTORY LOG
*----------------------------------------------------------------------
* Date | Name | Change ID | Change Request Number
*----------------------------------------------------------------------
* | | IDDXXXXX |
* DESCRIPTION:
***********************************************************************
*&---------------------------------------------------------------------*
TYPE-POOLS : rrs0 , rsr , rro01 .
DATA : l_s_range TYPE rsr_s_rangesid ,
l_s_var_range TYPE rrrangeexit .
**&---------------------------------------------------------------------*
**& Form DO_USER_EXIT
**&---------------------------------------------------------------------*
** text
**----------------------------------------------------------------------*
** -->I_VNAM Name of Variable to be Replaced
** -->I_VARTYP Variable Type (Characteristic Value, Text, Formula, and so on)
** -->I_IOBJNM InfoObject that the Variable Refers to
** -->I_S_COB_PRO InfoObject Properties
** -->I_S_RKB1D Query Reporting Attribute
** -->I_PERIV Query Definition Attribute
** -->I_T_VAR_RANGE Variable Range
** -->I_STEP Step
** -->E_T_RANGE Variables Value Table
**----------------------------------------------------------------------*
FORM do_user_exit USING i_vnam LIKE rszglobv -vnam
i_vartyp LIKE rszglobv -vartyp
i_iobjnm LIKE rszglobv -iobjnm
i_s_cob_pro TYPE rsd_s_cob_pro
"i_s_cob_pro type ZRSD_S_COB_PRO
i_s_rkb1d LIKE rsr_s_rkb1d
i_periv TYPE rro01_s_rkb1f -periv
i_t_var_range TYPE rrs0_t_var_range
i_step TYPE i
CHANGING e_t_range TYPE rsr_t_rangesid .
"求本周初到周末
DATA : year_week ( 6 ) TYPE c ,
I_DATE TYPE SY -DATUM ,
L_DATE TYPE SY -DATUM ,
l_DATE2 TYPE SY -DATUM .
IF i_step = 2 .
I_DATE = SY -DATUM - 1 .
"上周初到周末
"I_DATE = SY_DATUM - 8.
CLEAR l_s_range .
CALL FUNCTION 'ZGET_WEEK_INFO_BASED_ON_DATE'
EXPORTING
date = I_date
IMPORTING
week = year_week
monday = L_DATE
sunday = L_DATE2 .
l_s_range -LOW = L_DATE .
l_s_range -HIGH = l_DATE2 .
l_s_range - sign = 'I' .
l_s_range -opt = 'BT' .
APPEND l_s_range TO e_t_range .
EXIT .
ENDIF .
ENDFORM . "do_user_exit
*& 子例程池 Z_VAR_EXAMPLE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
PROGRAM z_var_zcalday_v094 .
*&---------------------------------------------------------------------*
*& Subroutine Pool Z_VAR_ZLDATE
*&
*&---------------------------------------------------------------------*
* Program ID : Z_VAR_ZLDATE
* Program Title : User exit for ZLDATE
* Development ID :
* Description : Exit for variable ZLDATE
*======================================================================
* CHANGE HISTORY LOG
*----------------------------------------------------------------------
* Date | Name | Change ID | Change Request Number
*----------------------------------------------------------------------
* | | IDDXXXXX |
* DESCRIPTION:
***********************************************************************
*&---------------------------------------------------------------------*
TYPE-POOLS : rrs0 , rsr , rro01 .
DATA : l_s_range TYPE rsr_s_rangesid ,
l_s_var_range TYPE rrrangeexit .
**&---------------------------------------------------------------------*
**& Form DO_USER_EXIT
**&---------------------------------------------------------------------*
** text
**----------------------------------------------------------------------*
** -->I_VNAM Name of Variable to be Replaced
** -->I_VARTYP Variable Type (Characteristic Value, Text, Formula, and so on)
** -->I_IOBJNM InfoObject that the Variable Refers to
** -->I_S_COB_PRO InfoObject Properties
** -->I_S_RKB1D Query Reporting Attribute
** -->I_PERIV Query Definition Attribute
** -->I_T_VAR_RANGE Variable Range
** -->I_STEP Step
** -->E_T_RANGE Variables Value Table
**----------------------------------------------------------------------*
FORM do_user_exit USING i_vnam LIKE rszglobv -vnam
i_vartyp LIKE rszglobv -vartyp
i_iobjnm LIKE rszglobv -iobjnm
i_s_cob_pro TYPE rsd_s_cob_pro
"i_s_cob_pro type ZRSD_S_COB_PRO
i_s_rkb1d LIKE rsr_s_rkb1d
i_periv TYPE rro01_s_rkb1f -periv
i_t_var_range TYPE rrs0_t_var_range
i_step TYPE i
CHANGING e_t_range TYPE rsr_t_rangesid .
"求本周初到周末
DATA : year_week ( 6 ) TYPE c ,
I_DATE TYPE SY -DATUM ,
L_DATE TYPE SY -DATUM ,
l_DATE2 TYPE SY -DATUM .
IF i_step = 2 .
I_DATE = SY -DATUM - 1 .
"上周初到周末
"I_DATE = SY_DATUM - 8.
CLEAR l_s_range .
CALL FUNCTION 'ZGET_WEEK_INFO_BASED_ON_DATE'
EXPORTING
date = I_date
IMPORTING
week = year_week
monday = L_DATE
sunday = L_DATE2 .
l_s_range -LOW = L_DATE .
l_s_range -HIGH = l_DATE2 .
l_s_range - sign = 'I' .
l_s_range -opt = 'BT' .
APPEND l_s_range TO e_t_range .
EXIT .
ENDIF .
ENDFORM . "do_user_exit