2006 Feb 07 12:19 PM
hello,
I need to create a title in my alv display eg subject,is my main heading in the alv display and maths and science are the subtitle under subject.
how do i show this kind of layout using an ALV grid.
-
subject
-
maths |science
this is the display i need to show in an ALV display..
Thanks and regards.
2006 Feb 07 12:41 PM
Hi,
i have attched extract.Hope this will be helpful.
type-pools:slis.
data:g_fieldcat type slis_t_fieldcat_alv.
data:g_repid like sy-repid.
g_repid = sy-repid.
form fill_fieldcat using g1_fieldcat type slis_t_fieldcat_alv.
data:s_g_fieldcat type slis_fieldcat_alv.
data:col type i value 1.
s_g_fieldcat-tabname = itab.
s_g_fieldcat-seltext_m = 'maths'.
s_g_fieldcat-col_pos = col.
col = col + 1.
append s_g_fieldcat to g1_fieldcat.
clear s_g_fieldcat.
s_g_fieldcat-tabname = itab.
s_g_fieldcat-seltext_m = 'science'.
s_g_fieldcat-col_pos = col.
col = col + 1.
append s_g_fieldcat to g1_fieldcat.
clear s_g_fieldcat.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = g_repid
i_internal_tabname = itab1
changing
ct_fieldcat = g1_fieldcat.
endform.
form grid_display.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = 'G_REPID'
it_fieldcat = g_fieldcat[]
tables
t_outtab = itab
exceptions
program_error = 1
others = 2.
Regards,
sunil.
hello,
I need to create a title in my alv display eg subject,is my main heading in the alv display and maths and science are the subtitle under subject.
how do i show this kind of layout using an ALV grid.
-
subject
-
maths |science
this is the display i need to show in an ALV display..
Thanks and regards.
2006 Feb 07 12:40 PM
2006 Feb 07 12:41 PM
Hi,
i have attched extract.Hope this will be helpful.
type-pools:slis.
data:g_fieldcat type slis_t_fieldcat_alv.
data:g_repid like sy-repid.
g_repid = sy-repid.
form fill_fieldcat using g1_fieldcat type slis_t_fieldcat_alv.
data:s_g_fieldcat type slis_fieldcat_alv.
data:col type i value 1.
s_g_fieldcat-tabname = itab.
s_g_fieldcat-seltext_m = 'maths'.
s_g_fieldcat-col_pos = col.
col = col + 1.
append s_g_fieldcat to g1_fieldcat.
clear s_g_fieldcat.
s_g_fieldcat-tabname = itab.
s_g_fieldcat-seltext_m = 'science'.
s_g_fieldcat-col_pos = col.
col = col + 1.
append s_g_fieldcat to g1_fieldcat.
clear s_g_fieldcat.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = g_repid
i_internal_tabname = itab1
changing
ct_fieldcat = g1_fieldcat.
endform.
form grid_display.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = 'G_REPID'
it_fieldcat = g_fieldcat[]
tables
t_outtab = itab
exceptions
program_error = 1
others = 2.
Regards,
sunil.
2006 Feb 07 12:50 PM
Hi,
While preparing the field catalog using the following assignment for every column,
field_cat type slis_fieldcat_alv,
field_cat-seltext_m = 'Maths' / 'Science'.
Regs,
Venkat Ramanan
2006 Feb 07 12:52 PM
Hi,
Look at the sample code............
**************
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = i_repid
i_callback_user_command = 'USER_COMMAND_PERNR'
it_fieldcat = header
is_layout = gt_layout
i_callback_top_of_page = 'TOP-OF-PAGE1'
i_grid_title = text-t06<<<<<<<<---Main Title******
it_sort = gt_sort[]
i_default = 'X'
i_save = 'U'
is_variant = gt_variant
it_events = gt_events
TABLES
t_outtab = ITAB.
clear itab.
endif.
----
Form TOP-OF-PAGE1
----
form top-of-page1.
data: header type slis_t_listheader,
wa type slis_listheader. "infield like wa-info, nline type n.
TITLE AREA
wa-typ = 'S'.
wa-info = text-t04." Report Description
append wa to header.
wa-typ = 'S'.
write sy-datum to wa-info MM/DD/YYYY.
concatenate text-t03 wa-info into wa-info separated by space.
append wa to header."Current Date
wa-typ = 'S'.
concatenate text-t02 sy-UNAME into wa-info separated by space.
append wa to header." User Name
wa-typ = 'S'.
concatenate text-t01 sy-repid into wa-info separated by space.
append wa to header."Report Name
***********"LOGO IN TOP OF PAGE
call function 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = header
i_logo = 'ENJOYSAP_LOGO1'.
endform.
Thanks.
If this helps you reward with points.
Message was edited by: KDeepak
2006 Feb 07 12:57 PM
Hi,
you can try with the option window_title of layout.
LS_LAYOUT-WINDOW_TITLEBAR = 'test window'.
but this will change the window title, it is similar to title bar ,
is this you are expecting or some thing else.
you can use top_of_page also to print the subject .
if it is normal alv report then you can use write statements.
but if it is grid then you can use comentry write fm to write the subject or what ever.
regards
vijay
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |