martes, 9 de junio de 2015

Día de la Semana


*&---------------------------------------------------------------------*
form get_diasemana using p_datum changing p_dsema.
  data: lv_day type casdayattr occurs 0 with header line.
  p_dsema = ''.
  check p_datum is not initial.
*
  call function 'DAY_ATTRIBUTES_GET'
    exporting
      date_from                  = p_datum
      date_to                    = p_datum
      language                   = sy-langu
    tables
      day_attributes             = lv_day
    exceptions
      factory_calendar_not_found = 1
      holiday_calendar_not_found = 2
      date_has_invalid_format    = 3
      date_inconsistency         = 4
      others                     = 5.
  if ( sy-subrc eq 0 ).
    read table lv_day index 1.
    p_dsema = lv_day-weekday_s.
  endif.
*
endform.                    "get_diaSemana

*&---------------------------------------------------------------------*

*&---------------------------------------------------------------------*
form cargar_diaturno .

  ti_detalle-pernr = hd-pernr.
  ti_detalle-dia   = hd-datum.
  ti_detalle-dianumero = ti_detalle-dia+6(2).

  call function 'HRIQ_GET_DATE_DAYNAME'
    exporting
      langu  = sy-langu
      date   = ti_detalle-dia
    importing
      daytxt = v_diatexto.

  ti_detalle-diatexto = v_diatexto+0(2).
  translate ti_detalle-diatexto to upper case.

  ti_detalle-hora_teo_ini = hd-sobeg.
  ti_detalle-hora_teo_fin = hd-soend.

  ti_detalle-turno = hd-tprog.

endform.                    " CARGAR_DIATURNO
*&---------------------------------------------------------------------*





1 comentario:

  1. Este comentario ha sido eliminado por un administrador del blog.

    ResponderEliminar