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

balaji_viswanath
Participant
0 Likes
560

Hi,

I want a header in ALV report, similar to given below...

-


Main Heading1 | Main Heading2

-


SubHead1 | SubHead2 | SubH3|SubHead1 | SubHead2 | SubH3|

-


Values | | | | |

-


I know how to print Subheadings and values (Usual one) but how to print the main headings? Is it possible to print ALV report similar to above using one table...

Can you please give your valuable inputs...

Advance thanks.

Regards,

Balaji Viswanath.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
436

Use Event Top of page in conjunction with REUSE_ALV_COMMENTARY_WRITE in your function module REUSE_ALV_GRID_DISPLAY or REUSE_ALV_LIST_DISPLAY

Regards,

Subramanian V.

4 REPLIES 4
Read only

Former Member
0 Likes
437

Use Event Top of page in conjunction with REUSE_ALV_COMMENTARY_WRITE in your function module REUSE_ALV_GRID_DISPLAY or REUSE_ALV_LIST_DISPLAY

Regards,

Subramanian V.

Read only

Former Member
0 Likes
436

Hi,

Have a look at this Sample Code,you will get some idea.

i_events type slis_t_event, "ALV EVENT WITH TABLE

wa_events like line of i_events,"ALV EVENT IN WORK AREA

i_header type slis_t_listheader,"ALV HEADER WITH TABLE

wa_header type slis_listheader. "ALV HEADER IN WORK AREA

call function 'REUSE_ALV_EVENTS_GET'

exporting

i_list_type = 0

importing

et_events = i_events

exceptions

list_type_wrong = 1

others = 2.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSiY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

read table i_events

with key name = slis_ev_top_of_page

into wa_events.

if sy-subrc = 0.

move 'TOP_OF_PAGE' to wa_events-form.

modify i_events from wa_events index sy-tabix.

endif.

form top_of_page.

clear wa_header.

wa_header-typ = 'H'.

wa_header-info = 'VENDOR REPORT - ALL PARTNERS'.

append wa_header to i_header.

clear wa_header.

wa_header-typ = 'S'.

wa_header-key = 'List Of Items'.

wa_header-info = sy-title.

append wa_header to i_header.

clear wa_header.

wa_header-typ = 'S'.

wa_header-key = 'Date'.

write ws_date mm/dd/yyyy to wa_header-info.

append wa_header to i_header.

clear wa_header.

wa_header-typ = 'S'.

wa_header-key = 'Time'.

wa_header-info = ws_time.

append wa_header to i_header.

clear wa_header.

wa_header-typ = 'S'.

wa_header-key = 'User'.

wa_header-info = ws_user.

append wa_header to i_header.

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = i_header

i_logo = 'WEYER-LOGO'

  • I_END_OF_LIST_GRID =

.

endform.

Hope it helps you.

Thanks&Regards,

Ruthra.R

Read only

Former Member
0 Likes
436

GO through the sample code in the link

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm

Read only

Former Member
0 Likes
436

Hello,

I think a better solution would be to use the heirarchial alv list.

form f_alv_display.

data : g_repid like sy-repid.

g_repid = sy-repid.

*For Layout to be modified.

ls_vari-report = g_repid.

ls_vari-log_group = 'LIST'.

gs_test-vari_save = 'A'.

gs_test-vari_default = 'X'.

call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

exporting

  • I_INTERFACE_CHECK = ' '

i_callback_program = g_repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • is_layout = ls_layout

it_fieldcat = i_fieldcat1

  • IT_EXCLUDING =

  • it_special_groups =

  • it_sort =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

i_default = gs_test-vari_default

i_save = gs_test-vari_save

is_variant = ls_vari

it_events = lt_evts

  • it_event_exit = lt_evts_exit

i_tabname_header = 'I_HEADER'

i_tabname_item = 'I_ITEM'

  • I_STRUCTURE_NAME_HEADER =

  • I_STRUCTURE_NAME_ITEM =

is_keyinfo = ls_keyinfo

  • is_print =

  • IS_REPREP_ID =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab_header = i_header

t_outtab_item = i_item

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.

Another good example with sap is BALVHT01

Regards,

Shekhar Kulkarni