cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown in Fiori for Fields created by transaction /SCFD_EUI

abapdanny
Explorer
0 Kudos

Hi guys,

we brought our custom fields on to foiri by transaction SCFD_EUI. So far so good. Now we want the value help as dropdown. I saw on a couple of blog posts, that these can be done by annotation @ObjectModel.resultSet.sizeCategory: #XS

Unfortunately that doesn't work for us. SAP generated in transaction SCFD_EUI the following code for us (Code-View and Text-View)

@AccessControl.authorizationCheck: #NOT_REQUIRED
 @EndUserText.label: 'Zentrenaktenstatus Code'
 @AbapCatalog.sqlViewName: 'ZF4_ZZ_PRJSTAT_C'
 @Search.searchable
 @ObjectModel.compositionRoot: true
 @ObjectModel.usageType.serviceQuality: #A
 //@ObjectModel.usageType.sizeCategory: #S
 @ObjectModel.resultSet.sizeCategory: #XS
 @ObjectModel.usageType.dataClass: #CUSTOMIZING
 @Analytics.dataCategory: #DIMENSION
 @ObjectModel.representativeKey: 'Code'

 define view ZF4_FIORI_ZZ_PRJSTAT_CODE
   as select from zitml_projsta
   association [0..*] to ZF4_FIORI_ZZ_PRJSTAT_TEXT as _Text
     on $projection.Code = _Text.Code
 {
   @ObjectModel.text.association: '_Text'
   @Search.defaultSearchElement: true
   key cast( prjstat as zitml_projaktstat ) as Code,
   @ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
   _Text 
 }
@AccessControl.authorizationCheck: #NOT_REQUIRED
 @EndUserText.label: 'Zentrenaktenstatus Text'
 @AbapCatalog.sqlViewName: 'ZF4_ZZ_PRJSTAT_T'
 @ObjectModel.resultSet.sizeCategory: #XS
 @Search.searchable
 @ObjectModel.usageType.serviceQuality: #A
 //@ObjectModel.usageType.sizeCategory: #S
 @ObjectModel.usageType.dataClass: #CUSTOMIZING
 @ObjectModel.dataCategory: #TEXT
 @ObjectModel.representativeKey: 'Code'

 define view ZF4_FIORI_ZZ_PRJSTAT_TEXT
   as select from zitml_prjst_tx
   association [0..*] to ZF4_FIORI_ZZ_PRJSTAT_CODE as _Code
     on $projection.Code = _Code.Code
   association [0..1] to I_Language as _Language
     on $projection.Language = _Language.Language
 {
   @Search.defaultSearchElement: true
   key cast( prjstat as zitml_projaktstat ) as Code,
   @Semantics.language: true
   @ObjectModel.foreignKey.association: '_Language'
   //
   key spras as Language,
   //
   //key $session.system_language as Language,
   @Search.defaultSearchElement: true
   @Semantics.text: true
   beschreibung as Description,
   @ObjectModel.association.type: [#TO_COMPOSITION_ROOT, #TO_COMPOSITION_PARENT]
   _Code,
   _Language
 }

I added @ObjectModel.resultSet.sizeCategory: #XS and commented //@ObjectModel.usageType.sizeCategory: #S. That doesn't work. You guys have any idea, how to implement dropdown in this coding?Thank you in advance and BR Daniel

View Entire Topic
abapdanny
Explorer
0 Kudos

Hi guys,

first of all, thank you for all your answers! In the end we found a solution. Unfortunatly we had to do it directly in ABAP, as somehow your proposed solutions didn't work. Please dont ask me why...

So what have we done? For the above mentioned example we added the following code into an enhancement at the end of the method CL_MD_CUSTOMER_MAST_02_MPC_EXT~DEFINE

lo_property = model->get_entity_type( gc_c_businesspartnercusttype )->get_property( 'ZZ_PRJSTAT' ).
lo_property->set_value_list( /iwbep/if_mgw_odata_property=>gcs_value_list_type_property-fixed_values ).

After the change we had to run report /UI5/UPD_ODATA_METADATA_CACHE.

After that, we got Dropdowns in our BP-Fiori App.