Application Development and Automation 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: 
Read only

Ascend Decend on table control

Former Member
0 Likes
880

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

1 ACCEPTED SOLUTION
Read only

venkat_o
Active Contributor
0 Likes
610

Hi AP, Check the demo program which is suitable to your problem

DEMO_DYNPRO_TABCONT_LOOP_AT
Thanks Venkat

3 REPLIES 3
Read only

Former Member
0 Likes
610

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.

Read only

Former Member
0 Likes
610

will you have a look at the thread.

Read only

venkat_o
Active Contributor
0 Likes
611

Hi AP, Check the demo program which is suitable to your problem

DEMO_DYNPRO_TABCONT_LOOP_AT
Thanks Venkat