on 10-06-2015 10:01 PM
Hi All,
I want to play with the Smart control in UI5 especialy with the table. In my investigation I found that I need to drive the UI with Annotation stuff.
I found out the solution to add annotation into my Metadata file but it miss the VALUE property.
Here is what I get :
The property I have is LABEL but it seams that I need the property VALUE :
src: Step 5: Smart Filter Bar and Smart Table
When I try to modify my annotation (TCode SEGW) I do not have that property :
So my question is how to set VALUE property ?
Regards,
I'm close to find a solution, but it is a programmed solution. What I done is to insert code into ZCL****MPC_EXT classe inside the method DEFINE_VOCAB_ANNOTATIONS.
Inside I set that code :
(...)
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_property_path( 'Fonds' ).
" Annotation
lo_sub_annotation = lo_record->create_annotation( iv_term = 'com.sap.vocabularies.UI.v1.Importance' ).
lo_simp_value = lo_sub_annotation->create_simple_value( ).
lo_simp_value->set_enum_member_by_name( iv_value = 'com.sap.vocabularies.UI.v1.Importance/High' ).
I replace Label by Value and in my Metadata file I get this :
But it still doesn't work because the property Fonds has not the parameter SAP:VISIBLE
And I really don't know how to set this parameter ?!
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
that's the way we want to try.
Can you make a Screenshot from your Entity?
Think your Properties are also missing the SAP:Label Annotation... so they can't be displayed!
In my case only the Property "IncDate" will be displayed as "Zeitstempel".
Thats why we still using the SEGW type 1: SAP-Annotation and trying to create the whole LineItem-Tag in the *MPC_EXT.
This has the benefit that the properties are translatable in the backend.
Regards
Here is my entity
<EntityType Abstract="true" Name="EtFondsDetails" sap:content-version="1">
<Key><PropertyRef Name="Fonds"/></Key>
<Property MaxLength="4" Name="Fikrs" Nullable="false" Type="Edm.String" sap:label="Périm.financier"/>
<Property MaxLength="1" Name="Status" Nullable="false" Type="Edm.String"/>
<Property MaxLength="10" Name="Fonds" Nullable="false" Type="Edm.String"/>
<Property MaxLength="255" Name="Designation" Nullable="false" Type="Edm.String"/>
<Property MaxLength="1024" Name="Responsable" Nullable="false" Type="Edm.String"/>
<Property Name="SoldeInitial" Nullable="false" Precision="13" Scale="2" Type="Edm.Decimal" sap:label="Montant pér.fin"/>
<Property Name="Recette" Nullable="false" Precision="13" Scale="2" Type="Edm.Decimal" sap:label="Montant pér.fin"/>
<Property Name="Depense" Nullable="false" Precision="13" Scale="2" Type="Edm.Decimal" sap:label="Montant pér.fin"/>
<Property Name="SoldeFinal" Nullable="false" Precision="13" Scale="2" Type="Edm.Decimal" sap:label="Montant pér.fin"/>
</EntityType>
Nop... doesn't work.
But as discussed in that blog : https://scn.sap.com/community/developer-center/front-end/blog/2015/09/16/smarttable-exampl
The next thing is the sap:visible="true" annotation at the properties of the EntityType. We need to set this attribute to make the property visible in the SmartTable.
So now, how can I set that parameter : sap:visible.
Regards
Hi,
have you take a look to the SAPUI5 Explored? - SAPUI5 Explored
There is an example with a mocked Metadata file... This guys has no "sap:visible" Annotaion to there Entity Properties...
And as you can see here: SAP Annotations for OData Version 2.0 | SCN
sap:visible is true by default...
But there EntityType isn't abstract like yours!
and there LineItem Annotation is different! It hast to be like this:
(your PropertyValue has an PropertyPath )
My guess is that the "sap:visible" Annotation makes Properties visible who has no sap:label
Regards
data : param_entity type ref to /IWBEP/IF_MGW_ODATA_ENTITY_TYP,
param_properties TYPE /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_T_MGW_ODATA_PROPERTIES,
param_property_s like line of PARAM_PROPERTIES,
param_property type ref to /IWBEP/IF_MGW_ODATA_PROPERTY.
super->define( ).
param_entity = MODEL->GET_ENTITY_TYPE( IV_ENTITY_NAME = 'ZEQ_YCMRES_CP_Q0025Parameters' ).
param_properties = param_entity->GET_PROPERTIES( ).
loop at param_properties into param_property_s.
param_property_s-PROPERTY->SET_FILTERABLE(
IV_FILTERABLE = ABAP_TRUE
).
endloop.
Hi Joseph,
we have the same Problem.
With an Vocabulary-Based Annotated Service we can't set the 'sap:label' Annotation to the Entity Properties and we can't add the Value Property to the LineItem.
The Vocabulary-XML still looks fine.
How did you get the 'sap:label' Annotation to your Entity Properties?
We are currently using a Service with SAP-Annotations (cause the Entity Properties are Language-dependent) and try to extend the MPC to get the LineItem Annotaions.
Best regards,
Ullrich
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joseph,
for the LineItem annotation youshould choose the complex type 'DataFieldForAnnotation':
Then you have both properties 'Label' and 'Target' at hand:
Now I only have to solve the 'sap:visible' riddle. I did not found out until now how to populate this through SEGW and I think you also have the same problem until now.
Cheers,
Mark
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.