#11
|
|||
|
|||
____________________________________________________________
Buen día, DERICK y hola: disculpa esta forma que me dijistes al final me debe actualizar los totales de mi alv en pantalla autómaticamente? Será que a mi no me funcionó porque estoy usando funciones estandar de sap para desplegar mi alv? CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' mi tabla al alv se llama i_alv. y solo contiene los registros a sumarizar. saludos
__________________
Saludos Alabado Seas Yhavé. -Hay Un Mundo Mejor Cuando Aprendes a AMAR |
#12
|
||||
|
||||
Asi es, eso te coloca los totales en tu ALV, ah yo tambien lo hice con REUSE_ALV_GRID_DISPLAY, recuerda agregar el evento yo lo hice desde el parametro i_callback_top_of_page 'SUB_ALV_TOP_OF_PAGE' <- Nombre del form donde coloqué el código que te mandé xD.
__________________
------------------- ¿Dudas para descargar manuales? Ver este tema -> |
#13
|
|||
|
|||
________________________________________________________ YA LO HICE TAMBIEN ASI Y NO ME FUNCIONO, NI MODO...GRACIAS DERICK.
__________________
Saludos Alabado Seas Yhavé. -Hay Un Mundo Mejor Cuando Aprendes a AMAR |
#14
|
||||
|
||||
Algo te debe estar faltando.... Que versión de SAP tienes? ¿Puedes compartir tu programa para ver como le estas haciendo?
__________________
------------------- ¿Dudas para descargar manuales? Ver este tema -> |
#15
|
|||
|
|||
_____________________________________________________________
VERSION 6.4 (COMO COMPARTO EL PGMA Y SUS INCLUDES? ESQUE NO ME DEJA ATACHARLOS TODOS PERO HAY VAN SOLO 3 RUTINAS) PROGRAME LO QUE ME DIJISTES EN LA RUTINA DEL TOP ANTES DEL ENDFORM _____________________________________________________________ ESTA ES LA RUTINA DEL DISPLAY ALV _____________________________________________________________ *&---------------------------------------------------------------------* *& Form F_DISPLAY_ALV_REPORT * *&---------------------------------------------------------------------* * Display alv report on output screen * *----------------------------------------------------------------------* FORM f_display_alv_report . * Local variables------------------------------------------------------* DATA: lv_program TYPE sy-repid, i_lvc_s_glay LIKE lvc_s_glay. i_lvc_s_glay-edt_cll_cb = 'X'. CLEAR w_variant. lv_program = sy-repid. * Variant for ALV. w_variant-report = lv_program. w_variant-variant = p_vari. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING i_callback_program = lv_program i_callback_pf_status_set = 'C' i_callback_user_command = 'USER_COMMAND' i_callback_top_of_page = 'F_ALV_TOP' i_structure_name = 'I_ALV' i_grid_settings = i_lvc_s_glay is_layout = w_layout it_fieldcat = i_fieldcat it_sort = it_sortCat i_default = c_x i_save = c_a is_variant = w_variant it_events = i_events TABLES t_outtab = i_alv EXCEPTIONS program_error = 1 OTHERS = 2. IF sy-subrc <> c_zeros. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDFORM. " F_DISPLAY_ALV_REPORT _____________________________________________________________ ESTA ES LA RUTINA DEL TOP _____________________________________________________________ *&---------------------------------------------------------------------* *& Form f_alv_top * *&---------------------------------------------------------------------* * Routine To generate the headed one of the ALV * *----------------------------------------------------------------------* FORM f_alv_top. * Local Variables------------------------------------------------------* DATA: lv_date(10) TYPE c, lv_layout(50) TYPE c, lv_textvar LIKE varit-vtext, lv_variant(50) TYPE c. * to verify that the Head does not have data. REFRESH i_list_top. * CHECK i_list_top[] IS INITIAL. * Change Sy-Datum by Sy-Datlo. WRITE sy-datlo TO lv_date DD/MM/YYYY. * Create the name of the file to be generated. CLEAR: i_gs_line. i_gs_line-typ = c_s. i_gs_line-key = text-t03. "File i_gs_line-info = p_displ. APPEND i_gs_line TO i_list_top. * Create Date CLEAR: i_gs_line. i_gs_line-typ = c_s. i_gs_line-key = text-t01. "Date i_gs_line-info = lv_date. APPEND i_gs_line TO i_list_top. * Create User CLEAR: i_gs_line. i_gs_line-typ = c_s. "Line type [H]eader i_gs_line-key = text-t02. "User i_gs_line-info = sy-uname. APPEND i_gs_line TO i_list_top. CLEAR: i_gs_line. * Create Total Records CLEAR: i_gs_line. i_gs_line-typ = c_s. "Line type [H]eader i_gs_line-key = text-t04. "Total records i_gs_line-info = v_tot_reg_t. APPEND i_gs_line TO i_list_top. CALL FUNCTION 'RS_VARIANT_TEXT' EXPORTING curr_report = sy-cprog langu = sy-langu variant = sy-slset IMPORTING v_text = lv_textvar EXCEPTIONS no_text = 1. IF sy-subrc EQ c_zeros. CONCATENATE sy-slset lv_textvar INTO lv_variant SEPARATED BY space. ENDIF. * i_gs_line-typ = c_s. " Line type [H]eader * i_gs_line-key = text-t05. " Variant * i_gs_line-info = lv_variant. * APPEND i_gs_line TO i_list_top. * Create the Third label of Title CLEAR: i_gs_line. CONCATENATE p_vari v_text_lay INTO lv_layout SEPARATED BY space. CLEAR: i_gs_line. i_gs_line-typ = c_s. " Line type [H]eader i_gs_line-key = text-t06. " Layout i_gs_line-info = lv_layout. APPEND i_gs_line TO i_list_top. * Write the Headed CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE' EXPORTING it_list_commentary = i_list_top. ENDFORM. " f_alv_top _____________________________________________________________ ESTA ES LA RUTINA DE DATA_CHANGED _____________________________________________________________ *&---------------------------------------------------------------------* *& Form DATA_CHANGED *&---------------------------------------------------------------------* * Modifies the CheckBox in the ALV Report *----------------------------------------------------------------------* * <--P_I_EXTAB text *----------------------------------------------------------------------* FORM data_changed USING rr_data TYPE REF TO cl_alv_changed_data_protocol. DATA : ls_mod_cell TYPE lvc_s_modi, lv_value TYPE lvc_value. SORT rr_data->mt_mod_cells BY row_id . LOOP AT rr_data->mt_mod_cells INTO ls_mod_cell. IF ls_mod_cell-fieldname = 'DESPU'. READ TABLE i_alv index ls_mod_cell-row_id . IF sy-subrc = 0. i_alv-despu = ls_mod_cell-value. MODIFY i_alv index ls_mod_cell-row_id. CALL METHOD rr_data->MODIFY_CELL EXPORTING i_row_id = ls_mod_cell-row_id i_fieldname = 'DESPU' i_value = ls_mod_cell-value. ENDIF. ENDIF. ENDLOOP. ENDFORM.
__________________
Saludos Alabado Seas Yhavé. -Hay Un Mundo Mejor Cuando Aprendes a AMAR |
#16
|
||||
|
||||
mmm
No veo nada en el f_alv_top no está el código que te pase.
__________________
------------------- ¿Dudas para descargar manuales? Ver este tema -> |
#17
|
|||
|
|||
_____________________________________________________________
Si lo quité,, ya la acabo de poner y probar y los totales no cambian al valor de 100. Asi quedó la rutina: *&---------------------------------------------------------------------* *& Form f_alv_top * *&---------------------------------------------------------------------* * Routine To generate the headed one of the ALV * *----------------------------------------------------------------------* FORM f_alv_top. * Local Variables------------------------------------------------------* DATA: lv_date(10) TYPE c, lv_layout(50) TYPE c, lv_textvar LIKE varit-vtext, lv_variant(50) TYPE c. DATA: BEGIN OF i_sumSel OCCURS 0, waers LIKE i_alv-waers, "Moneda wrbtr LIKE i_alv-wrbtr, "Importe END OF i_sumSel. * to verify that the Head does not have data. REFRESH i_list_top. * CHECK i_list_top[] IS INITIAL. * Change Sy-Datum by Sy-Datlo. WRITE sy-datlo TO lv_date DD/MM/YYYY. * Create the name of the file to be generated. CLEAR: i_gs_line. i_gs_line-typ = c_s. i_gs_line-key = text-t03. "File i_gs_line-info = p_displ. APPEND i_gs_line TO i_list_top. * Create Date CLEAR: i_gs_line. i_gs_line-typ = c_s. i_gs_line-key = text-t01. "Date i_gs_line-info = lv_date. APPEND i_gs_line TO i_list_top. * Create User CLEAR: i_gs_line. i_gs_line-typ = c_s. i_gs_line-key = text-t02. "User i_gs_line-info = sy-uname. APPEND i_gs_line TO i_list_top. CLEAR: i_gs_line. * Create Total Records DESCRIBE TABLE i_alv LINES v_tot_reg_t. CLEAR: i_gs_line. i_gs_line-typ = c_s. i_gs_line-key = text-t04. "Total records i_gs_line-info = v_tot_reg_t. APPEND i_gs_line TO i_list_top. * Create Selected Total Records v_tot_reg_s = c_zeros. REFRESH i_sumSel. CLEAR i_sumSel. LOOP AT i_alv. IF i_alv-despu = c_x. v_tot_reg_s = v_tot_reg_s + c_uno. i_sumSel-waers = i_alv-waers. i_sumSel-wrbtr = i_alv-wrbtr. COLLECT i_sumSel. ENDIF. ENDLOOP. CLEAR: i_gs_line. i_gs_line-typ = c_s. i_gs_line-key = text-t05. "Total Selected i_gs_line-info = v_tot_reg_s. APPEND i_gs_line TO i_list_top. * Create Total Moneda LOOP AT i_sumSel. CLEAR: i_gs_line. i_gs_line-typ = c_s. CONCATENATE text-t06 "Total Moneda i_sumSel-waers INTO i_gs_line-key SEPARATED BY SPACE. CONCATENATE i_gs_line-key c_2ptos INTO i_gs_line-key. i_gs_line-info = i_sumSel-wrbtr. APPEND i_gs_line TO i_list_top. ENDLOOP. CALL FUNCTION 'RS_VARIANT_TEXT' EXPORTING curr_report = sy-cprog langu = sy-langu variant = sy-slset IMPORTING v_text = lv_textvar EXCEPTIONS no_text = 1. IF sy-subrc EQ c_zeros. CONCATENATE sy-slset lv_textvar INTO lv_variant SEPARATED BY space. ENDIF. * i_gs_line-typ = c_s. " Line type [H]eader * i_gs_line-key = text-t05. " Variant * i_gs_line-info = lv_variant. * APPEND i_gs_line TO i_list_top. * Create the Third label of Title CLEAR: i_gs_line. CONCATENATE p_vari v_text_lay INTO lv_layout SEPARATED BY space. CLEAR: i_gs_line. i_gs_line-typ = c_s. " Line type [H]eader i_gs_line-key = text-t07. " Layout i_gs_line-info = lv_layout. APPEND i_gs_line TO i_list_top. * Write the Headed CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE' EXPORTING it_list_commentary = i_list_top. * Código que me pasastes. DATA: lo_grid TYPE REF TO cl_gui_alv_grid. * Obtenemos referencia al ALV CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR' IMPORTING e_grid = lo_grid. * Tablas internas para grantotal y subtotal. * En este caso solo tenemos un subtotal, si se subtotalizara por otros * campos hay que agregar mas it_##. DATA: it_00 TYPE REF TO data, it_01 TYPE REF TO data. CALL METHOD lo_grid->get_subtotals IMPORTING ep_collect00 = it_00 "Gran Total ep_collect01 = it_01. "Novel LIFNR * Cambiamos los datos. FIELD-SYMBOLS: <ft_tab> TYPE ANY TABLE, <fs_tab> TYPE ANY, <ff_field> TYPE ANY. * Gran Total ASSIGN it_00->* TO <ft_tab>. LOOP AT <ft_tab> ASSIGNING <fs_tab>. ASSIGN COMPONENT 'WRBTR' OF STRUCTURE <fs_tab> TO <ff_field>. <ff_field> = '1000'. "Modificamos ENDLOOP. * LIFNR Level ASSIGN it_01->* TO <ft_tab>. LOOP AT <ft_tab> ASSIGNING <fs_tab>. ASSIGN COMPONENT 'WRBTR' OF STRUCTURE <fs_tab> TO <ff_field>. <ff_field> = '100'. "Modificamos ENDLOOP. ENDFORM. " f_alv_top
__________________
Saludos Alabado Seas Yhavé. -Hay Un Mundo Mejor Cuando Aprendes a AMAR |
#18
|
||||
|
||||
Hola, trata de usar etiquetas para encerrar tu código, es medio molesto leerlo sin etiquetas xD ""....
Como ultimo intento te dejo un ejemplo, si ese no te funciona dile a tu usuario que no se puede jajaja.
__________________
------------------- ¿Dudas para descargar manuales? Ver este tema -> |
#19
|
|||
|
|||
____________________________________________________________
GRACIAS MUCHAS.....LO VOY A CHECAR....TE AVISO.....SALUDOS. GRACIAS POR LA MOLESTIA. BYE. _____________________________________________________________ HOLA DCERICK NO SE PUDO TAMPOCO, PERO LO QUE HICE FUE PONERLE DOS TOTALES POR MONEDA TOTALES EN EL TOP DEL ALV Y UN TOTAL DE REGISTROS SELECCIONADOS. CADA VEZ QUE SELECCIONO O DESELECCIONO UN RENGLON DEL ALV ESTOS TRES INDICADORES CAMBIAN. GRACIAS.
__________________
Saludos Alabado Seas Yhavé. -Hay Un Mundo Mejor Cuando Aprendes a AMAR Úlima edición por Eduesqueda fecha: 03/05/12 a las 23:02:38. |
Herramientas | Buscar en Tema |
Desplegado | |
|
|