Tuesday, 2 January 2018

How to add value help for parameter in ABAP CDS Analytical Query

In this post I would like to share trick for adding value help to parameter in analytical query.

Parameters in ABAP CDS view could be used as mandatory, single value variable, which could be used when split of calculation logic required. By default parameters don’t have value help, like filtration option based on fields at consumption level.

Step-by-step:


I. Create ABAP CDS view for dictionary based on table or some dummy table

SAP ABAP CDS Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Live

SAP ABAP CDS Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Live

II. Create ABAP CDS cube with required logic.

SAP ABAP CDS Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Live

Notes:

◈ For demo I use just select form T000 table.
◈ There is parameter p_par used in logic.
◈ This parameter is not linked to any of fields in ABAP CDS view.

III. Create ABAP CDS analytical query with required logic.

SAP ABAP CDS Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Live

Notes:

◈ Usually all needed associations are created at cube level, but at this case I suppose it is possible to make exception
◈ Don’t forget to code name of field in association
◈ Don’t forget to add consumption view type
◈ Now I couldn’t make texts visible for value help, but to have value help for key values is much more better compared to free field option for parameter
◈ User can manually enter value not from value help, restriction is not guaranteed

IV. Result query in Analysis for Excel. Value help button exist.

SAP ABAP CDS Guides, SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Live

For simple parameter dictionaries this approach could be useful.

No comments:

Post a Comment