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 13/11/11, 22:20:22
vamp_01 vamp_01 is offline
Senior Member
 
Fecha de Ingreso: jun 2006
Mensajes: 109
Reporte ALV OO con cabecera y PDF

Hola amigos, tengo un problema, espero me puedan ayudar,.
Resulta que tengo un reporte alv oo con cabecera, y el reporte esta bien muestra la información y hasta ahí todo ok, el problema se provoca cuando quiero generarlo como pdf, es decir, agregue un botos a la botonera, pero no se como hacerlo para que el reporte se imprima en pdf, con cabecera y la data...he logrado hacer que cuando presione el botón de imprimir, al usuario le pida la ruta y la impresora, pero no se como recorrer la estructura de salida del alv y después poder imprimirlo en pdf, si alguien tiene algún ejemplo de recorrer la tabla de salida y imprimirlo...de ante mano gracias

Responder Con Cita
  #2  
Viejo 14/11/11, 07:51:51
jtristan jtristan is offline
Senior Member
 
Fecha de Ingreso: oct 2007
Mensajes: 240
Hola, puedes controlar la impresión con estos eventos:

print_end_of_list
Define output text to be printed at the end of the entire list
print_top_of_list
Define output text to be printed at the beginning of the entire list
print_end_of_page
Define output text to be printed at the end of each page
print_top_of_page
Define output text to be printed at the beginning of each page

Un saludo.
Responder Con Cita
  #3  
Viejo 14/11/11, 21:52:45
vamp_01 vamp_01 is offline
Senior Member
 
Fecha de Ingreso: jun 2006
Mensajes: 109
gracias jtristan por responder, tienes algún ejemplo de como hacer los que me dices...
gracias
Responder Con Cita
  #4  
Viejo 15/11/11, 07:11:42
jtristan jtristan is offline
Senior Member
 
Fecha de Ingreso: oct 2007
Mensajes: 240
Hola,

encontré la solución en "An Easy Reference for ALV GRID CONTROL". Es fácil encontrarlo.

En el apartado sobre impresión tienes lo siguiente:

D.8. About printing
There are some events that you can utilize about printing. You simply write what is to be output in methods handling these events. Here is the list of events in this context.
print_end_of_list
Define output text to be printed at the end of the entire list
print_top_of_list
Define output text to be printed at the beginning of the entire list
print_end_of_page
Define output text to be printed at the end of each page
print_top_of_page
Define output text to be printed at the beginning of each page

To utilize one of the events above, let’s proceed with the standard procedure since we did not add this event in our general scheme at section D.1.
First add a handler method in your handler class definition as:

e.g. METHOD handle_print_top_of_list
FOR EVENT print_top_of_list OF cl_gui_alv_grid .
Then implement the method in the implementation part of your local class.
e.g. METHOD handle_print_top_of_list .
WRITE:/ 'Flights Made on ', sy-datum .
ENDMETHOD .

And register this method as the handler.
e.g.
SET HANDLER gr_event_handler->handle_print_top_of_list FOR gr_alvgrid .
The output of these events can be examined at the print preview or in the printing.

Es decir, te declaras una clase para controlar enventos.

CLASS lcl_event_receiver DEFINITION DEFERRED.
data: event_receiver type ref to lcl_event_receiver.

"Creas la definición y la implementación.

class lcl_event_receiver definition.

public section.
methods:

handle_print_top_of_list
for print_top_of_list of cl_gui_alv_grid.

private section.

endclass.

*** IMPLEMENTACIÓN ***
class lcl_event_receiver implementation.

method handle_print_top_of_list.

WRITE:/ 'Flights Made on ', sy-datum .
"aquí podrías escribir cualquier cosa que quieras a nivel de cabecera.

endmethod.

endclass.

Luego en el dynpro en el PBO ya creas el objeto

y le asignas el evento.

set handler event_receiver->handle_print_top_of_list for grid.

No sé si me he explicado muy bien.
Responder Con Cita
  #5  
Viejo 16/11/11, 20:09:24
vamp_01 vamp_01 is offline
Senior Member
 
Fecha de Ingreso: jun 2006
Mensajes: 109
hola lo he intentando pero sin resultados aun...asi por el momento la cabecera del reporte...a la espera...pero ahora tengo este problema...encontre la forma de enviar al spool el alv 00 pero no me cambia la orientacion de la impresion en sap..y le estoy pasando todos los datos de la impresora..
bueno el alv cuenta con 26 columnas, y quiero que se impriman las 26 columnas...y no lo hace necesito ayuda urgente...estoy ocupando la funcion
REUSE_ALV_LIST_DISPLAY y en el is_print le paso los parametros de la impresora que se seteo anteriormente por el user en 65x255...
Imágenes Adjuntas
Tipo de Archivo: pdf debe_imprimir.pdf (15.5 KB, 59 visitas)
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 02:38:49.


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