Skip to Content
author's profile photo
Former Member

Problem with ALV using classes

Dear all,

I am facing a strange problem with ALV grid.

I am using the method set_table_for_first_display of class cl_gui_alv_grid.

For Layout I am using FM 'LVC_FIELDCATALOG_MERGE'.

In the output all the fields are displayed in blue colour. I am not modifying the field catalogue.

One more strange thing I observed is if I dont pass variant to the method set_table_for_first_display, the output is fine (all the columns are in white colour).

Now I want all the fields in white colour when i pass variant.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
      i_structure_name       = 'ZC9_TWS_DEV_OUTPUT'
      i_bypassing_buffer     = 'X'
    CHANGING
      ct_fieldcat            = gs_fieldcat
    EXCEPTIONS
      inconsistent_interface = 0
      program_error          = 0
      OTHERS                 = 0.

CALL METHOD go_grid_1->set_table_for_first_display
    EXPORTING
      is_layout       = gs_layout
      is_variant      = gv_variant
      i_save          = 'A'
      i_default       = 'X'
    CHANGING
      it_fieldcatalog = gs_fieldcat
      it_outtab       = gt_output.

Could you please help me

Thanks in advance

Edited by: Aravind Kanaparthi on May 6, 2011 11:58 AM

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Posted on May 06, 2011 at 11:47 AM

    Is possible that you are passing fields property in fieldcatalog, setting "KEY" = true?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Spantaleoni ,

      Thanks for your reply.

      As you said I was setting the key field and then removed it. But that field layout is saved and every time that layout was being called.So, All the columns are in blue colour even the key field is space

      I have deleted the default layout. Now its fine.

      Thanks once again

  • author's profile photo
    Former Member
    Posted on May 06, 2011 at 12:25 PM

    Solved by myself

    Add comment
    10|10000 characters needed characters exceeded