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: 

Sorting of internal tables using deep structure fields

Former Member
0 Kudos

Hi All,

We have a requirement in which we need to sort an internal table.

but the internal table has deep structure( it has a field which is an internal table).

Now I need to sort the internal table using the fields in the deep structure ( deep structure has some fields and i need to use them in my sort condition)

But i could not sort the internal table.

Its is diaplaying a message " no component exists with the name".

Please help.

Thanks and Regards,

LRK

8 REPLIES 8

Former Member
0 Kudos

Hi:

1. declare the type of internal table

2. append the contents from there to your internal table

3. then sort your internal table and use it .

Regards

Shashi

Former Member
0 Kudos

Suppose the deep structure is declared as include in the table.

Then you can sort like this

sort itab by include-field1 include field2.

Regards,

Lalit Mohan Gupta.

0 Kudos

Hi Lalith,

I have tried the way you have given but still its isnt working.

is there any other alternative?

Thanks

LRK

0 Kudos

i tried the same way i mentioned and its working for me....

Can you give specify what error or problem you are facing....

Regards,

Lalit Mohan Gupta.

0 Kudos

Hi Lalit,

I have created another internal table with out a ddep structure and moved all the fields data into the table and worked on it.

Thanks alot for your help.

LRK

Former Member
0 Kudos

Hi Ravi,

I checked your requirement. I will show you one small example which i checked and it is working.

I have a table by name DPR_PROJECT. In that I have one deep structure called Extended_Attributes.

Now look this example and follow. Hope it is useful to you.

<data: begin of itab occurs 0.

include structure dpr_project.

data end of itab.

select * from dpr_project into table itab.

sort itab by extended_attributes-zzinvtype.>

Regards,

Santosh Kumar Mukka.

Former Member
0 Kudos

Hi Ravi,

Please close your question if you have got the solution and give points for helpful answers.

Regards,

Lalit Mohan Gupta.

Former Member
0 Kudos

Thanks