11-17-2015 1:21 PM
Hi everyone,
the document http://scn.sap.com/docs/DOC-53788 describes how to display a dynamically generated table (using RTTS) as a list (class cl_salv_table). This works, but I would like to display a dynamic table as a tree (class cl_salv_tree). Unfortunately it doesn't work for me. I'm getting cx_salv_error. Does anybody know how to do this?
TRY.
cl_salv_tree=>factory(
IMPORTING
r_salv_tree = lo_salv_tree
CHANGING
t_table = <fs_table> ).
CATCH cx_salv_data_error INTO lo_data_err.
CATCH cx_salv_not_found INTO lo_not_found.
CATCH cx_salv_error INTO lo_error.
ENDTRY.
Thanks.
11-17-2015 5:08 PM
when creating a tree the parameter
t_table
has to be an empty table of the target structure.
You musn't have any lines in t_table.
After you used the factory method you have to use the "nodes" element and add nodes, here you can provide a data row, this data row must be of the same structure as the table you provided for the factory.
do you have an example of your structure? do you know on what logic your tree shall be built?
With those information I can provide you some better instructions.
so regarding to the instructions for a list you need to pass over this step:
Step 3 - Populate internal table.
instead you have to build the hierarchy from nodes and assign data rows to the nodes
11-17-2015 5:08 PM
when creating a tree the parameter
t_table
has to be an empty table of the target structure.
You musn't have any lines in t_table.
After you used the factory method you have to use the "nodes" element and add nodes, here you can provide a data row, this data row must be of the same structure as the table you provided for the factory.
do you have an example of your structure? do you know on what logic your tree shall be built?
With those information I can provide you some better instructions.
so regarding to the instructions for a list you need to pass over this step:
Step 3 - Populate internal table.
instead you have to build the hierarchy from nodes and assign data rows to the nodes
11-18-2015 10:47 AM
Markus, thank you for your help.
You are absolutely right. I forgot that the input table of the factory method (cl_salv_tree) shouldn't contain data.
The question is closed.