2007 Nov 22 8:18 AM
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
2007 Nov 22 2: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.
2007 Nov 22 2: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.
2007 Nov 23 2:56 AM
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
2007 Nov 23 3: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
2007 Nov 23 6:15 AM