‎2009 May 12 10:46 PM
I have ascend and descend icon on the custom screen. I am trying to sort coulmn on a table control on the screen.
I have 2 issues:
1) I am not abe to select a coulmn on the table (control)
2) And following code i have for sorting is not working,
WHEN 'SASCEND' OR 'SDESCEND'. "sort column
PERFORM fcode_sort_tc USING p_tc_name p_table_name l_ok.
FORM fcode_sort_tc USING p_tc_name
p_table_name
l_ok.
-BEGIN OF LOCAL DATA----
DATA l_table_name LIKE feld-name.
FIELD-SYMBOLS <tc> TYPE cxtab_control.
FIELD-SYMBOLS <table> TYPE STANDARD TABLE.
FIELD-SYMBOLS <wa>.
FIELD-SYMBOLS <sort>.
-END OF LOCAL DATA----
ASSIGN (p_tc_name) TO <tc>.
get the table, which belongs to the tc *
CONCATENATE p_table_name '[]' INTO l_table_name. "table body
ASSIGN (l_table_name) TO <table>. "not headerline
IF l_ok = 'SASCEND'.
SORT <table> ASCENDING.
ELSE.
SORT <table> DESCENDING.
ENDIF.
ENDFORM. " FCODE_SORT_TC
‎2009 May 13 4:14 AM
Hi AP,
Check the demo program which is suitable to your problem
Thanks
Venkat
DEMO_DYNPRO_TABCONT_LOOP_AT
‎2009 May 13 12:39 AM
HI,
If you can look at your formal parameters on FORM statement, you have to mention the datatype of the parameters. Say,
FORM fcode_sort_tc USING p_tc_name type cxtab_control
p_table_name
l_ok.
LOOP AT p_tc_name into wa.
wa-selected = 'X'.
You can research through the Include program " MF02DFT0" and coding for TCTRL_SORT.
‎2009 May 13 12:49 AM
‎2009 May 13 4:14 AM
Hi AP,
Check the demo program which is suitable to your problem
Thanks
Venkat
DEMO_DYNPRO_TABCONT_LOOP_AT