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 grid

Former Member
0 Likes
1,014

Is there any way to refresh ALV grid after executing native SQL, like this:

exec sql.

     update tbl1 set some_fld=<some value>

endexec.

<refresh ALV grid>.

ALV grid is showing table tbl1.

thanks in advance

Is there any way to refresh ALV grid after executing native SQL, like this:

exec sql.

     update tbl1 set some_fld=<some value>

endexec.

<refresh ALV grid>.

ALV grid is showing table tbl1.

thanks in advance

7 REPLIES 7
Read only

former_member202818
Active Contributor
0 Likes
974

Hi,

CALL METHOD gr_alvgrid->refresh_table_display

* EXPORTING

* IS_STABLE =

* I_SOFT_REFRESH =

EXCEPTIONS

finished = 1

OTHERS = 2 .

IF sy-subrc <> 0.

*--Exception handling

ENDIF.

Parameter Meaning

IS_STABLE

If the row or column field of this structure is set, the position of the scroll bar for the rows or columns remains stable.

I_SOFT_REFRESH

This parameter is used only in exceptional cases. If you set this parameter, any totals created, any sort order defined and any filters set for the data displayed remain unchanged when the grid control is refreshed. This makes sense, for example, if you have not modified the data of the data table and want to refresh the grid control only with regard to layout or field catalog changes.

Regards

Sreekanth

Read only

0 Likes
974

Thanks you for your answer.

But unfortunately this does not work in my case. I have a main program where the data loads in ALV gris in Screen 0100 (see main.txt). Then, in USER_COMMAND_0100 input on TEST button of screen 0100 i have:


module USER_COMMAND_0100 input.

   case OK_CODE.
     when 'TEST'.
       exec sql.
         update  "/DURS/OOOP_PORO"
         set     FLD1=22.
       endexec.

       CALL METHOD GRID->refresh_table_display
*       EXPORTING
*         IS_STABLE =
*         I_SOFT_REFRESH =
       EXCEPTIONS
         finished = 1
       OTHERS = 2 .

       IF sy-subrc <> 0.
*      --Exception handling
       ENDIF.

     when 'EXIT'.
       leave program.
   endcase.

endmodule.


I believe the problem is in native sql and SAP does not refresh data of table which is a part of data dictionary, but used in native sql. Is there any way to do it ?


regards


Miran

Read only

0 Likes
974

Aha, now I see - I must reload data to see the changes.

regards

Miran

Read only

0 Likes
974

Hi,


The same thing also true for open SQL .

There is no automatic binding between the SQL results and the presentation  .

Welcome to wonderful world of ABAP......


Regards.

Read only

0 Likes
974

Thank you for your answer.

Database without query performing in 21. century, eh

Read only

0 Likes
974

Hi,

If you are interested in native sql then check this article:

Regards.

Read only

0 Likes
974

Thanks.