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

Problem in Alv grid container report

Former Member
0 Likes
1,756

Hi All,

I am displaying report using ALV grid container.Included pushbutton in alv report tool bar.Displaying any one of the row in next screen by selecting one row in alv report and clicking on pushbutton.When i save the displayed entry in second alv screen updating correctly in databse table.upto here working fine.

My problem is, i am coming back to initial alv screen then selecting any other row from the report, again clicking the push button to display the current selected row in the next screen as displayed above.But second selected row is not appearing in the second screen instead it is displaying the same entry which was saved first time.

I have checked in the degugging that i can see the second entry picking up correctly to the final internal table of second alv screen.but it's not displaying in the reort.Displaying the old saved entry only.

One more thing is without saving the entry in second screen i can able to display any entry by selecting the entry in the initial alv report.

I am wondering why it's not displaying the entry in second screen eventhough it's picking the correct entry till alv display of second screen.In output not showing that entry.showing only that old entry.

I need your expert opinion to solve this problem.

Hari..

Edited by: Rob Burbank on Sep 27, 2010 2:23 PM

Hi All,

I am displaying report using ALV grid container.Included pushbutton in alv report tool bar.Displaying any one of the row in next screen by selecting one row in alv report and clicking on pushbutton.When i save the displayed entry in second alv screen updating correctly in databse table.upto here working fine.

My problem is, i am coming back to initial alv screen then selecting any other row from the report, again clicking the push button to display the current selected row in the next screen as displayed above.But second selected row is not appearing in the second screen instead it is displaying the same entry which was saved first time.

I have checked in the degugging that i can see the second entry picking up correctly to the final internal table of second alv screen.but it's not displaying in the reort.Displaying the old saved entry only.

One more thing is without saving the entry in second screen i can able to display any entry by selecting the entry in the initial alv report.

I am wondering why it's not displaying the entry in second screen eventhough it's picking the correct entry till alv display of second screen.In output not showing that entry.showing only that old entry.

I need your expert opinion to solve this problem.

Hari..

Edited by: Rob Burbank on Sep 27, 2010 2:23 PM

7 REPLIES 7
Read only

alex_cook
Active Participant
0 Likes
1,378

Hiowdy,

Try refreshing the alv grid in your second screen when you navigate between screens:



    go_grid->refresh_table_display( ).

Cheers

Alex

Read only

Former Member
0 Likes
1,378

Hi Alex,

I have already used as below.but it's not working.

CALL METHOD o_grid->set_table_for_first_display

EXPORTING

is_variant = gs_variant

i_save = 'A'

i_default = 'X'

it_toolbar_excluding = i_exclude

is_layout = wa_layout

CHANGING

it_fieldcatalog = i_fieldcat

it_outtab = <i_final_act>.

*Refreshing ALV Grid display

CALL METHOD o_grid->refresh_table_display

EXPORTING

i_soft_refresh = 'X'

EXCEPTIONS

finished = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • --Exception handling

ENDIF.

Read only

Former Member
0 Likes
1,378

Hi

Try this.

if o_grid is initial.

create object <container>

exporting

container_name = 'container1'.

create object o_grid

exporting

i_parent = container_name.

perform fieldcatalog.

CALL METHOD o_grid->set_table_for_first_display

EXPORTING

is_variant = gs_variant

i_save = 'A'

i_default = 'X'

it_toolbar_excluding = i_exclude

is_layout = wa_layout

CHANGING

it_fieldcatalog = i_fieldcat[]

it_outtab = i_final_act[].

( after that I think you need to call the method for selecting rows.

like what I did in my code is below:

create object event.

set handler event->handle_double_click for o_grid.

else.

call method o_grid->refresh_table_display. )

*Refreshing ALV Grid display

CALL METHOD o_grid->refresh_table_display

EXPORTING

i_soft_refresh = 'X'

EXCEPTIONS

finished = 1

OTHERS = 2.

IF sy-subrc 0.

  • --Exception handling

ENDIF.

endif.

In this code if your o_grid is intial then it will process all the coding before refresh method else if your o_grid is not intial it will refresh the table which is going to be displayed.

I hope this will work for you

Thanks

Lalit Guptaa

Read only

Former Member
0 Likes
1,378

Hi lalit,

i don't understand your solution..

Can you explain elborate solution.

harii...

Read only

Former Member
0 Likes
1,378

Hi Srihari,

On your back button just use method REFRESH_TABLE_DISPLAY of class CL_GUI_ALV_GRID,

this will solve, also check tht the previous line is not selected when you are pushing the button

Thanks,

Anmol.

Read only

0 Likes
1,378

Hellow freinds,

I am also have same issue i make one GUI status , the process of screen as follow

Screen 100 -


> this User Slection screen, Here user start to make input and one Push button 'Display" when user click this Display the Programme Goes to Screen--101

Screen 101------> this is the result screen here ALV grid Display shows the result,

Now user click the Back Button (Standard Tool Bar) , then he see the first screen means screen 100 (Input screen)

Now user changes the value and again click Display for result ,so the problem is User can not see the correct result after pressing back , ALV shows the old result below is my code where i exporting the filed catalog.


 PERFORM get_fieldcatalog.

  CALL METHOD alv_grid->set_table_for_first_display
    EXPORTING
      is_layout        = layout
      is_variant       = variant
      i_save           = 'U'
      i_structure_name = 'I_ALV2'

    CHANGING

      it_outtab        = i_alv2[]
      it_fieldcatalog  = fieldcat[].

Plz give me some suggestion how to solve this issue.

Edited by: Neha.Servade on Dec 18, 2011 2:37 PM

Read only

Former Member
0 Likes
1,378

Hi srihari,

If you want to refresh the ALV container use this code.

DATA : CONT type ref to cl_gui_alv_grid.

IF NOT CONT IS INITIAL.

CALL METHOD CONT->FREE.

CLEAR: CONT.

ENDIF.

CREATE OBJECT CONT

EXPORTING

CONTAINER_NAME = 'CONTAINER'.

CREATE OBJECT GRID

EXPORTING

I_PARENT = CONT.

CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY

CHANGING

IT_OUTTAB = IT_KNA1

IT_FIELDCATALOG = IT_FCAT.

Place the above code before calling the screen 101 from 100.

Hope this is useful.

Regards,

G.Aditya