02-12-2010 12:45 AM
Hi,
I would appreciate your help and inputs on the following problem I'm facing.
I'm trying to print certain employee information to ALV.
I'm using HR logical database PNP.
The problem I have is that the ALV is being generated for every different employee and i want it just to be printed at the end when all the internal tables were filles and the GET process is finished.
What might be my problem?
this is the piece of code:
GET pernr.
CLEAR itabname.
IF r2 = 'X'.
itabname = 'IT_PRESTAMO'.
PERFORM completar_tabla_prestamos.
PERFORM generar_catalogo_campos_alv USING itabname.
PERFORM crear_eventos CHANGING gt_events.
PERFORM crear_comentario CHANGING gt_list_top_of_page.
PERFORM mostrar_alv TABLES it_prestamo.
PERFORM completar_tabla_prestamos: fills the internal table
PERFORM mostrar_alv TABLES it_prestamo: call REUSE_ALV_LIST_DISPLAY function module.
the other routines are for generating ALV header , format, fielcatalogue and so on...
Thanks
Ivan
02-12-2010 1:22 AM
Hi,
GET event is called for each retrieved record. If you want to call something after your selection then you need to use event END-OF-SELECTION.
Cheers
02-12-2010 1:22 AM
Hi,
GET event is called for each retrieved record. If you want to call something after your selection then you need to use event END-OF-SELECTION.
Cheers
02-12-2010 3:40 AM
thanks Martin,
I tried that but not working for some reason. I might have done something wrong.
This how i tried, is anything wrong?
START-OF-SELECTION.
GET pernr.
*& This routine fills the internal table
PERFORM completar_tabla_prestamos.
END-OF-SELECTION.
CLEAR itabname.
IF r2 = 'X'.
itabname = 'IT_PRESTAMO'.
*& This routine generates the fieldcatalogue
PERFORM generar_catalogo_campos_alv USING itabname.
*& this routine creates the ALV events
PERFORM crear_eventos CHANGING gt_events.
*& this routine creates ALV comments in the header
PERFORM crear_comentario CHANGING gt_list_top_of_page.
*& This routine calls the display ALV function.
PERFORM mostrar_alv TABLES it_prestamo.
02-12-2010 3:58 AM
And what do you get? Have you tried to debug your program to see what it's doing?
Cheers
02-13-2010 6:32 PM
Martin,
I investigated the events order when working with Logical databases because of you suggestion and I finally make it work after putting the call to the ALV after END-OF-Selection.
Thanks a lot.