Application Development 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: 

Changing the order of fields in an internal table

Former Member
0 Kudos

Hi all,

I'm using field symbol as internal table. this table has got a standard database structure.

I want to make the 3rd column of this internal table as 1st colums keeping rest of the columns as it is.

Is there any way to do this?

Thanks,

Anil.

1 ACCEPTED SOLUTION

viquar_iqbal
Active Contributor
0 Kudos

Hi

Instead of directly taking the type as a standard structure , declare the FS internal table as type of types structure.

Data: fs_scarr like type_s_scarr.

FIELD-SYMBOLS <scarr2> TYPE fs_scarr

In the types put the third column as first one and use into corresponding in select query

or else

while displaying the internal table change the order of the columns

Loop at itab into fs_itab.

write : col3

col2

col4

endloop.

Thanks,

Viquar Iqbal

5 REPLIES 5

Former Member
0 Kudos

insted of using standard database structure , declare each and every field of internal table using the corresponding data element

agnihotro_sinha2
Active Contributor
0 Kudos

hi,

Can u briefly describe ur structure? and why is dat u need ordering? Since without ordering also u can extract, load and display data in whichever position u want.

ags.

0 Kudos

Actually I want to use at end of...endat control structure on the 3rd field but it takes the end of the combination of 1st 3 fields which i dont want.

0 Kudos

U will have to make a Z structure for ur table and the field at which u r calling at end of should be declared as 1st field and also the table should be sorted on this field. There is no other way in which u can change the order of ur internal table fields.

viquar_iqbal
Active Contributor
0 Kudos

Hi

Instead of directly taking the type as a standard structure , declare the FS internal table as type of types structure.

Data: fs_scarr like type_s_scarr.

FIELD-SYMBOLS <scarr2> TYPE fs_scarr

In the types put the third column as first one and use into corresponding in select query

or else

while displaying the internal table change the order of the columns

Loop at itab into fs_itab.

write : col3

col2

col4

endloop.

Thanks,

Viquar Iqbal