Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Hiding some columns with REUSE_ALV_FIELDCATALOG_MERGE

Hi Friends,

I'm using REUSE_ALV_FIELDCATALOG_MERGE to get the field catalog and looping on field_cat to customize the names of columns in report ...

Now I want to hide some of the columns depending on some input parameter.. How do i do it?

Here's is what im doing rite now...

How do i hide column dealercode??

loop at it_fieldcat into wa_fieldcat.

if wa_fieldcat-fieldname = 'UPLOAD_DATE'.

move 'Upload Date' to wa_fieldcat-seltext_l.

move 'Up Date' to wa_fieldcat-seltext_m.

move 'UpDate' to wa_fieldcat-seltext_s.

elseif wa_fieldcat-fieldname = 'TRANSACTIONID'.

move 'Trans.Id' to wa_fieldcat-seltext_l.

move 'TranId' to wa_fieldcat-seltext_m.

move 'Tr.Id' to wa_fieldcat-seltext_s.

elseif wa_fieldcat-fieldname = 'DEALERCODE'.

move 'DealerCode' to wa_fieldcat-seltext_l.

move 'Dlr CC' to wa_fieldcat-seltext_m.

move 'Dlr.CC' to wa_fieldcat-seltext_s.

elseif wa_fieldcat-fieldname = 'DEALERNAME'.

move 'Dealer Name' to wa_fieldcat-seltext_l.

move 'Dlr Name' to wa_fieldcat-seltext_m.

move 'Dealr' to wa_fieldcat-seltext_s.

endif.

endloop.

Pls suggest me solution..

Regards,

Amey

Tags:
Former Member replied

Hi,

if u use a work area u need to use modfiy it_fieldcat from wa_fieldcat.

TYPE-POOLS:slis.
field-symbols:<wa_fcat> type slis_fieldcat_alv.
DATA:it_fieldcat TYPE slis_t_fieldcat_alv.

LOOP AT it_fieldcat ASSIGNING <wa_fcat>.
  IF <wa_fcat>-fieldname =  'FIELD1'."ur field
    <wa_fcat>-no_out = 'X'."for hiding a column(here u dont need to have modify)
  ENDIF.
ENDLOOP.

rgds,

bharat.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question