<< Start-Of-Selection
*&---------------------------------------------------------------------*
*& Form GET_FIRST_OF_MONTH
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_P_DATE text
* <--P_GV_EDATE text
*----------------------------------------------------------------------*
form get_end_of_prev_month using value(pa_date)
changing p_pdate.
data : lv_date type sy-datum.
clear gi_holi[].
lv_date = pa_date.
lv_date+6(2) = '01'.
lv_date = lv_date - 1.
do.
call function 'HOLIDAY_GET'
exporting
holiday_calendar = 'T1'
factory_calendar = 'T1'
date_from = lv_date
date_to = lv_date
* IMPORTING
* YEAR_OF_VALID_FROM =
* YEAR_OF_VALID_TO =
* RETURNCODE =
tables
holidays = gi_holi
exceptions
factory_calendar_not_found = 1
holiday_calendar_not_found = 2
date_has_invalid_format = 3
date_inconsistency = 4
others = 5
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
read table gi_holi with key date = lv_date.
* FREEDAY = 'X'
* HOLIDAY = 'X'.
if sy-subrc eq 0.
lv_date = lv_date - 1.
else.
p_pdate = lv_date.
exit.
endif.
endif.
enddo.
endform. " GET_FIRST_OF_MONTH
<< Start-Of-Selection
ไม่มีความคิดเห็น:
แสดงความคิดเห็น