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
863

Hello experts,

I have some problem in ALV programming. I have 3 columns in my alv grid .

I am displaying sum of first 2 cols in 3rd col .

After displaying alv grid , when i change entry in 1st col. or/and 2nd col and give a tab (now the cursor is in 3rd col) ,after this tab i want alv to display changed result in 3rd col.

Is there any event for this if yes how to use it?

thank you

Kirti

Hello experts,

I have some problem in ALV programming. I have 3 columns in my alv grid .

I am displaying sum of first 2 cols in 3rd col .

After displaying alv grid , when i change entry in 1st col. or/and 2nd col and give a tab (now the cursor is in 3rd col) ,after this tab i want alv to display changed result in 3rd col.

Is there any event for this if yes how to use it?

thank you

Kirti

7 REPLIES 7
Read only

Former Member
0 Likes
841

Hi,

Try using the method REFRESH_TABLE_DISPLAY of the class CL_GUI_ALV_GRID.

Hope this works.

Regards,

Mansi.

Read only

0 Likes
841

Hi,

Actually i tried refresh_table_display method in data_changed_finish event of cl_gui_alv_grid but in this case on every tab click cursor goes to initial position(bcause of refreshing of table)

Could plz tell me where exactly to call this method i mean to say on which event?

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
841

Check method: SAVE_DATA and then REFRESH_TABLE_DISPLAY

Read only

Former Member
0 Likes
841

Pass i_callback_user_command to REUSE_ALV_GRID_DISPLAY and there write the code using rs_selfield-value. and call the GRID again. so that it can be refreshed.

Regards,

Ajay

Read only

Former Member
0 Likes
841

Hi,

Check this event HANDLE_DATA_CHANGED

Read only

Former Member
0 Likes
841

Dear Kirty,

Use this Function Module RS_REFRESH_FROM_SELECTOPTIONS

Cheers

Fareed

Read only

Former Member
0 Likes
841

Hi,

Are you pressing any button to calculate the total?

Incase yes then call REFRESH_TABLE_DISPLAY in the PBO.

Incase you want that the total to be displayed the moment the user moves from one cell to another then,

you will have to register the data changed event and in the handler method modify the cell value using

CALL METHOD er_data_changed->modify_cell and then refresh the grid using

CALL METHOD sender->refresh_table_display

When you are handling the event data_changed OF cl_gui_alv_grid there is a parameter sender which is returned. This basically points to the grid which caused this event.

So you can make use of that.

For example

METHODS y_m_handle_tab_movement_of cell

FOR EVENT data_changed OF cl_gui_alv_grid

IMPORTING er_data_changed

e_onf4

e_onf4_before

e_onf4_after

e_ucomm

sender.

I have created a handler method y_m_handle_tab_movement_of cell

which will be called whenever one moves from one cell to another.

In this method i will make use of

CALL METHOD er_data_changed->modify_cell to basically change the data of any other cell

say the sum cell and after that call

CALL METHOD sender->refresh_table_display

EXCEPTIONS

finished = 1

OTHERS = 2.

to refresh my main grid.

I hope this helps you.

Regards,

Ankur Parab