9

Fiori Element CDS MATNR Search without leading zeroes?

 1 year ago
source link: https://answers.sap.com/questions/13888170/fiori-element-cds-matnr-search-without-leading-zer.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
10 hours ago

Fiori Element CDS MATNR Search without leading zeroes?

18 Views

Hello!

We want to search for matnr without adding leading zeroes in the search. We have created a CDS view with annotation for search for matnr (ArticleNumber) and ean11 (GlobalTradeItemNumber). When searching for matnr we only get matches when adding leading zeroes in the search. When we search for ean11 it works without leading zeroes. Both are CHAR18 but have different search behavior.

Please advice, thanks in advance!

@AbapCatalog.sqlViewName: 'ZCARTICLES'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Consumption view article'

@VDM.viewType: #CONSUMPTION

@Search.searchable: true

@UI.headerInfo.typeName: 'Article'
@UI.headerInfo.typeNamePlural: 'Articles'


define view ZC_Articles as select from YI_ArticleTest

{
    
    @UI.lineItem: [{position: 10}, {label: 'Article Number'}]
    @UI.selectionField: [{position: 10}]
    @UI.identification: [{position: 10}]
    @Search.defaultSearchElement : true    
    @Search.fuzzinessThreshold : 1
    @Search.ranking : #HIGH 
    key ArticleNumber,
    @UI.lineItem: [{position: 20}, {label: 'GTIN'}]
    @UI.selectionField: [{position: 20}]
    @UI.identification: [{position: 20}]
    @Search.defaultSearchElement : true    
    @Search.fuzzinessThreshold : 1     
    @Search.ranking : #HIGH 
    key GlobalTradeItemNumber,
    @UI.identification: [{position: 30}]
    MerchandiseCategory,
    @UI.lineItem: [{position: 30}]
    @UI.selectionField: [{position: 30}]
    @UI.identification: [{position: 40}]
    MerchandiseCategoryDescription,
    @UI.identification: [{position: 50}, {label: 'Category'}]
    @UI.lineItem: [{position: 40}]
    @Search.defaultSearchElement : true  
    @Search.fuzzinessThreshold : 0.9        
    @Search.ranking : #MEDIUM  
    ArticleDescription,
    @UI.identification: [{position: 60}, {label: 'Description'}]
    @Search.defaultSearchElement : true  
    @Search.fuzzinessThreshold : 0.9        
    @Search.ranking : #LOW  
    AlternativeText,
    @UI.identification: [{position: 70}]
    Supplier,
    @UI.identification: [{position: 80}]
    @UI.lineItem: [{position: 50}, {label: 'Supplier'}]
    @UI.selectionField: [{position: 40}]
    SupplierName,
    @UI.identification: [{position: 90}, {label: 'Brand'}]
    @UI.lineItem: [{position: 60}]
    @UI.selectionField: [{position: 50}]
    @Search.defaultSearchElement : true    
    @Search.fuzzinessThreshold : 1    
    @Search.ranking : #HIGH 
    Brand
    
}




About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK