Skip to Content
avatar image
Former Member

ALV grid Multiple Header ... ?

Hi All,

My requirement is to display data in 3 levels using ALV grid display.For this i need three separate rows for describing the columns.Is it possible to do this in ALV grid ? If not i welcome suggestions for the approach i need to follow to achieve my requirement.

Cheers

Nishanth

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Jul 05, 2005 at 10:27 AM

    Thank you for the answers..Guys.I am using SAP version 4.7..I guess i need some time to research on the info that you guys have provided...i am not using the classical approach for building my ALV grid.I am using the implementatiion of the class CL_GUI_ALV_GRID and using the methods inside it to build my grid....What i am specifically looking for is to have my grid display something like this.( soon after selection-screen execution ).

    Order Number Location StartDate FinishDate

    Status Operation Operation Start Date

    Status Material

    The above three rows give the description of what the data in the below three rows represent..

    For example :

    500000333 006 5/2/2005 5/12/2005

    Not completed 10 5/11/2005

    Released Test-1

    Hope this gives a better idea of what i am trying to achieve....

    Cheers

    Nishanth

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      thanks for reply, but here i do't have heirarchy list. i have to print one record in multiple row, this client requirement.

  • avatar image
    Former Member
    Jul 05, 2005 at 09:30 AM

    Hi Nishanth,

    First of all i would like know about your requirements,Is it going to be a three level drill down list or in single page you would like to display three types of data.

    whatever may be the case both can be done.

    if it's going three level drill down list then you can use can see following piece of code. declaration should be like this.

    top_of_page type slis_formname value 'TOP_OF_PAGE',

    end_of_page type slis_formname value 'END_OF_PAGE',

    user_command type slis_formname value 'USER_COMMAND',

    pf_status_set type slis_formname value 'PF_STATUS_SET',

    user_command1 type slis_formname value 'USER_COMMAND1',

    pf_status_set1 type slis_formname value 'PF_STATUS_SET1',

    and displaying the first list will be.

    call function 'REUSE_ALV_GRID_DISPLAY'

    exporting

    • I_INTERFACE_CHECK = ' '

    • I_BYPASSING_BUFFER =

    • I_BUFFER_ACTIVE = ' '

    i_callback_program = name

    i_callback_pf_status_set = pf_status_set

    i_callback_user_command = user_command

    • I_STRUCTURE_NAME =

    i_callback_top_of_page = 'TOP-OF-PAGE'

    i_grid_title = 'CUSTOMER GROUP WISE REPORT'

    is_layout = layout

    it_fieldcat = fieldcat_t

    • IT_EXCLUDING =

    • IT_SPECIAL_GROUPS =

    • it_sort = SORT_T

    • IT_FILTER =

    • IS_SEL_HIDE =

    i_default = 'X'

    i_save = 'A'

    • IS_VARIANT =

    • it_events = events_t

    • IT_EVENT_EXIT =

    • IS_PRINT =

    • IS_REPREP_ID =

    • IT_ADD_FIELDCAT = FIELDCAT_T1

    • I_SCREEN_START_COLUMN = 0

    • I_SCREEN_START_LINE = 0

    • I_SCREEN_END_COLUMN = 0

    • I_SCREEN_END_LINE = 0

    • IMPORTING

    • E_EXIT_CAUSED_BY_CALLER =

    • ES_EXIT_CAUSED_BY_USER =

    tables

    t_outtab = it_basic.

    and capturing user command will be like this.

    form user_command using ucomm like sy-ucomm

    selfield type slis_selfield.

    case ucomm.

    when '&IC1'.

    read table it_basic index selfield-tabindex.

    perform get_data_first_list using it_basic-kdgrp.

    when '&PLEVEL'.

    when '&CUST'.

    when '&F15'.

    leave to screen 0.

    endcase.

    endform. "user_command

    you may be able to display the similar when the double click a line or clicking on a button.

    if you want have mulitple header lines on the top of page you can this.

    form top-of-page.

    *ALV Header declarations

    data: t_header type slis_t_listheader,

    wa_header type slis_listheader.

    wa_header-typ = 'H'.

    wa_header-info = xhead.

    append wa_header to t_header.

    clear wa_header.

    concatenate sy-datum6(2) sy-datum4(2) sy-datum+0(4) into xhead1

    separated by '.'.

    wa_header-typ = 'H'.

    wa_header-info = xhead1.

    append wa_header to t_header.

    clear wa_header.

    • append t_header.

    *append t_header.

    call function 'REUSE_ALV_COMMENTARY_WRITE'

    exporting

    it_list_commentary = t_header.

    • i_logo = 'Z_LOGO'.

    endform. "top-of-page

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 05, 2005 at 10:08 AM

    Hi Nishanth,

    Which version of SAP are you using? I'm sure that it is possible till 4.6C. I think we may be able to do it in 4.7.

    In 4.6C, however, we can display a two level list. You can look at the Function Module REUSE_ALV_HIERSEQ_LIST_DISPLAY. It is well documented. You can also search for the programs where it is used.

    In case you are on 4.6C and want this functionality, then you can display the first level as a single list. When the user clicks on any of the lines here, you can display the remaining two levels using the above function module.

    Regards,

    Anand Mandalika.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 05, 2005 at 03:20 PM

    You can do up to 3 header rows in the ALV List function. I don't know if you can do this in the Grid function, however.

    Add comment
    10|10000 characters needed characters exceeded