Application Development 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: 

Hierarchical Alv

Former Member
0 Kudos

Hi,

Is it possible to have 5 Level Hierarchical Alv...If so please explain for how to do?

2 REPLIES 2

Former Member
0 Kudos

Hi Sathish,

This should be quite simple using OO ALV grid. All you need to do is call 5 screens as necessary. Here is a sample code:


START-OF-SELECTION.

* Insert your calculations here and get the output table

* Display the first ALV Grid as follows:
CALL SCREEN 100.


* PBO of screen 100
MODULE pbo_0100 OUTPUT.

* Define field catalog and layout properties

* Call the ALV Grid
CALL METHOD go_alvgrid->set_table_for_first_display
      EXPORTING
        is_layout       = gs_layout
      CHANGING
        it_outtab       = gt_outtab[]
        it_fieldcatalog = gt_fieldcat[].

* PAI of screen 100
MODULE pai_0100 OUTPUT.

* You must assign a function code for navigation
* Either you will double-click on a row, or click a button
* Assuming the F-code is 'NEXT'

  gv_okcode = okcode.
  CASE gv_okcode.
    when 'NEXT'.
    
* Write the code for fetching the second output table

* Call a new screen for the second ALV
  call screen 101.


* PBO of screen 101
MODULE pbo_0101 OUTPUT.

* Define field catalog and layout properties of second table

* Call the ALV Grid
CALL METHOD go_alvgrid2->set_table_for_first_display
      EXPORTING
        is_layout       = gs_layout2
      CHANGING
        it_outtab       = gt_outtab2[]
        it_fieldcatalog = gt_fieldcat2[].

* PAI of screen 101
MODULE pai_0101 OUTPUT.

* Again, assign a function code for navigation
* Assuming the F-code is 'NXT2'

  gv_okcode = okcode.
  CASE gv_okcode.
    when 'BACK'.
      leave to screen 100.
    when 'NXT2'.
    
* Write the code for fetching the third output table

* Call a third screen for the third ALV
  call screen 102.

... and so on for the remaining levels.

Hope this helps! Do let me know if you need anything else!!

Cheers,

Shailesh.

Always provide feedback for helpful answers

0 Kudos

Hi,

I think its take to different screen.....I need hierarchically......I think you got my requirement.....