refrescar una ALV editable

Colapsar
X
 
  • Tiempo
  • Mostrar
Limpiar Todo
nuevos mensajes
  • Abapor
    Member
    • may
    • 34

    #1

    refrescar una ALV editable

    Hola,
    tengo un problema con un ALV editable, estoy usando el metodo check_changed_data de la clase cl_gui_alv_grid para guardar modificaciones que se hacen el AVL

    Código:
        WHEN 'MODIF'.
          CLEAR i_tabla_aux.
          REFRESH i_tabla_aux.
    
          i_tabla_aux[] = i_tabla[].
          DATA ref1 TYPE REF TO cl_gui_alv_grid.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              e_grid = ref1.
          CALL METHOD ref1->check_changed_data.
    el problema es que al ejecutar el programa con las modificacion todo pasa bien, pero cuando hago un back quiero que mi AVL no guarda lo que escribí en las celdas.

    hay una menara de refrescar la AVL, y limpiar sus celdas ??

    muchas gracias de antemano
  • Mike
    Senior Member
    • mar
    • 144

    #2
    El metodo REFRESH_TABLE_DISPLAY te refresca el ALV

    Comentario

    • Abapor
      Member
      • may
      • 34

      #3
      Muchas gracias
      voy a probarlo!!

      Saludos.

      Comentario

      • GaBo_s
        Junior Member
        • feb
        • 3

        #4
        intenta con esto
        " to reflect the data changed into internal table
        "ACTUALIZA LOS REGISTROS SELECCIONADOS
        IF REF_GRID IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
        E_GRID = REF_GRID.
        ENDIF.

        IF NOT REF_GRID IS INITIAL.
        CALL METHOD REF_GRID->CHECK_CHANGED_DATA.
        ENDIF.

        Comentario

        • Abapor
          Member
          • may
          • 34

          #5
          Hola GaBo_s,
          Muchas gracias por tu respuesta, me ha funcionado pero ahora tengo otro problema , cuando ejecuto mi ALV por la primera vez , el programa funciona bien y el metodo CHECK_CHANGED_DATA toma los registros modificados, pero cuando hago 'BACK' para volver ejecutar el programa una segunda vez el metodo no detecta los cambios como en la primera vez.

          alguna idea??

          Gracias de antemano.
          Saludos.

          Comentario

          • DavidXD_XD
            Moderator
            • ago
            • 1255

            #6
            Hola, para que cualquier cambio en la celda quede grabado coloca estos eventos justo al momento de instanciar tu grid

            Código:
            [COLOR="Blue"]* Mostrando el Reporte[/COLOR]
                CALL METHOD o_grid->set_table_for_first_display
                    EXPORTING
                        i_save               = 'A'
                        is_layout            = gs_layout
                        it_toolbar_excluding = gt_exclude
                    CHANGING
                        it_outtab            = it_necesidad[]
                        it_fieldcatalog      = gt_fieldcat[]
                        it_sort              = it_sort.
            
                CALL METHOD o_grid->register_edit_event
                  EXPORTING
                    i_event_id = cl_gui_alv_grid=>mc_evt_modified.
            
                CALL METHOD o_grid->register_edit_event
                  EXPORTING
                    i_event_id = cl_gui_alv_grid=>mc_evt_enter.
            Con esos eventos cualquier accion fuera de la celda apuntara al handle_data_changed, incluso cuando le vas a dar el boton de grabar, espero te pueda servir
            David Carballido Córdova

            Comentario

            Trabajando...