*&---------------------------------------------------------------------*
*& Report Z_CAL_DATE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_CAL_DATE.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER : P_DATUM TYPE SY-DATUM DEFAULT SY-DATLO,
P_TIME TYPE MARA-MHDHB.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETER : P_R1 RADIOBUTTON GROUP R1 DEFAULT 'X', "DAY
P_R2 RADIOBUTTON GROUP R1, "WEEK
P_R3 RADIOBUTTON GROUP R1, "MONTH
P_R4 RADIOBUTTON GROUP R1. "YEAR
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN END OF BLOCK B1.
DATA : LV_IPRKZ LIKE MARA-IPRKZ,
LV_IDATE LIKE SY-DATUM.
CASE 'X'.
WHEN P_R1. LV_IPRKZ = ''.
WHEN P_R2. LV_IPRKZ = '1'.
WHEN P_R3. LV_IPRKZ = '2'.
WHEN P_R4. LV_IPRKZ = '3'.
ENDCASE.
CALL FUNCTION 'ADD_TIME_TO_DATE'
EXPORTING
I_IDATE = P_DATUM
I_TIME = P_TIME
I_IPRKZ = LV_IPRKZ
IMPORTING
O_IDATE = LV_IDATE
EXCEPTIONS
INVALID_PERIOD = 1
INVALID_ROUND_UP_RULE = 2
INTERNAL_ERROR = 3
OTHERS = 4.
WRITE : LV_IDATE.
'SAP > Function' 카테고리의 다른 글
Excel File Read (0) | 2015.11.17 |
---|---|
POPUP관련함수들 (0) | 2010.07.19 |
Call transaction 을 대신하는 펑션 (0) | 2008.02.27 |
기간에 대한 일수를 계산하는 펑션 (0) | 2008.02.27 |