on 10-06-2015 12:09 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yuval,
Need your source code.
could you please paste it here.
Thanks,
Karthik A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
-<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>
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.