Skip to Content
avatar image
Former Member

refresh in alv report

hi masters,

i m working on alv report where i have to change the data. after changing the data i have to do the refresh for that i m using the method below

wa_STBL-ROW = 'X'.

wa_STBL-COL = 'X'.

CALL METHOD grid_obj->refresh_table_display

EXPORTING

IS_STABLE = wa_stbl

I_SOFT_REFRESH = 'X '

EXCEPTIONS

finished = 1

OTHERS = 2.

but after executing this method its giving run time error saying that ' Access via 'NULL' object reference not possible. You attempted to use a 'NULL' object reference (points to 'nothing') access a component (variable: "GRID_OBJ").'. can u plz help me where i m going wrong. and how to implement the refresh in alv report in details..

thanks in advance.

regards,

vicky

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • May 15, 2009 at 07:04 AM

    According to this message, you have not created an instance of this object grid_obj. Upon displaying this ALV grid the first time, what variable have you used to instantiate the ALV object? This should be them same, so also grid_obj. After instantiating, you shouldn't not initialize it anymore during the run of the program.

    Add comment
    10|10000 characters needed characters exceeded

    • What method are you using to display the ALV grid in the first place? Looks to me that you are using

      'REUSE_ALV_GRID_DISPLAY' (procedural approach) and next the refresh method from the OO approach.

  • May 15, 2009 at 08:21 AM

    u can use REUSE_ALV_GRID_DISPLAY for this purpose

    just replace the existing ALV tool bar with the this by copying this

    program : SAPLKKBL

    status : STANDARD_FULLSCREEN

    this has the refresh button by default

    and copy to ur zprogram and its status

    now add extra buttons whatever u want

    cheers

    s.janagar

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi,

      when i clicked on refresh button it is going to pf-status after that as i shown in below code it goes to refresh_report. but in this 'form refresh_report' it won't display the data. it goes into the infinite loop. within that form- endform. plz can u give me solution for this problem?

      set pf-status 'STANDARD_FULLSCREEN'.

      case sy-ucomm.

      when '&REFRESH'.

      perform refresh_report.

      endcase.

      form refresh_report .

      perform build_fieldcatlog.

      perform event_call.

      perform populate_event.

      perform data_retrieval.

      perform build_listheader using it_listheader.

      perform display_alv_report_fm.

      endform. " REFRESH_REPORT

  • avatar image
    Former Member
    May 15, 2009 at 09:40 AM

    Hi,

    You can refresh the ALV if you have done it using classes & methods. This can be done by using the following two method by setting the two parameters in the layout as shown below.

    It will refresh the ALV screen with the updated values

    i_layout-sel_mode = 'D'.

    i_layout-cwidth_opt = 'X'.

    call method alv1->refresh_table_display.

    call method alv1->set_frontend_layout

    exporting is_layout = i_layout.

    Rgds,

    Sachin.

    Add comment
    10|10000 characters needed characters exceeded