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: 

Expand / Collapse (+/-) button on table control

sivaprasad_ml
Participant
0 Kudos
879

Hello Everyone,

Currently I am working with a module pool program which needs to have a table control with expand/collapse(+/-) button in the first column, and the WBS elements in the second column for the project definition entered in the initial screen. Rest of the columns are from a custom table. This resembles table control in transaction CJ40/CJ30/CJ20.

Tried using cl_gui_alv_tree to bring the tree structure .But unfortunately I am unable to edit the items directly.

Highly appreciate if any sample program could be shared.

Thanks

Sivaprasad

5 REPLIES 5

Sandra_Rossi
Active Contributor
748

Do you want to use Table Control (dynpro element used with ABAP "CONTROLS" keyword), or to use a Tree Control (cl_gui_alv_tree, cl_gui_column_tree and so on)?

I guess you mean a Tree Control, not a Table Control.

I don't understand why your question title is about Expand / Collapse, although you only seem to ask assistance to "edit the items directly".

What is your exact question?

sivaprasad_ml
Participant
0 Kudos
748

Hi Sandra,

Thank you for the comment. I am trying to display the items in tree structure . I would subsequently edit the existing items in the grid and then save it.

I am able to bring the items using Tree Control (cl_gui_alv_tree). But does not allow me to edit the rows.

So, my requirement is to display the items in tree format as well as edit the rows.

Sandra_Rossi
Active Contributor
748

Maybe I don't correctly understand "edit the rows", if you mean that the user should be able to edit the rows the same way as they can edit the values in an ALV Grid, it's not possible. A Tree Control is not Editable. You can only act on its content programmatically, and that's it.

sivaprasad_ml
Participant
0 Kudos
748

You are correct. We will not be able to input/ change directly. Thanks

Sandra_Rossi
Active Contributor
0 Kudos
748

Just to say, again, as it seems that "does a tree control support direct editing by user" was your question, the title "Expand / Collapse (+/-) button on table control" is completely unrelated to the actual question.

Menu Actions > Edit.