Icono en una Cabecera de ALV

Colapsar
X
 
  • Tiempo
  • Mostrar
Limpiar Todo
nuevos mensajes
  • turbo1959
    Member
    • feb
    • 49

    #1

    Icono en una Cabecera de ALV

    Buenos dias. Tengo un ALV que en la cabecera del informe quiero sacar un icono.

    Lo hago de la siguiente manera:

    INCLUDE <icon>.
    TABLES icon.
    DATA icon_mrp LIKE icon-id.

    Y cuando voy a sacar las cabeceras del ALV:

    WRITE icon_display_more AS ICON TO icon_mrp.

    i_heading-typ = 'S'.
    i_heading-key = 'Icono :'
    i_heading-info = icon_mrp.

    Debugando me sale en icon_display_more el dibujito del icono, pero en ino_mrp @1E@

    Y al sacarme la cabecera me sale @1E@ en vez del dibujito del icono.

    En que me estoy equivocando?

    Gracias y Saludos
  • VLozano
    Senior Member
    • nov
    • 124

    #2
    Código:
    LIKE icon-id
    Yo creo que aquí.
    En los ejemplos del WRITE qué tipo de datos declara para el WRITE AS ICON?
    "Porque algunos sabemos que somos parte del problema"
    - Pequeña guía para escribir mensajes en foros técnicos -

    Comentario

    • caralbgro
      Senior Member
      • sep
      • 478

      #3
      proba asi esto funciona!!!

      DATA: p_heading TYPE SLIS_FORMNAME.

      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
      * I_BACKGROUND_ID = 'ALV_BACKGROUND'
      i_interface_check = 'X'
      i_callback_program = g_repit
      it_fieldcat = LISTADO[]
      * i_callback_top_of_page = 'TOP_OF_PAGE'
      i_callback_html_top_of_page = p_heading
      is_layout = s_layout
      i_save = 'A'
      it_events = events[]
      i_callback_user_command = 'USER_COMMAND'
      TABLES
      t_outtab = T_LISTADO
      EXCEPTIONS
      program_error = 1
      OTHERS = 2.
      IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.

      ENDFORM.


      form html_top_of_page using document type ref to cl_dd_document.
      data: text type sdydo_text_element,
      R_AREA TYPE REF TO CL_DD_AREA.

      CALL METHOD document->INITIALIZE_DOCUMENT.
      CALL METHOD document->VERTICAL_SPLIT
      EXPORTING SPLIT_AREA = document
      SPLIT_WIDTH = '100%'
      IMPORTING RIGHT_AREA = R_AREA.

      CALL METHOD R_AREA->ADD_PICTURE
      EXPORTING PICTURE_ID = 'ZLOGO'
      WIDTH ='150'.

      text = 'Listado de Pendientes de Solicitud de Pedido'.

      call method document->add_text
      exporting
      text = text
      sap_style = 'HEADING'
      sap_color = space
      sap_fontsize = cl_dd_document=>SANS_SERIF
      sap_emphasis = cl_dd_document=>strong
      style_class = space.

      call method document->new_line.
      call method document->new_line.

      concatenate 'Usuario: ' sy-uname INTO text SEPARATED BY space.
      call method document->add_text
      exporting
      text = text
      sap_style = space
      sap_color = space
      sap_fontsize = cl_dd_document=>large
      sap_emphasis = space
      style_class = space.

      call method document->add_gap
      exporting
      width = 10.
      call method document->new_line.


      concatenate 'Fecha: ' sy-datum INTO text SEPARATED BY space.
      call method document->add_text
      exporting
      text = text
      sap_style = space
      sap_color = space
      sap_fontsize = cl_dd_document=>large
      sap_emphasis = space
      style_class = space.

      call method document->add_gap
      exporting
      width = 10.

      call method document->new_line.
      call method document->new_line.
      call method document->new_line.

      call method document->add_icon
      exporting
      sap_icon = 'ICON_RED_LIGHT'.
      call method document->add_gap
      exporting
      width = 2.
      text = 'No Autorizado'.

      call method document->add_text
      exporting
      text = text
      sap_style = space
      sap_color = space
      sap_fontsize = cl_dd_document=>large
      sap_emphasis = cl_dd_document=>strong
      style_class = space.

      call method document->add_gap
      exporting
      width = 10.

      call method document->add_icon
      exporting
      sap_icon = 'ICON_GREEN_LIGHT'.
      call method document->add_gap
      exporting
      width = 2.
      text = 'Autorizado'.
      call method document->add_text
      exporting
      text = text
      sap_style = space
      sap_color = space
      sap_fontsize = cl_dd_document=>large
      sap_emphasis = cl_dd_document=>strong
      style_class = space.


      call method document->add_gap
      exporting
      width = 10.

      call method document->add_icon
      exporting
      sap_icon = 'ICON_YELLOW_LIGHT'.
      call method document->add_gap
      exporting
      width = 2.
      text = 'Rechazado'.

      call method document->add_text
      exporting
      text = text
      sap_style = space
      sap_color = space
      sap_fontsize = cl_dd_document=>large
      sap_emphasis = cl_dd_document=>strong
      style_class = space.

      endform. " Html_top_of_page
      Consultor FI-CO

      Comentario

      Trabajando...