Ver Mensaje Individual
  #2  
Viejo 13/01/17, 21:57:04
ecarrasco0119 ecarrasco0119 is offline
Junior Member
 
Fecha de Ingreso: dic 2014
Mensajes: 6
Smile

me parece que lo que tienes que hacer es modificar los subtotales de tu alv, para ello necesitas usar la función:

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

lo que hace es traer las propiedades de tu ALV. Una vez que tienes el objeto creado, extraes sus subtotales con el metodo :

CALL METHOD lo_grid->get_subtotals


te dejo un ejemplo que a mi me sirvio mucho:

DATA: lo_grid TYPE REF TO cl_gui_alv_grid,

* get the subtotal
it_00 TYPE REF TO data, " tabla con el total
it_01 TYPE REF TO data. " tabla con subtotal (declara tantas tablas como subtotales tengas)

FIELD-SYMBOLS: <ft_tab> TYPE ANY TABLE,
<fs_tab> TYPE any,
*declaro las columnas que quiero tratar en este caso la columna 3 va a guardar la suma de la columna 1 + columna 2.
<fs_campo1> TYPE any,
<fs_campo2> TYPE any,
<fs_campo3> TYPE any.

* get the global reference
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lo_grid.

*obtengo mis subtotales
CALL METHOD lo_grid->get_subtotals
IMPORTING
ep_collect00 = it_00
ep_collect01 = it_01.

trabajo con el subtotal
ASSIGN it_01->* TO <ft_tab>.
LOOP AT <ft_tab> ASSIGNING <fs_tab>.

ASSIGN COMPONENT 'CAMPO1' OF STRUCTURE <fs_tab> TO <fs_campo1>.

ASSIGN COMPONENT 'CAMPO2' OF STRUCTURE <fs_tab> TO <fs_campo2>.

ASSIGN COMPONENT 'CAMPO3' OF STRUCTURE <fs_tab> TO <fs_campo3>.

<fs_campo3> = <fs_campo1> + <fs_campo2>.


ENDLOOP.


debes crear un perform top_of_page y meter ahi toda esta logica


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'F_STATUS'
i_callback_user_command = 'F_USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE' " <------------------aqui se hace el llamado.


a grandes rasgos hice eso, espero te sea de ayuda
Responder Con Cita