10-29-2008 7:54 PM
Hi Experts,
Using ALV oops......I am using field catalog merge FM.
After using that how do I use color & sort options.
How to add colors to columns
How to sort columns
Thanks in advance.
Edited by moderator to more meaningful title
10-30-2008 4:32 AM
Hello
You can use field LVC_S_FCAT-EMPHASIZE (in the fieldcatalog) to colour your columns.
If you want to sort your column before the first display you can use parameter IT_SORT (LVC_T_SORT) of method SET_TABLE_FOR_FIRST_DISPLAY (cl_gui_alv_grid).
Further reading: [An Easy Reference For ALV Grid Control|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907]
Regards
Uwe
10-30-2008 5:25 AM
hi,
For colouring of coloumns, Append the field catlog like this.
wa_fieldcat-row_pos = 1.
wa_fieldcat-col_pos = 2.
wa_fieldcat-emphasize = 'C710'. * Green colour
append wa_fieldcat.
10-30-2008 12:46 PM
I cannot use that , because as I said I am using following FM to prepare field catalog.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
i_structure_name = 'ZSHHR207'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = it_fdcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
How do I use color and sort options ?
10-30-2008 7:51 PM
Hello Ravindar
Of course you can use the colouring options:
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
* I_BUFFER_ACTIVE =
i_structure_name = 'ZSHHR207'
* I_CLIENT_NEVER_DISPLAY = 'X'
* I_BYPASSING_BUFFER =
* I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = it_fdcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
DATA: ls_fcat TYPE lvc_s_fcat.
LOOP AT it_fdcat INTO ls_fcat.
CASE ls_fcat-fieldname.
WHEN '...'.
ls_fcat-emphasize = 'C410'.
WHEN '...'.
ls_fcat-emphasize = 'C600'.
WHEN OTHERS.
CONTINUE.
ENDCASE.
MODIFY it_fdcat FROM ls_fcat INDEX syst-tabix.
ENDLOOP.
Regards
Uwe
10-31-2008 6:25 AM
06-08-2009 8:16 AM