MUNDOSAP

Regresar   MUNDOSAP > DESARROLLO > Programación ABAP IV
Nombre de Usuario
Contraseña
Home Descargas Registrar FAQ Miembros Calendario Buscar Temas de Hoy Marcar Foros Como Leídos




 
Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Viejo 28/04/10, 16:03:40
vstarke vstarke is offline
Member
 
Fecha de Ingreso: feb 2010
Mensajes: 60
Prueba con esto Yo ya lo utilicé.. espero y te ayude...


*&---------------------------------------------------------------------*
*& CLASES *
*&---------------------------------------------------------------------*
class lcl_event_receiver definition deferred.

data: gv_event_receiver type ref to lcl_event_receiver.

*----------------------------------------------------------------------*
* CLASS lcl_event_receiver DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_event_receiver definition.

public section.

methods:

handle_top_of_page for event top_of_page of cl_gui_alv_grid
importing e_dyndoc_id.

endclass. "lcl_event_receiver DEFINITION

*----------------------------------------------------------------------*
* CLASS lcl_event_receiver IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_event_receiver implementation.

method handle_top_of_page.

perform event_top_of_page using gv_dyndoc_id.

endmethod. "handle_top_of_page

endclass. "lcl_event_receiver IMPLEMENTATION

*gv_container type ref to cl_gui_custom_container
create object gv_container
exporting
container_name = 'CONTROL'.

*gv_dyndoc_id type ref to cl_dd_document
create object gv_dyndoc_id
exporting
style = 'ALV_GRID'.

* Create Splitter for custom_container
*gv_splitter type ref to cl_gui_splitter_container
create object gv_splitter
exporting
parent = gv_container
rows = 2
columns = 1.

*gv_parent_top type ref to cl_gui_container
call method gv_splitter->get_container
exporting
row = 1
column = 1
receiving
container = gv_parent_top.

*gv_parent_grid type ref to cl_gui_container
call method gv_splitter->get_container
exporting
row = 2
column = 1
receiving
container = gv_parent_grid.

* Set height for g_parent_html
call method gv_splitter->set_row_height
exporting
id = 1
height = 20.

* Create grid
*gv_parent_grid type ref to cl_gui_container
create object gv_grid
exporting
i_parent = gv_parent_grid.

create object gv_event_receiver.
set handler gv_event_receiver->handle_double_click for gv_grid.
set handler gv_event_receiver->handle_top_of_page for gv_grid.


call method gv_grid->set_table_for_first_display
changing
it_outtab = gt_outdata[]
it_fieldcatalog = gv_fieldcat.


call method gv_dyndoc_id->initialize_document
exporting
background_color = cl_dd_area=>col_textarea.

call method gv_grid->list_processing_events
exporting
i_event_name = 'TOP_OF_PAGE'
i_dyndoc_id = gv_dyndoc_id.

form event_top_of_page using p_dyndoc type ref to cl_dd_document.

data: v_text(255) type c,
v_date(50) type c.

call method p_dyndoc->add_text
exporting
text = 'AQUÍ VA TU TÍTULO'
sap_style = 'HEADING'
sap_fontsize = 'LARGE'.

call method p_dyndoc->new_line.
call method p_dyndoc->new_line.

v_text = p_kunde.

call method p_dyndoc->add_text
exporting
text = 'Texto más : '.

call method p_dyndoc->add_gap "da espacios no sirve poner texto con espacios vacíos
exporting
width = 17.

call method p_dyndoc->add_text
exporting
text = v_text
sap_fontsize = 'Strong'.

call method p_dyndoc->add_text
exporting
text = v_text
sap_fontsize = 'Strong'.

clear v_text.
call method p_dyndoc->new_line.

perform display.

endform. " event_top_of_page
*&---------------------------------------------------------------------*
*& Form display
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form display .

* Creating html control
*gv_html_cntrl type ref to cl_gui_html_viewer
if gv_html_cntrl is initial.
create object gv_html_cntrl
exporting
parent = gv_parent_top.
endif.

call method gv_dyndoc_id->merge_document.
gv_dyndoc_id->html_control = gv_html_cntrl.

* Display document
call method gv_dyndoc_id->display_document
exporting
reuse_control = 'X'
parent = gv_parent_top
exceptions
html_display_error = 1.

endform. " display
Responder Con Cita
  #2  
Viejo 29/04/10, 15:04:01
AlexisChavero
 
Mensajes: n/a
Hola a todos,
Otro modo que he utilizado para colocar titulo dentro del contenedor del ALV Grod OO es asignarlo dentro del Layout.
PERFORM set_layout CHANGING gs_layout . " Seteo del Layout

FORM SET_LAYOUT CHANGING PS_LAYOUT TYPE lvc_s_layo.
ps_layout-grid_title = 'TUTITULO' . " Aqui colocas tu titulo
ENDFORM. " SET_LAYOUT

y al momento de hacer la llamada al ALV OO se lo pasas...
CALL METHOD gr_alvgrid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
....

Espero les sirva esta forma ya que me parece que es lo que buscaban hacer.

Saludos,
Responder Con Cita
  #3  
Viejo 29/04/10, 22:06:26
Garces Garces is offline
Senior Member
 
Fecha de Ingreso: ago 2006
Localización: Lima - Perú
Mensajes: 321
Gracias a todos...
Al final lo hice con el código que Raven me proporcionó
Funcionó de maravilla...

Saludos...
__________________
Miguel Ángel Garcés Ramírez
Responder Con Cita
  #4  
Viejo 31/05/14, 16:12:48
alvcano alvcano is offline
Junior Member
 
Fecha de Ingreso: oct 2007
Mensajes: 13
Os dejo un ejemplo completo que he encontrado sobre un alv oo por si sirve de ayuda

Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Reglas de Mensajes
no puedes crear nuevos temas
no puedes responder temas
no puedes adjuntar archivos
no puedes editar tus mensajes

El código vB está On
Las caritas están On
Código [IMG] está On
Código HTML está Off
Saltar a Foro


Husos Horarios son GMT. La hora en este momento es 07:01:24.


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