วันพฤหัสบดีที่ 2 กันยายน พ.ศ. 2553

Program ABAP : zbot_exchangerate : form check_holiday

<< Start-Of-Selection

*&---------------------------------------------------------------------*
*&      Form  CHECK_HOLIDAY
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_P_DATE  text
*      <--P_GV_HOLIDAY  text
*----------------------------------------------------------------------*
form check_holiday  using    p_date
                    changing p_holiday.
  data : lv_date type sy-datum.
  clear gi_holi[].
  lv_date = p_date.

  call function 'HOLIDAY_GET'
    exporting
      holiday_calendar           = 'T1'
      factory_calendar           = 'T1'
      date_from                  = lv_date
      date_to                    = lv_date
    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.
    if sy-subrc eq 0.
      p_holiday = 'X'.
    else.
      p_holiday = space.
    endif.
  endif.
endform.                    " CHECK_HOLIDAY

ไม่มีความคิดเห็น:

แสดงความคิดเห็น