Skip to Content
author's profile photo Former Member
Former Member

How to control the visibility of column in ALV

Hi,Expert,

I'm using class CL_GUI_ALV_GRID to dispaly informations,but I want to hide

some columns using code,how could I achieve that?

Thanks a lot

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 02:02 PM

    Hi Ray,

    Try searching the ABAP-General forum - there is lots of information in there about how to hide columns in ALV's.

    Gareth.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      There's also plenty of ALV samples in the UI Programming & OO forums - plus SAP's sample programs that typically are called names like BALV and SALV - I find "BCALV_TEST_GRID" is always a good one to start with as it demos more ffeatures... you could also search for "no_out" and "Field catalog".

      Jonathan

  • Posted on Nov 23, 2007 at 03:28 AM

    Hi Ray,

    Herewith a portion of sample code to hide the columns.

    DATA : wa_fieldcat_alv TYPE LINE OF lvc_t_fcat ,

    it_fieldcat_alv TYPE lvc_t_fcat .

    • Create ALV Field Catalog utk Header

    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

    EXPORTING

    i_structure_name = 'ZP119H'

    CHANGING

    ct_fieldcat = it_fieldcat_alv[].

    LOOP AT it_fieldcat_alv[] INTO wa_fieldcat_alv.

    CASE wa_fieldcat_alv-fieldname .

    WHEN 'HIDE1'.

    wa_fieldcat_alv-no_out = 'X'.

    WHEN 'HIDE2'.

    wa_fieldcat_alv-no_out = 'X'.

    WHEN 'HIDE3'.

    wa_fieldcat_alv-no_out = 'X'.

    ENDCASE.

    MODIFY it_fieldcat_alv FROM wa_fieldcat_alv.

    ENDLOOP.

    Rgds,

    TS WINEDYA

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2007 at 06:15 AM

    Hi,all

    Thank you very much.

    Add a comment
    10|10000 characters needed characters exceeded

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.