Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV data doesn't get refresh

former_member295881
Contributor
0 Likes
2,650

Hello Experts,

I'm working with ALV and trying to refresh data with new values. Following is my code but it doesn't refresh ALV table. If I'm making any mistake then can somebody please rectify it?

case r_ucomm.
     when '&IC1'.
       if rs_selfield-fieldname = 'ZRERATE'.
         read table lt_zrerate_hdr into lw_zrerate_hdr index rs_selfield-tabindex.
          if sy-subrc = 0.
             read table lt_zrerate_dtl into lw_zrerate_dtl
             with key invoice = lw_zrerate_hdr-vbeln
                      zrerate = lw_zrerate_hdr-zrerate.
             if sy-subrc = 0 and lw_zrerate_dtl-zvbeln_pr is not initial.
               set parameter id 'AUN' field lw_zrerate_dtl-zvbeln_pr.
               call transaction 'VA02' and skip first screen.
             endif.
         endif.
       endif.
   endcase.

     IF sy-subrc = 0.
         call function 'ZCED_RERATE_SHIPMENT_IDOCS'
           exporting
             vbeln                              = lw_zrerate_dtl-zvbeln_pr
*           EXCEPTION_MATNR                    =
          importing
            pe_idoc_number                      = gv_idoc_ship
            pe_error_prior_to_application       = gv_error_prior_to_app
          exceptions
            invalid_doc_number                  = 1
            no_entries_found                    = 2
            no_partners_found                   = 3
            others                              = 4.
             if sy-subrc = 0.
               lw_output-idocnum = gv_idoc_ship.    (
  lw_output is my table which I display in ALV and trying to update it's field   lw_output-idocnum with a                                                                         new value but it doesn't work ).
             endif.

       rs_selfield-refresh = 'X'.
       ENDIF.

Many thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,577

Hi.

Try to add this, i worked for me when refresh didnt want to work.

          rs_selfield-refresh    = 'X'.

          rs_selfield-col_stable = 'X'.

          rs_selfield-row_stable = 'X'.

also try this if that one doesnt work

  DATA : e_grid TYPE REF TO cl_gui_alv_grid.

  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

    IMPORTING

      e_grid = e_grid.

  CALL METHOD e_grid->check_changed_data.

  "update_alv_tab

  CALL METHOD e_grid->refresh_table_display.

and at the end, write the frist method inside a do 10 times.

Regards

Miguel

13 REPLIES 13
Read only

Former Member
0 Likes
2,578

Hi.

Try to add this, i worked for me when refresh didnt want to work.

          rs_selfield-refresh    = 'X'.

          rs_selfield-col_stable = 'X'.

          rs_selfield-row_stable = 'X'.

also try this if that one doesnt work

  DATA : e_grid TYPE REF TO cl_gui_alv_grid.

  CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

    IMPORTING

      e_grid = e_grid.

  CALL METHOD e_grid->check_changed_data.

  "update_alv_tab

  CALL METHOD e_grid->refresh_table_display.

and at the end, write the frist method inside a do 10 times.

Regards

Miguel

Read only

0 Likes
2,577

Thanks for your input Miguel. I've tried your suggestions but nothing works.

Read only

0 Likes
2,577

Have you tried calling CL_GUI_CFW=>FLUSH() after the refresh method ?.

Thanks,

Venkat.

Read only

0 Likes
2,577

Hi,

what is the table of the ALV, you said that it is "lw_output is my table which I display in ALV and trying to update it's field lw_output-idocnum with a new value but it doesn't work ".

need to be sth like this:

wa_output-idocnum = gv_idoc_ship.

modify lw_output from wa_output.

The problem is not in the refresh, it is on the update of the table.

Check whether the table gets update or not.

Regards

Miguel

Read only

0 Likes
2,577

Indeed I wasn't modifying table. Many thanks man.

Read only

Former Member
0 Likes
2,577

Did you tried like this?

CALL METHOD g_grid->refresh_table_display

     EXPORTING

       i_soft_refresh = 'X'.

I could able to refresh my ALV grid output like this.

Read only

former_member186413
Participant
0 Likes
2,577

Why you put "IF sy-subrc = 0" After the CASE statements, I think you should remove and try it agian.

Read only

Former Member
0 Likes
2,577

lw_output must be just the workarea. You must modify output table from this workarea.

Also put rs_selfied-refresh = 'X' outside endif statement.

Read only

0 Likes
2,577

Hi,

   You can also try submit report ..... with .... and return.  in your ucomm for your refresh button.

Regards,

Madhumahesh.

Read only

0 Likes
2,577

VA02 is a SAP program not a report. You can't use submit statment.

Read only

Former Member
0 Likes
2,577

Hello Cool,

add append or modify  statement based on ur  requirement 

if sy-subrc eq 0.

lw_output-idocnum = gv_idoc_ship.

append    or modify
  endif.

       rs_selfield-refresh = 'X'.
       ENDIF.

Read only

Former Member
0 Likes
2,577

Dear Zero ,

You output internal table used for Grid Display will be refreshed with the Data which you require.

In order to refresh the data in front end of Grid display.

Try calling the Function Module REUSE_ALV_GRID_DISPLAY once again the user command form routine

As you mentioned in your query

case r_ucomm.

when '&IC1'

call transaction .....

**call this Function Module

REUSE_ALV_GRID_DISPLAY

endcase

I hope the above mentioned will be helpful for you.

Thanks.

With Regards,

Sudhir S

Read only

Former Member
0 Likes
2,577

Hi,

Try with SALV . You can find sample reports in se84 with title LC10BLISALVI* .

WBR/shakti