How to use ALV for Hierarchical Lists

Can anyone tell me how to use ALV for hierarchical lists using the function code REUSE_ALV_HIERSEQ_LIST_DISPLAY?

Swarna

Hello, there are some nice examples in SAP which use this function module, so you might want to check them out ( where used etc. )

In essence, this is a call in one of my ABAPs
 

  CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
      i_interface_check              = 'I'
      i_callback_program             = gv_repid
*      i_callback_pf_status_set       = 'STATUS_DATA'
      i_callback_user_command        = 'COMMAND_DATA'
*      is_layout                      = gs_layout
      it_fieldcat                    = gt_fieldcat
     i_default                      = ' '
      i_save                         = 'A'
      i_tabname_header               = v_headers_itable
      i_tabname_item                 = v_items_itable
      i_structure_name_header        = v_headers_table
      i_structure_name_item          = v_items_table
      is_keyinfo                     = gs_keyinfo
      i_bypassing_buffer             = 'X'
    TABLES
      t_outtab_header                = i_headers
*      t_outtab_item                  = i_result
      t_outtab_item                  = i_report
    EXCEPTIONS
      program_error                  = 1
      OTHERS                         = 2.

The field cat creation worked like this : 
FORM fieldcat.

  DATA: ls_fieldcat TYPE slis_fieldcat_alv.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
            i_internal_tabname = v_items_itable
            i_structure_name   = v_items_table
       CHANGING
            ct_fieldcat        = gt_fieldcat.

  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
            i_internal_tabname = v_headers_itable
            i_structure_name   = v_headers_table
       CHANGING
            ct_fieldcat        = gt_fieldcat.

ENDFORM.


and of course you need to tell the thing what is key and item

  gs_keyinfo-header01 = 'PA'.
  gs_keyinfo-item01  = 'PA'.
  gs_keyinfo-item02 = 'SAPDOC'.
  PERFORM fieldcat.
I hope this helps you and not confuse you, 
Cheers.

Kenderband

ABAP Tips


 

Related ABAP Topics:
Table CDHDR and CDPOS Usage

Get help for your ABAP problems
Do you have a ABAP Question?

SAP Books
SAP Certification, Interview Questions, Functional, Basis Administration and ABAP Programming Reference Books

More ABAP Tips

Main Index
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.