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: 

ALV Hierarchical Container

0 Kudos

Dear experts!

How we might have two ALV hierarchical on the same screen?

I could not find any solution in a regular basis.. as using Docking or CL_SALV* or CL_ALV*.

The only way to have a hierarchical ALV is using REUSEHIERARCALV function or SALV class using Factory, but I could not find out how to have two ALV Hierarchical at the same screen.

Any tips or suggestions?

Best regards,

Alex

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

Hi Alex,

To have 2 ALV hierarchies, you'll have to use control framework. One dynpro with 2 custom containers inside, or one dynpro with 1 custom container + one docking container. There are a few other possibilities.

The root class to use is CL_GUI_ALV_TREE (which wraps the control CL_GUI_COLUMN_TREE by the way), which is also wrapped by CL_SALV_TREE.

As SALV is to be a simplified version of ALV, so I would recommend CL_SALV_TREE by default, but I don't have experience with it. See demo programs SALV_DEMO_TREE*.

If you're not comfortable with control framework, see DWDM transaction which provides examples. For 2 controls in the same screen, see for instance SAP_PICTURE_DEMO.

Sandra

3 REPLIES 3

Sandra_Rossi
Active Contributor
0 Kudos

Hi Alex,

To have 2 ALV hierarchies, you'll have to use control framework. One dynpro with 2 custom containers inside, or one dynpro with 1 custom container + one docking container. There are a few other possibilities.

The root class to use is CL_GUI_ALV_TREE (which wraps the control CL_GUI_COLUMN_TREE by the way), which is also wrapped by CL_SALV_TREE.

As SALV is to be a simplified version of ALV, so I would recommend CL_SALV_TREE by default, but I don't have experience with it. See demo programs SALV_DEMO_TREE*.

If you're not comfortable with control framework, see DWDM transaction which provides examples. For 2 controls in the same screen, see for instance SAP_PICTURE_DEMO.

Sandra

0 Kudos

Hi Sandra,

The CL_SALV_TREE is different than cl_salv_hierseq_table( see this demo SALV_DEMO_HIERSEQ_SIMPLE ).

Using Hierarchical stuff we would have two different levels( header and Item) what the ALV tree does not allow.

The SALV_HIERSEQ has the method cl_salv_hierseq_table=>factory that does not have container paramenter, there is not way to use it in a container.

The other classes as cl_salv_table/CL_SALV_TREE have the method "factory" with the import parameter "container_name" what permit us to use the container object thus use the control framework.

Got it?

Any idea how to achieve it?

Alex

0 Kudos

Yup, sorry, I made a confusion between ALV hierarchy and ALV tree. My answer was only about ALV tree.

About ALV hierarchical-sequential, I only know the ABAP List version (the class wrappers still use it), there's no control for it.

So, there's no solution. The workarounds I see is either to use block lists (lists are written one below the other), or use full screen on 2 external modes using IMC and switch between the 2 modes using a button to make things smoother to the user (see RSIMCTST program). Be careful with IMC, I don't think whether there is support from SAP, nor if it will be maintained.

Sandra