Skip to Content

ALV get_frontend_fieldcatalog and set_frontend_fieldcatalog not working

Hi all Gurus,

I have devoloped an ALV report (Using cl_gui_alv_grid & cl_gui_custom_container), after the grid is displayed using set_table_for_first_display method when user clicks "Back" button, I call below methods.


case 'SY-UCOMM'


DATA : t_filedcat TYPE lvc_t_fcat,
       wa_filedcat TYPE lvc_s_fcat.

      CALL METHOD obj_alv_grid->get_frontend_fieldcatalog
          et_fieldcatalog = t_filedcat[].

      LOOP AT t_filedcat INTO wa_filedcat .
        IF wa_filedcat-fieldname = 'POSID' .
          wa_filedcat-edit = 'X' .
          MODIFY t_filedcat FROM wa_filedcat .
        ENDIF .
      ENDLOOP .

      CALL METHOD obj_alv_grid->set_frontend_fieldcatalog
          it_fieldcatalog = t_filedcat[].

CALL SCREEN 9001.    " same screen which ALV initially displayed


t_filedcat modifies accordingly. But Edit mode doesn't work. need your advice.

Thank you all in advance..

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 24, 2011 at 07:59 AM


    > t_filedcat modifies accordingly. But Edit mode doesn't work. need your advice.

    You mean the field catalog of your report is not updated? You should use REFRESH_TABLE_DISPLAY of CL_GUI_ALV_GRID to refresh the list.

    Hope this helps.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member T Fdo

      Have you wrote the code in PAI of screen 9001?

      write the below code in PAI of screen 9001 and no need to call screen 9001 again.

      case sy-ucomm.

      when 'BACK'.*

      CALL METHOD us_alvgrid->get_frontend_fieldcatalog


      et_fieldcatalog = is_fieldcat.

      LOOP AT is_fieldcat INTO e_fieldcat .

      IF e_fieldcat-fieldname = 'TEST'' .

      e_fieldcat-edit = 'X' .

      MODIFY is_fieldcat FROM e_fieldcat .

      ENDIF .

      ENDLOOP .

      CALL METHOD us_alvgrid->set_frontend_fieldcatalog


      it_fieldcatalog = is_fieldcat[].

      if us_alvgrid is not initial.

      CALL METHOD us_alvgrid->refresh_table_display


      finished = 1

      OTHERS = 2.


      call method set_table for first display after creating the object of ALV grid.



      hope this will help.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.