cancel
Showing results for 
Search instead for 
Did you mean: 

Analytical List Page (ALP) - Visual AND Compact Filter (incl Value Help) on 1 field

freilinger
Participant
0 Kudos

Hello,

I am currently trying to make an ALP working on NW7.50 (Business Suite) (hopefully should not affect the question) with SAPUI5 1.52.

I managed to get a compact filter (including value) help working by defining the CommonValueList (without PresentationVariantQualifier)in my local annotation file for field F1.

I also managed to get a visual filter working by defining a Common ValueList (with PresentationVariantQualifier) in my local annotation file for field F2.

I am now struggling to make a compact filter (incl. value help) working for field F2 as well (or vica versa a visual filter for F1).

SAP Guidelines says, that for each visual filter there should be a compact filter as well (which makes sense). If I only specifiy the CommonValueList for the visual filter (using <PropertyValue Property="PresentationVariantQualifier" String="PVQualifier"/>) then the visual filter shows up and the compact filter as well (out of the box by the UI.SelectionField) but without value help (which is a must have on my opinion).

Bottom Line:

According to the guidelines I have to define two CommonValueLists, one with PresentationVariantQualifier (visual filter) and one without (compact filter with value help).

Am I correct and if yes, how do I have to implement this in my local annotation file? Simply adding both CommonValueLists doesn't work.

Accepted Solutions (1)

Accepted Solutions (1)

freilinger
Participant

Meanwhile I also received an example via different source.

So to answer the core question of this for everybody, the structure of your annotation has to look like this:

<Annotations Target="ZCOSTCENTERCOSTSQUERY0020_CDS.ZCOSTCENTERCOSTSQUERY0020Type/CostCenter">
	<Annotation Term="Common.ValueList">
		<Record>
                      ...
		</Record>
	</Annotation>
	<Annotation Term="Common.ValueList" Qualifier="VisualFilterItem">
		<Record>
			...
			<PropertyValue Property="PresentationVariantQualifier" String="Top3"/>
		</Record>
	</Annotation>
</Annotations>

The xml has to have two Common.ValueList annotations:

- The first one is for the value help of the compact filter. It is important to know that the Common.ValueList annotation here does not have a Qualifier plus the Record must not have a property PresentationVaraintQualifier.

- The second one, is for the visual filter. It is important that this one has got a Qualifier (in the example VisualFilterItem) plus a PresentationVariantQualifier.

Hopefully that helps someone running in the same question as at least for my understanding the entry in the SAP help for this topic might be misleading.

Best regards,

Sebastian

former_member657525
Participant

Thank you sebastian.freilinger-huber3 .

because of your answer i was able to solve similar issue 🙂

Answers (3)

Answers (3)

mdcastle
Active Participant

Hi Sebastian

I've copied your original question and added some answers prefixed with MC and shown in bold and italics to make it easier for you to see the answer.

- The ALP is based on a OData Service defined in the Back-End. -- MC Yes

- (this is the crucial one) The OData Service is based on an analytical model, which is implemented by an analytical CDS Query View (so it includes the Annotation @Analytics.Query: true) -- MC We have a variety of OData services, some published based upon an analytical query (@analytics.query: true) and some based upon a just a CDS view (e.g. @Analytics.datacategory: #CUBE). In this example the requirement to use associations means that @analytics.query: true was NOT used.

- The Query View selects the data from a CDS Cube View, which has assoziations to CDS Dimension Views -- MC a view annotated with @Analytics.query: true will always need to select from a view with the annotation @Analytics.datacategory: #CUBE

At least from my understanding, if I create an ALP, I want to process it via Analytical Engine as it looks to me like, this is the desired way by SAP. So I need the Annotation @Analytics.Query: true. I assume you do not have this in your scenario as well, because this annotation brings the following circumstances:

- I cannot use the option "Reference Data Source" in SAP Gateway as I get the error message, that I cannot use this for analytical scenarios. As it looks like, the analytical engine cannot deal with potential ABAP code implemented in the extension classes (which makes sense to me). -- MC I have only ever used @OData.publish: true in Fiori Elements. It's just easier!

- If I do not use this option in Gateway, I have to use Auto-Exposure (or is there another way?) to expose my Query CDS View. However if I am doing this, I have no SEGW project and therefore I have no extension classes for the data provider and model provider (so no DPC_EXT / MPC_EXT). To me it looks like you set this up differently, because you are explaining what to ad in the define() method of MPC_EXT. How did you manage this? -- MC When you used @OData.publish: true a Class based on the view is automatically created - look in SE24/SE80 for something like ZCL_ZCDS_xxxxxx where xxxxxx is the name of your published CDS view.

- Next you explain that you have an association in your CDS View to a Value Help View. If you set this up with an Analytic Query View from my perspective that is also not possible on Query Level, because I am not allowed to add associations for such a view in Eclipse with @Analytics.Query: true (Activation fails). Adding them on Cube Level has the disadvantage, that I have to add the specific fields (field by field) to my projection list to enable the Query View to use them. It is also not possible in the Query View to publish the whole association, which is coming from the Cube Level. You are writing here "However, the value helps in the Compact Filter are bespoke CDS Views referenced in the OData query." - So it would be very helpful for me, if you could point out how you activated that in Eclipse. -- MC where a search help is required we publish the cube as the OData service as the association as you correctly point out does not work when used in conjunction with @analytics.query: true. I have also found a better way of creating search helps - take a look at https://blogs.sap.com/2018/11/16/dropdown-list-in-fiori-elements/

So I am really wondering how you managed to do this. Do you have a CDS View without the Query.Analytics Annotation? If yes, do you have information that it is completely valid to also implement ALPs on "common" CDS Views (maybe based on your experience or SAP documentations? I am seriously wondering myself, if this is valid then probably the analytical engine is not called - are these cases performant?

I would be also very interessted in the question, if it is possible (and if yes how exactly?) to add a second OData Service to your ALP. This would generally make a lot of sense to me, because then I could use this to implement a ODataService based on common CDS (= no analytical CDS), where I could define several Entity Sets for the single Value Helps and use ther Reference Data Source option in Gateway for this second service. -- MC I haven't found a way in which two data sources can be displayed on the same ALP page. You could achieve this through an association which could be accessed from the navigation options in the ALP Table.

mdcastle
Active Participant

I have a number of instances where I have a Compact Filter (with value help) and Visual filter working for the same field. However, the value helps in the Compact Filter are bespoke CDS Views referenced in the OData query.

My annotations look something like this (which gets the visual filter working)

<Annotations Target="ZCDS_XXX_CDS.ZCDS_XXXType/AgeBand">
				<Annotation Term="Common.ValueListWithFixedValues" Qualifier="VF" Bool="true"/>
				<Annotation Term="Common.ValueList" Qualifier="CF">
					<Record Type="Common.ValueListType">
						<PropertyValue Property="CollectionPath" String="ZCDS_XXX"/>
						<PropertyValue Property="Parameters">
							<Collection>
								<Record Type="Common.ValueListParameterOut">
									<PropertyValue Property="LocalDataProperty" PropertyPath="AgeBand"/>
									<PropertyValue Property="ValueListProperty" String="AgeBand"/>
								</Record>
								<Record Type="Common.ValueListParameterIn">
									<PropertyValue Property="LocalDataProperty" PropertyPath="Band"/>
									<PropertyValue Property="ValueListProperty" String="Band"/>
								</Record>
								<Record Type="Common.ValueListParameterIn">
									<PropertyValue Property="LocalDataProperty" PropertyPath="CompanyName"/>
									<PropertyValue Property="ValueListProperty" String="CompanyName"/>
								</Record>
							</Collection>
						</PropertyValue>
						<PropertyValue Property="Label" String="Filter by Age Band"/>
						<PropertyValue Property="SearchSupported" Bool="false"/>
						<PropertyValue Property="PresentationVariantQualifier" String="FilterByAgeBand"/>
					</Record>
				</Annotation>
			</Annotations>

The value help on the Compact Filter is achieved by redefining the DEFINE method of the OData implementing class. The only down side to this is that the dynamic filtering that works well in the Visual Filter i.e. clicking one value in a Visual filter and having the other Visual Filters automatically update, doesn't work (not causing me a problem at the moment but it is on my 'to-do' list to correct).

METHOD define.

    super->define( ).
    DATA lo_annotation TYPE REF TO /iwbep/if_mgw_odata_annotation.
    DATA  lo_property TYPE REF TO /iwbep/if_mgw_odata_property.
    DATA  lo_entity_set TYPE REF TO /iwbep/if_mgw_odata_entity_set.
    lo_entity_set = model->get_entity_set( 'ZCDS_XXX' ).

    lo_annotation = lo_entity_set->create_annotation( 'sap' ).
    lo_annotation->add( iv_key = 'semantics' iv_value = 'fixed-values').
    DATA(lo_entitytype) = model->get_entity_type( 'ZCDS_XXXType' ).

    lo_entitytype->set_is_value_list( abap_true ).
    DATA(lo_txt_property) = model->get_entity_type( 'ZCDS_XXXType' )->get_property( 'AgeBand' ).
    lo_txt_property->set_value_list( /iwbep/if_mgw_odata_property=>gcs_value_list_type_property-fixed_values ).

ENDMETHOD.

In my CDS View I have an association defined to the Value Help CDS View which is referenced later in the same view

association [0..*] to ZCDS_H2L_VH_AGEBAND     as _AgeBand         on  $projection.AgeBand = _AgeBand.AgeBand

...............

@ObjectModel: { foreignKey.association: '_AgeBand', mandatory: true }
AgeBand

..............

@ObjectModel.association.type: [#TO_COMPOSITION_CHILD]
_AgeBand,

In the OData Service i have the following lines:

<Property Name="AgeBand" Type="Edm.String" MaxLength="5" sap:aggregation-role="dimension" sap:display-format="UpperCase" sap:label="Age Band" sap:value-list="fixed-values"/>

........................

<NavigationProperty Name="to_AgeBand" Relationship="ZCDS_XXX_CDS.assoc_B3E6595BFD9CEC697ADF5ED1B7B0DC63" FromRole="FromRole_assoc_B3E6595BFD9CEC697ADF5ED1B7B0DC63"ToRole="ToRole_assoc_B3E6595BFD9CEC697ADF5ED1B7B0DC63"/>

.......................

<EntityType Name="ZCDS_XXX_VH_AGEBANDType" sap:label="Age Band Value Help" sap:content-version="1">
<Key>
<PropertyRef Name="AgeBand"/>
</Key>
<Property Name="AgeBand" Type="Edm.String" Nullable="false" MaxLength="5" sap:display-format="UpperCase" sap:label="Age Band"/>
</EntityType>

I'm sure (hopefully) there is an easier way than this, however the above is an evolution of learning over the last few months!

freilinger
Participant
0 Kudos

Hi Mark Castle,

first of all I want to apologize my very late answer because of some other topics, where I had to focus on plus vacation.

Thanks a lot for your detailed explanaitions! I went through them and I am curious about a few things, you are writing.

It would be very nice, if you could help me.

Basically all my questions end in one conceptual question - so could you please have a look on my fundamental assumptions? From my understanding, if you create an ALP the overall architecture should always look like this:

- In WebIDE you obviously create the ALP.

- The ALP is based on a OData Service defined in the Back-End.

- (this is the crucial one) The OData Service is based on an analytical model, which is implemented by an analytical CDS Query View (so it includes the Annotation @Analytics.Query: true)

- The Query View selects the data from a CDS Cube View, which has assoziations to CDS Dimension Views

At least from my understanding, if I create an ALP, I want to process it via Analytical Engine as it looks to me like, this is the desired way by SAP. So I need the Annotation @Analytics.Query: true. I assume you do not have this in your scenario as well, because this annotation brings the following circumstances:

- I cannot use the option "Reference Data Source" in SAP Gateway as I get the error message, that I cannot use this for analytical scenarios. As it looks like, the analytical engine cannot deal with potential ABAP code implemented in the extension classes (which makes sense to me).

- If I do not use this option in Gateway, I have to use Auto-Exposure (or is there another way?) to expose my Query CDS View. However if I am doing this, I have no SEGW project and therefore I have no extension classes for the data provider and model provider (so no DPC_EXT / MPC_EXT). To me it looks like you set this up differently, because you are explaining what to ad in the define() method of MPC_EXT. How did you manage this?

- Next you explain that you have an association in your CDS View to a Value Help View. If you set this up with an Analytic Query View from my perspective that is also not possible on Query Level, because I am not allowed to add associations for such a view in Eclipse with @Analytics.Query: true (Activation fails). Adding them on Cube Level has the disadvantage, that I have to add the specific fields (field by field) to my projection list to enable the Query View to use them. It is also not possible in the Query View to publish the whole association, which is coming from the Cube Level. You are writing here "However, the value helps in the Compact Filter are bespoke CDS Views referenced in the OData query." - So it would be very helpful for me, if you could point out how you activated that in Eclipse.

So I am really wondering how you managed to do this. Do you have a CDS View without the Query.Analytics Annotation? If yes, do you have information that it is completely valid to also implement ALPs on "common" CDS Views (maybe based on your experience or SAP documentations? I am seriously wondering myself, if this is valid then probably the analytical engine is not called - are these cases performant?

I would be also very interessted in the question, if it is possible (and if yes how exactly?) to add a second OData Service to your ALP. This would generally make a lot of sense to me, because then I could use this to implement a ODataService based on common CDS (= no analytical CDS), where I could define several Entity Sets for the single Value Helps and use ther Reference Data Source option in Gateway for this second service.

Thanks once again for sharing your information, I am really looking forward to your answers!

Obviously if someone else with ALP knowledge jumps in, I also would highly appreciate this.

Best regards,

Sebastian

freilinger
Participant
0 Kudos

Hi Mark Castle,

thanks a lot for your information and experience sharing. We will try out your points as soon as possible and I will then inform you about our outcome 🙂 !

However two things directly come to my mind:

Performance

You said, that you sometimes use Query Views and sometimes Cube Views for your OData Service. As far as I know, the Analytics.Query:true Views are processed via the Analytical Engine. I am not sure about the @Analytics.datacategory: #CUBE Views...

In most of our scenarios, a lot of data is involved and we have to make sure, that this works in a performant way, so using the Cube View would not really be an option, if then the Analytical Engine is not used. Do you know if it is also used for @Analytics.datacategory: #CUBE Views?

Generated MPC Class

You said, that there are classes generated even though you use Auto-Exposure. You are correct and those inherit either from CL_SADL_GTK_EXPOSURE_MPC (no Analytics.Query Annotation) or CL_NAT_ODATA_MODEL_ABS (when CDS View has Analytics.Query Annotation). In both cases they contain the method Define, which I could redefine. I am just wondering: These classes are no extension classes, so I assume they are re-generated all of the time when I re-generate the OData Service (so when I active the OData.publish:true CDS View). Is this correct? That would mean, I lose my code each time I activate CDS. Also considering transport this could be problematic, because during the import phase I think also some generation of the service takes place, which would also mean that my code is lost when the class is generated new. Do you now something about these aspects?

Thanks in advance and best regards,

Sebastian

0 Kudos

Hi,

Any Solution found for Search help in Analytical List Page?