0% found this document useful (0 votes)
155 views2 pages

Changing Font Style in ALV

By using the Function Module REUSE_ALV_GRID_DISPLAY_LVC, the font style can be changed in ALV reports by modifying the style field of the internal table for field catalog information. The example code selects flight data, gets the field catalog, then loops through the catalog to set the font style to italic for fields after index 4 and bold for other fields before displaying the ALV report.

Uploaded by

assign79
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
155 views2 pages

Changing Font Style in ALV

By using the Function Module REUSE_ALV_GRID_DISPLAY_LVC, the font style can be changed in ALV reports by modifying the style field of the internal table for field catalog information. The example code selects flight data, gets the field catalog, then loops through the catalog to set the font style to italic for fields after index 4 and bold for other fields before displaying the ALV report.

Uploaded by

assign79
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Changing Font style in ALV

By Joyjit Ghosh, IBM India

By using the Function Module REUSE_ALV_GRID_DISPLAY_LVC we can change the font style in ALV
report. 

Example:

*&---------------------------------------------------------------------
*& Report Z_DEMO_ALV_JG
*&---------------------------------------------------------------------
REPORT z_demo_alv_jg .
* Include for all style values
INCLUDE <cl_alv_control>.
* Internal table for final output data
DATA: i_flight TYPE STANDARD TABLE OF sflight.
* Internal table for field catalog info
DATA: i_fields TYPE lvc_t_fcat.
* Field symbol for field catalog
FIELD-SYMBOLS: <wa_fields> TYPE lvc_s_fcat.
* Select data
SELECT * FROM sflight
INTO TABLE i_flight
UP TO 100 ROWS.
IF sy-subrc = 0.
* Get field catalog
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'SFLIGHT'
CHANGING
ct_fieldcat = i_fields
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
.
IF sy-subrc = 0.
* Changing the style of field catalog
LOOP AT i_fields ASSIGNING <wa_fields>.
IF sy-tabix > 4.
<wa_fields>-style = ALV_STYLE_FONT_ITALIC.
ELSE.
<wa_fields>-style = ALV_STYLE_FONT_BOLD.
ENDIF.
ENDLOOP.
ENDIF.
* Calling the FM to display ALV report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_structure_name = 'SFLIGHT'
i_grid_title = 'Style demo'(001)
it_fieldcat_lvc = i_fields
TABLES
t_outtab = i_flight
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
Output:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy