cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the sort order of complex table in drop down

kngupta141
Participant
0 Kudos

Hi Team,

I have a complex table which is working but the sort order i want in a different way. How can i change?

Regards,

Gupta

Accepted Solutions (1)

Accepted Solutions (1)

jason_latko
Active Contributor
0 Kudos

Gupta,

You would need to change the index you are using on the screen field, or alter the index sort order on the complex table itself.  You can set up the index as ascending or descending.

Jason Latko - Senior Product Developer at SAP

kngupta141
Participant
0 Kudos

Hi Jason,

My index is fine, I want to sort my index based on the possible values alphabetically.

Regards,

Gupta

jason_latko
Active Contributor
0 Kudos

Gupta,

Indexes are automatically sorted alphabetically.  I guess I don't understand the problem then?  You can sort a string index alpha either ascending or descending.  If your index is a number, it will not sort alpha, but numerically.  Set your index to a string and you will get an alpha sort based on the field tied to your index.

Jason Latko - Senior Product Developer at SAP

kngupta141
Participant
0 Kudos

Hi Jason,

I just checked my field it is a string type and also i have checked the index for sort order the checkbox for descending is not selected i assume then it is getting sorted by ascending.

But still i am not seeing the sort order in alphabetically.

Regards,

Gupta

Former Member
0 Kudos

Does the field you are displaying have an index (without a parent) on it?

Stephen

kngupta141
Participant
0 Kudos

Hi Steve,

It has parent index.

Regards,

Gupta

Former Member
0 Kudos

Can you create a index on the display field without a parent.  You don't need to set it on the complex table field.

former_member197782
Participant
0 Kudos

Gupta,

    As per your question you want to sort the complex table field values which has a parent index right?

   

Please check below I have example:

1. Below are the indexes I defined. Here only BatchNo is having the parent index

2. Check in ATE. Here you can see my partners are populating in sorted order only and it is giving all values independent other fields.

3. I will define parent index for partner now.

4. Check in ATE.

    

     Test 1:

     Test 2:

I want you need this kind of output only. Please check your index def, parent index def, field types and field edit types.

Hope this helps a bit.

Thanks,

Swaroopa.

kngupta141
Participant
0 Kudos

Hi Steve,

I didn't get you, Is display field and complex table fields are different?. Actually i am confused because. Could you please explain bit more clear.

Regards,

Gupta

kngupta141
Participant
0 Kudos

Hi Swaroopa,

Could you please show me the properties at screen field level, I am unable to understand your example.

In the first screen shot your dropdown is already sorted but after adding parent index as location with location Andhra paradesh values got disturbed but later after choosing Gujarat again your values looks sorted alphabetically.

Regards,

Gupta

kngupta141
Participant
0 Kudos

Hi can you help me

former_member197782
Participant
0 Kudos

Gupta,

My screen field definitions are as follows:

1. Location

2. Partner

--In my previous reply, the first screen shot is without any parent index. So it is giving all values in alphabetical order only.

--After that I created parent index for partner with location, So the partner values are depend on location chosen.

In my TEST1:

--I just selected "Andhra pradesh" as location, In partner field drop down it is showing "Ragava" "Suman" "Sunitha" only.

--Because these are only the values belong to "andhra pradesh" location and these are coming in alphabetical order only.

TEST2:

--Here I selected "Gujrat" as location, In partner field drop down it is showing "Avinash" "Mohan" "Suman" which are belong to "Gujrat" location, These are also in alphabetical order only.

Hope this clears now. Still any query please post.

Thanks,

Swaroopa.

kngupta141
Participant
0 Kudos

HI Swaroopa,

I am passing a value in my parent index, if i don't have a parent index then how do i pass the value?

Regards,

Gupta

former_member197782
Participant
0 Kudos

Hi Gupta,

   I can't get you. Could you please explain a bit more and what exactly your question ?

Thanks,

Swaroopa.

kngupta141
Participant
0 Kudos

Hi Swaroopa,

My complex table has wide range of values in that i am considering only few values by passing value in parent index.

If i remove my parent index then i may not be in a position to restrict the values. i will get all values in my drop down.

Regards,

Gupta

kngupta141
Participant
0 Kudos

Hi Swaroopa,

I did the same, as shown in the screenshots still the values are not sorted.

I have realized what was the issue now, during index creation the field is based on code instead of description of my drop down.

Is there a way with out creating a new index can we solve this issue?. If i change field to code with codedesc it worked for me.

Regards,

Gupta

jason_latko
Active Contributor
0 Kudos

Gupta,

No, the sort is always based on the indexed field, not the displayed field.  You will need to create that index.

Jason Latko - Senior Product Developer at SAP

kngupta141
Participant
0 Kudos

Created a Index with the display field. Now the sort works fine.

Answers (0)