Welcome To My BLOG

This site is to give a brief idea for the abap learners who are looking for some real time programs .It consists of collection of programs from my side . I hope these programs are very much used for all of the learners. Please check the links for any information in ABAP.
Please vote for my Blog. And please input me on this mail addrssess.Email me

Share this link with your friends

http://www.rebtel.com/u/15163104576

For every friend who signs up using this link and makes a payment, we'll give you 8 €!


Thursday, September 23, 2010

ALV with some columns in bold letters

REPORT z_demo_alv_jg .
* Include for all style values
INCLUDE .
* 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: 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 .
IF sy-tabix > 4.
-style = ALV_STYLE_FONT_ITALIC.
ELSE.
-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.

No comments: