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

Refreshing the ALV Grid second time

Former Member
0 Likes
2,212

Hi expert,

I have two alv in seperate Subscreen. 1st Subscreen is having the header detail, when i select one or more row and click toolbar button , it is populating the detail data of the selected row in the second ALV. But after displaying, when I select some other row from the header detail and again click the same toolbar button, it is not refreshing the detail list.

What might be the problem?

Regards,

Kapil.

9 REPLIES 9
Read only

Former Member
0 Likes
1,456

Hi Kapil,

Did you check whether you refreshed the internal table of the ALV in the second sub screen each time after clicking that button ?

MODULE user_command_9000 INPUT.

code = okcode.
clear okcode.
case  code.
when 'BUTTON'.
refresh alv_itab.
perform detail_fetch.
end case.

end module.

Hope this is helpful.

Cheers,

Vivek.

Read only

0 Likes
1,456

Hi Vivek,

Yes , I am refreshing the Internal table i have check that. I found that Second time when i click that button . I am not getting row index of the selected row from the get selected method of the alv grid class.

Regards,

Kapil

Read only

0 Likes
1,456

Hi Kapil,

I think, you have not called the method flush.

Try doing this after getting the selected rows index and displaying the ALV.

 CALL METHOD cl_gui_cfw=>flush.

Hope this is helpful.

Cheers,

Vivek.

Read only

Kiran_Valluru
Active Contributor
0 Likes
1,456

Hi Kapil.,

I think u r not refreshing table display correctly.. pls check BCALV_GRID_05 Report .. hope this ll solve your issue..

Revert if u need some more clarifications.,

Thanks & Regards,

Kiran

Read only

0 Likes
1,456

Hi Kiran,

I am refreshing the internal table, second time i am getting empty Alv because while getting the selected row from the header ALV, i am not getting any row indexes.

Regards,

Kapil.

Read only

0 Likes
1,456

Hi Kapil ,

As I suggested pls check BCALV_GRID_05 report.. u compare ur report and this.. then u can surely solve ur issue..

Thanks & Regards

Kiran

Read only

0 Likes
1,456

>

> Hi Kiran,

>

> I am refreshing the internal table, second time i am getting empty Alv because while getting the selected row from the header ALV, i am not getting any row indexes.

>

> Regards,

> Kapil.

Try explicitly getting the row index with GET_CURRENT_CELL .

Regards

Marcin

Read only

ravi_lanjewar
Contributor
0 Likes
1,456

Hi,

I think you are using the Oop ALV.

If i am correct try the following solution.

Register any of the event CLICK_ROW_COL for header alv and check the rowid is same with previous one or not if not refresh the item data alv.

OR

Register event DELAYED_CHANGE_SELECTION ( i.e. Selection has been Modified) for header alv, If selection has modified then refresh the item data alv.

But without handdling the event it is not possible.

Kind Rgds

Read only

Former Member
0 Likes
1,456

Hi all,

Thanks for all your reply.. i have solved the problem. Actually, second time i was instantiating another alv grid instead of using the first instance. After correcting it is working fine.

Regards,

Kapil.