cancel
Showing results for 
Search instead for 
Did you mean: 

Select at least one column to perform the search

Former Member
0 Kudos

Hi

I am trying to get a smartTable work in my project.

I have created a smartTable and bound it to a model

I have. When I run the app I get

error "Select at least one column to perform the search"


I have checked the documentation here

but in my code I insert no columns manually.


Because I import a list of suppliers, I

also set the EntityType = "LFA1"

on the filterbar

and the EntitySet = "LFA1Set"

on the table.


Any comment is appreciated


Regards

Yuval



Accepted Solutions (1)

Accepted Solutions (1)

NabiZamani
Contributor

Like the others already mentioned you should have the right annotations defined in your service. If I remember correctly, then this means you have to create a GW Project in transaction code SEGW of type "Service with Vocabulary-Based Annotations". In case that is not an option for you make sure to code the annotations manually in your generated Model Provider Class Extension.

Other than that, instead of having the annotations you could also configure the SmartTable and set the property initiallyVisibleFields="Property1,Property2,Property3". For details see the official API docs for the SmartTable. There you will read the following:

"This property is mainly meant to be used when no LineItem annotation exists."

Best, Nabi

TimMuchena
Participant
0 Kudos

Hi

I am getting the error even though I have my annotations in place.

   My metadata with annotations

and my view

We are on version 1.38

What am I missing?

Answers (1)

Answers (1)

karthikarjun
Active Contributor
0 Kudos

Hi Yuval,

Need your source code.

could you please paste it here.

Thanks,

Karthik A

Former Member
0 Kudos

Hi Karthik

The table works now.

Unfortunately every time I open the view I get

"select at least one column to perform the search"

then I have to set the columns I need using the cog-looking button

on the left and then I need to press the Go button to get all

the data.

My question : how do I set default columns in my source code?

regards

Yuval

naveen_arundi
Discoverer
0 Kudos

Hi Yuval,

If you have found the solution, could you please share the same?

Regards

Navi

Former Member
0 Kudos

Hello Yuval,

For this to work you need to set default Columns for the Smart Table with the LineItem Annotation in the ODATA Service.

Look at the example at the Explored App. In the mockdata there you can see the LineItem Annotation Collection with some Records specifying the Default Columns.

Regards,

Florian

0 Kudos

Hi Florian,

Can you please quote the part of the metadata which you're referring to? I went through the explored example but could not identify anything relevant to setting initial columns. Looking forward to your response. Thank you.

Former Member
0 Kudos

Hello Tejas,

I´m referring to this part of the Metadata Document:


<Annotations Target="com.sap.GL.zrha.LineItems"
xmlns="http://docs.oasis-open.org/odata/ns/edm">
<Annotation Term="com.sap.vocabularies.UI.v1.LineItem">
<Collection>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="Bukrs" />
<PropertyValue Property="Label" String="my Bukrs" />
<Annotation Term="com.sap.vocabularies.UI.v1.Importance"
EnumMember="com.sap.vocabularies.UI.v1.ImportanceType/High" />
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="Gjahr" />
<Annotation Term="com.sap.vocabularies.UI.v1.Importance"
EnumMember="com.sap.vocabularies.UI.v1.ImportanceType/Medium" />
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="Kunnr" />
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="Name1" />
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="Dmbtr" />
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="Hwaer" />
</Record>
<Record Type="com.sap.vocabularies.UI.v1.DataField">
<PropertyValue Property="Value" Path="Cnt" />
<Annotation Term="com.sap.vocabularies.UI.v1.Importance"
EnumMember="com.sap.vocabularies.UI.v1.ImportanceType/Low" />
</Record>
</Collection>
</Annotation>
</Annotations>

You can also refer to this link for more Information about the needed Annotations:

http://help.sap.com/saphelp_scm700_ehp03/helpdata/en/be/d8274140d04fc0b9bcb2db42d8bac2/content.htm

Regards,

Florian

0 Kudos

-<Annotations Target="ZFILTER_TEST_SRV.sflightEntitySet">

-<Annotation Term="com.sap.vocabularies.UI.v1.LineItem">

-<Collection>

-<Record Type="com.sap.vocabularies.UI.v1.DataField">

<PropertyValue Path="Carrid" Property="Value"/>

<PropertyValue Property="Label" String="Carrid"/>

</Record>

-<Record Type="com.sap.vocabularies.UI.v1.DataField">

<PropertyValue Path="Connid" Property="Value"/>

<PropertyValue Property="Label" String="Connid"/>

</Record>

-<Record Type="com.sap.vocabularies.UI.v1.DataField">

<PropertyValue Path="Fldate" Property="Value"/>

<PropertyValue Property="Label" String="Fldate"/>

</Record>

</Collection>

</Annotation>

</Annotations>