Pregunta

Mi amigo parece estar teniendo algunos problemas con ABAP. Aquí está una copia de su pregunta -. Publicado en los foros de la comunidad SAP


Hola a todos, Estoy tratando de marcar el DateNavigator con dos categorías. Hice un contexto denominado huella, con atributos fecha, categoría e Información sobre la herramienta.

Nodo: Marcado

  • Fecha:
  • Categoría:
  • Información sobre la herramienta:

Me llena categoría atributo con dos categorías: e_category-three y e_category-four. Llené el atributo fecha con las fechas. Quiero un poco de estas fechas para garantizar la categoría de tres y otros categoría cuatro.

En la actualidad, todas las fechas se establecen en la primera categoría (e_category-three) y el código es el siguiente.

if ls_host_name-host_name <> host_msg and ls_vm_name-vm_name = vm_msg.
  loop at lt_machine_booking into wa.
    if ls_host_name-host_name = wa-host_name.
        date = wa-reserved_from.
      while date <= wa-reserved_till.
        ls_dates_shared-dates = date.     > i want these dates to be e_category-three
        append ls_dates_shared to lt_dates_shared.
        add 1 to date.
      ENDWHILE.
    endif.
    ENDLOOP.
elseif ls_host_name-host_name <> host_msg and ls_vm_name-vm_name <> vm_msg.
    loop at lt_machine_booking into wa.
      if ls_host_name-host_name = wa-host_name and ls_vm_name-vm_name = wa-vm_name.
        date = wa-reserved_from.
        while date <= wa-reserved_till.
          ls_dates_shared = date.       > i want these dates to be e_category-four
          append ls_dates_shared to lt_dates_shared.
          add 1 to date.
        ENDWHILE.
      endif.
      " ... 
¿Fue útil?

Solución

Estoy asumiendo que es de tipo ls_dates_shared marca?

Si este es el caso de tener que rellenar los campos ls_dates_shared-category y ls_dates_shared-tooltip explícitamente.

En la actualidad esto puede ser llenado antes del fragmento de código que usted nos da. Intentar algo como esto:

if ls_host_name-host_name <> host_msg and ls_vm_name-vm_name = vm_msg.
  loop at lt_machine_booking into wa.
    if ls_host_name-host_name = wa-host_name.
        date = wa-reserved_from.
      while date <= wa-reserved_till.
        ls_dates_shared-dates = date.     "i want these dates to be e_category-three"
        ls_dates_shared-category = e_category-three.
        "ls_dates-tooltip = appropriate_tooltip for e_category-three"
        append ls_dates_shared to lt_dates_shared.
        add 1 to date.
      ENDWHILE.
    endif.
  ENDLOOP.

elseif ls_host_name-host_name <> host_msg and ls_vm_name-vm_name <> vm_msg.
  loop at lt_machine_booking into wa.
    if ls_host_name-host_name = wa-host_name and ls_vm_name-vm_name = wa-vm_name.
      date = wa-reserved_from.
      while date <= wa-reserved_till.
        ls_dates_shared = date.       "i want these dates to be e_category-four"
        ls_dates_shared-category = e_category-four.
        "ls_dates-tooltip = appropriate_tooltip for e_category-four"
        append ls_dates_shared to lt_dates_shared.
        add 1 to date.
      ENDWHILE.
    endif.
...
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top