MUNDOSAP

MUNDOSAP (foro/index.php)
-   Programación ABAP IV (foro/forumdisplay.php?f=4)
-   -   Cabecera De Alv (foro/showthread.php?t=7855)

chelisse 21/09/07 08:19:19

Cabecera De Alv
 
Hola a todos, tengo que poner una cabecera en un ALV. No lo he hecho nunca y buscando por estos foros lo que veo no me resuelve la duda. Mi ALV es orientado a objetos y utilizo la siguiente llamada a metodo para mostrarlo:

CALL METHOD gr_alvgrid->set_table_for_first_display
EXPORTING
* I_BUFFER_ACTIVE =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME = 'ZAS_BLOQAGENDAS_ALV'
is_variant = gs_variant
i_save = 'A'
* I_DEFAULT = on
is_layout = gs_layout
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* it_toolbar_excluding = pt_exclude
* IT_HYPERLINK =

CHANGING
it_outtab = lt_datalv[]
it_fieldcatalog = gt_fieldcat
* it_sort = pt_sort
* IT_FILTER =

Para los eventos utilizo: CLASS lcl_event_handler .

No se si en esta clase hay algo para coger el evento de mostrar una cabecera, como he visto en otros ejemplos utilizando:
FORM alv_events .
DATA: ls_event TYPE slis_alv_event.

CLEAR gt_events. REFRESH gt_events.
CLEAR ls_event.
ls_event-name = slis_ev_top_of_page.
ls_event-form = 'TOP-OF-PAGE'.
APPEND ls_event TO gt_events.
ENDFORM. " alv_events

FORM top-of-page .
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_header_top
i_logo = 'ENJOYSAP_LOGO'
* I_END_OF_LIST_GRID =
* I_ALV_FORM =
.
ENDFORM. " top-of-page

Donde pongo yo gt_events en mi ALV??????. Sabeis como se haría en HTML??

ballan 24/09/07 13:15:37

Hay un pequeño truco para hacerlo con objetos:

1 Creas un custom container para almacenar la cabecera
2 Te creas un objeto type ref to cl_gui_alv_tree_simple
3 Rellenas las estrucutras necesarias y invocas al metodo create_report_header

chelisse 25/09/07 09:12:45

gracias, por tu respuesta, eso ya lo intenté y no quedó muy bién. Al final lo he resuelto poniendo en la dynpro campos de texto directamente, justo encima del alv

darona 25/09/07 10:13:56

El título se pone en un atributo del layout del alv.
Tienes 2 opciones, usar el atributo 'title' o si quieres un texto más pequeño igualas a 'X' el atributo 'smalltitle'.

Ejemplo:
it_layout-title = 'Título del ALV'.
it_layout-smalltitle = 'X'.

Espero que te sea de ayuda.

Saludos,
David.

chelisse 25/09/07 11:21:44

esto ultimo es para el título, yo preguntaba por una cabecera del alv. Gracias de todas formas por molestarte en responder. Como ya he dicho lo he resuelto.


Husos Horarios son GMT. La hora en este momento es 19:52:12.

www.mundosap.com 2006 - Spain
software crm, crm on demand, software call center, crm act, crm solutions, crm gratis, crm web