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 screen refresh

Former Member
0 Likes
1,096

Friends :

ALV refresh screen is not happening.

I have 2 alv screens . from l one screen I post 2 materials , I get 2 errors on 2nd screen in terms of log.when I go back & post single material this time, I still get the 2 materials on the log screen, actually the internal table contains only one material when 2nd time the alv list is called.

It means that it is not removing from control.

Any idea how can we eliminate the error.

Regards

Prashant

1 ACCEPTED SOLUTION
Read only

settipalli_raj
Explorer
0 Likes
939

If you are using ALV class object try calling this method

CALL METHOD obj_ALV_grid->refresh_table_display

where obj_ALV_grid is an instance of class cl_gui_alv_grid.

Hope this helps.

Raj

9 REPLIES 9
Read only

Former Member
0 Likes
939

Are you using class based ALV or REUSE FM's ?

Read only

settipalli_raj
Explorer
0 Likes
940

If you are using ALV class object try calling this method

CALL METHOD obj_ALV_grid->refresh_table_display

where obj_ALV_grid is an instance of class cl_gui_alv_grid.

Hope this helps.

Raj

Read only

0 Likes
939

Hi,

If you are using REUSE


    call function 'REUSE_ALV_GRID_DISPLAY'
      exporting
        it_fieldcat                 = pt_grpfcat[]
        it_excluding                = p_grpexcltab2[]
        is_layout                   = pt_grplayout2
        i_callback_program          = sy-repid
        i_callback_html_top_of_page = p_header
        i_callback_pf_status_set    = v_status_set1
        i_callback_user_command     = f_user_command1
        i_screen_start_column       = 25
        i_screen_start_line         = 5
        i_screen_end_column         = 80
        i_screen_end_line           = 20
        it_events                   = i_events[]
      tables
        t_outtab                    = i_grpoutput.
  else.
    message i367(yscc) with v_plgrp..
  endif.
endform.                                 " F_f4_help_fieldname
*
*&---------------------------------------------------------------------*
* Form  f_user_command1                                                *
*&---------------------------------------------------------------------*
* This form will handle the user command from fm REUSE                 *
*----------------------------------------------------------------------*
form f_user_command1 using p_ucomm type sy-ucomm
                     rs_selfield type  slis_selfield.

  data p_ref1 type ref to cl_gui_alv_grid.
  call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    importing
      e_grid = p_ref1.
  call method p_ref1->check_changed_data.
  case p_ucomm.
    when 'BACK'.
      leave to screen 0.
  endcase.
  rs_selfield-refresh = c_x.             " Grid refresh

endform.                                 " F_user_command1


a®

Read only

Former Member
0 Likes
939

If u r using Reuse FM's then in user_command form try this,

P_SELFLD-REFRESH = 'X'.

Reward if useful.

Read only

Former Member
0 Likes
939

I am using Class method , the table refresh method is also not giving any help here.

Read only

0 Likes
939

Hi,

Use the following in your user command PAI as first statement , system automatically fills the changed entries into your output tab.


  call method g_grid->check_changed_data
    importing
      e_valid = v_valid.

aRs

Read only

Former Member
0 Likes
939

I want to refresh the control , but ALV refresh is not working,

I used different referenace object & different container also.

Read only

0 Likes
939

Hi,

After the method i mentioned in my previous thread. then call method Refresh_table_display in the PBO.

aRs

Read only

Former Member
0 Likes
939

Thanks everybody.Finally it worked.

if gv_grid_data_log is initial.

CREATE OBJECT gv_grid_data_log

EXPORTING i_parent = gv_container_d0011.

PERFORM prepare_field_catalog :

USING 'ZRECID' 'Record ID'(s01) space 10 0,

USING 'MBLNR' 'Material Document'(s26) space 15 0,

USING 'TYPE' 'Message'(s27) space 4 0,

USING 'MESSAGE' 'Message Text'(s28) space 20 0.

CALL METHOD gv_grid_data_log->set_table_for_first_display

EXPORTING

is_layout = gs_layout

i_default = 'X'

CHANGING

it_outtab = gt_error_data[]

it_fieldcatalog = gt_fldcat[].

REFRESH : gt_error_data.

else.

call method gv_grid_data_log->refresh_table_display.

endif.

solution is You don't have to call the set_table_for_first_display again, on 2nd time

just call refresh_table_display. I put the If /else condition & it worked.

Thanks to everybody who spent some time for me.