09-29-2005 6:03 AM
Hi there,
I have an application where I use cl_gui_alv_tree. The user can group the entries of the tree by selecting a button and deciding upon the field he wants to use. The function module LVC_SORT is used to do this. My questions is: can such a sorting value be saved, so that the user does not have to call the grouping functionality again when restarting the transaction (default sorting)? The layout seems to only save the displayed fields.
Thank you,
Ferenc
09-29-2005 6:06 AM
Hi,
See this code
* Create emty tree-control
CLEAR: it_emptytab.
REFRESH: it_emptytab.
CALL METHOD gd_tree->set_table_for_first_display
EXPORTING
is_hierarchy_header = gd_hierarchy_header
it_list_commentary = gd_report_title
i_logo = gd_logo
* i_background_id = 'ALV_BACKGROUND'
<b> i_save = 'A'</b>
* is_variant = ls_variant
CHANGING
it_outtab = it_emptytab "Must be empty
it_fieldcatalog = gd_fieldcat.
ENDFORM. " CREATE_EMPTY_ALVTREE_CONTROL
Check this lik for reference
http://www.sapdevelopment.co.uk/reporting/alv/alvtree.htm
Hope this helps.
09-29-2005 6:29 AM
Hi,
Sorry but this seems to save only the displayed fields. the sorting is not saved.
Regards,
Ferenc
09-29-2005 6:08 AM
Hi,
If you are sure that the same kind of sorting has to be done each time you run the transaction why don't you opt for sorting it programatically.
Please reward points if this explanation useful.
Regards,
Siva
09-29-2005 6:18 AM
Hi Siva,
I want to give the customer the possibility to decide which field he wants to use and to save this option. So the next time he does not have to select this again. As the selected field can differ from customer to customer, setting a standard field for it is not possible.
Thanks anyway,
Ferenc