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

dynamic table sorted

juancarlos_tena
Explorer
0 Likes
279

Hello,

I have a dynamic table like this :

field-symbols: <l_table> type table,

......

  • TO DEFINE THE DATA

  • TO INTRODUCE THE DATA

assign component 'FIELD1' of structure <l_line>

to <l_field>.

<l_field> = valor.

append <l_line> to <l_table>.

But my problem is that I need sort the table (<l_table>), for example with sort. But the system give a error message that

How can I do it ? Any idea?

Regards,

Paloma

1 REPLY 1
Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
252

Hi Paloma

I guess you get dump since you state sorting fields which are not present at the structure of <l_table> . Try giving field names dynamically.

<u>E.g.</u>


lv_fieldname1 = 'FIELD1' .
lv_fieldname2 = 'FIELD2' .

SORT <l_table> BY (lv_fieldname1) 
                  (lv_fieldname2) .

Here field1 and field2 are field names at your table structure.

*--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>