Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV Display

Former Member
0 Likes
757

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
733

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.

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.

5 REPLIES 5
Read only

Former Member
0 Likes
733

hi Arup,

checkout the links..,

hope it helps..,

regards,

Vinoth

Read only

Former Member
0 Likes
734

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.

Read only

Former Member
0 Likes
733

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

Read only

Former Member
0 Likes
733

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

Read only

Former Member
0 Likes
733

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