Showing posts with label ABAP CDS view. Show all posts
Showing posts with label ABAP CDS view. Show all posts

Wednesday, 10 July 2024

ABAP CDS Select from dynamic data source

I faced a little problem while reporting in Fund Management (FM) module as the tables are generated automatically while creating derivation rules with dynamic names and differs by system /client.

The rule entries are stored in the generated table "FMFMOAXXXYYYZZZZ", where XYZ symbols means as follows:

  • XXX is the system specification (e.g., DE1 or QE1)
  • YYY is the client number (e.g., 120 or 200)

ZZZZ is the number of the derivation rule (which you should have as per your table 31, 51, 64, or 61)

To be able to move my report / solution I had to selecting from dynamic source which is not supported in CDS!

Monday, 1 July 2024

SAP Datasphere: Replicating Custom CDS Views from S4 HANA to Azure Data Lake with CDC

Introduction


In this article I will share work experiences of using a custom CDS view on Joining BKPF and BSEG table in S4HANA and consuming it in SAP Datasphere for delta enabled replication (Change Data Capture) to Azure Data Lake Storage Gen2.

SAP Datasphere: Replicating Custom CDS Views from S4 HANA to Azure Data Lake with CDC

Create a Custom CDS View: ADT on Eclipse


Go to ABAP Repository Object and Click on the drop down for Core Data Services and then click on Data Definitions:

Monday, 24 June 2024

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View

Introduction


Just Ask is a feature in SAP Analytics Cloud which is powered by Generative AI and allows users to ask questions in natural language and receive visualizations and insights based on the data available in SAP Analytics Cloud.

This feature uses machine learning and natural language processing to understand and interpret user questions and provide relevant data visualizations and insights. This allows users to easily access and interact with data without needing to have expertise in data analysis or querying languages.

Availability and Roadmap


Just Ask -initial release is available from QRC Q1 2024 in all SAP Analytics Cloud (SAC) tenants hosted on Cloud Foundry (AWS), Google Cloud Platform, and Microsoft Azure. It is not available for tenants hosted on Neo or AliCloud environments.

Currently, Just Ask works with data from acquired models and Live SAP Datasphere models and supports English language.

Just Ask vs Search to Insight - Is it just rebranding?


Some frequently asked questions that I have observed. The 'Just Ask' feature resembles the 'Search to Insight' feature, what sets them apart? Is it merely a rebranding of the same feature?

Short Answer - No, they are not same.

Detailed Answer - Even though Search to Insight and Just Ask address the same audience and process natural language queries to present data in graphs/charts the difference lies in the core NLQ technology used in Just Ask. Just Ask leverages AI models to provide more relevant results. Another big difference that I see is in the control and refinement options that Just Ask provides to the admins which is not there in Search to Insight. Details below:

Some features that set Just Ask apart from Search to Insight and are not available in the latter:

  • Central place to define models to be enabled as searchable - this reduces ambiguity (say models with same name) and also if the models are not fully ready or partially released or may not have refine data.
  • Define synonyms and rules to refine results - example if the typed question by user includes "by year" or say "current month" then admin can define a rule to restrict data to the "current year", "current month" etc. depending on the model in question and business requirements.
  • Create questions (search queries) presented as recommendations to end users
  • Based on AI models (LLM) and use embeddings

In Search to Insight by default all the models were included, no option in Search to Insight to configure/refine models/result by leveraging synonyms/rules/questions.

Enabling Just Ask


SAP Analytics Cloud tenant admin can enable the feature from the below path and can be easily accessed from the top toolbar icon

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure1

◉ System--> Administration--> Default Appearance
◉ Under Home Screen Tile - Set Conversational Analytics to ON
◉ Under Conversational Analytics section - Switch default mode from Search to Insight to Just Ask

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 2

Consuming S/4HANA ABAP CDS View in SAP Analytics Cloud


Now to understand how to configure a model for Just Ask, I have used a standard ABAP CDS View to create a model in SAC and enable it for Just Ask.

The standard ABAP CDS View I am using is Material Stock for Key Date (C_MaterialStockByKeyDate).

Structure of SAC model on top of ABAP CDS View:

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 3

Data in the model

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 4

Note: Please refer SAP help on SAP Analytics Cloud on how to import ABAP CDS views from S/4HANA to SAP Analytics Cloud or many great blogs already written on this topic.

Launching Just Ask


Click the Idea /Bulb button from the toolbar (refer Figure1 above).

Customizing Just Ask:

On the Just Ask screen admins can add free text using "edit description" to maintain description about Just Ask or general information for the end users.

Example - I have maintained to share what models have been indexed or available. Another example - One can maintain models from a particular project or business area which are available for Just Ask.

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 5

Configuring Model for Just Ask

Just Ask screen when the model is not indexed.

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 6

There are two options available:

Option 1--> Add the model directly to the current session OR

Option 2--> Index the model using Manage Models option (top right) to make it available for the users

Note: In above screenshot - Material Stock is not indexed yet and that is why it is not in the list of indexed models.

Option 1 --> Add Model directly to Just Ask for the current session - The model added, will not be available after the end of current session.

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 7

After adding the model

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 8

Immediately, Just Ask will suggest the dimensions and measure available in the model. Example - Asking a question on Stock by Plant and Base Unit of Measure generates below chart.

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 9

Option 2 - Indexing the model

Follow steps as shown to index the model

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 10

After the model is indexed

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 11

Defining Synonyms

After defining synonyms for the fields.

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 12

Note - Admins should align model selection and synonym/rule definition with key users, as they are more familiar with the terms commonly used.

Synonyms for the values in the Plant field.

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 13

Defining Rules: Simply put rules are like logic which gets executed when certain conditions are met.

Example - If the prompt has Stock Quantity then show results with Plant , Base UOM and Stock for 01.01.2024 to 11.06.2024 and for only US Plant.

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 14

Output after testing the Rule:

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 15

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 16

Note: It is always recommended to test the rule and make adjustments to get desired output before publishing it.

Sample Questions:

Just Ask also provides a great feature to create "Sample Questions" for a model. This feature allows admins to create sample questions (queries), helping users explore available data and fields easily. It's a quick start to get users comfortable with the data in the model and boost adoption. This is another way to customize Just Ask for the end users.

Creating Sample Questions:

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 17

Sample Questions created for the model:

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 18

Result and the list of Suggestions and other Sample Questions:

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 19

Indexed Model related setting:

An indexed model can be disabled as searchable for Just Ask. Some examples when this option can be used:

  • Model is indexed however, configuration (synonyms /rules etc.) is still work in progress OR
  • Model is no longer required OR
  • Is not fully ready yet

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 20

Just Ask in Action

Now as the model is now indexed and configured by defining synonyms and rules, let's see Just Ask in action. The Material Stock model is now available under indexed models.

Case 1: Here Inventory and Production Facility both are synonyms and as per the rule defined results are filtered out to show only US Plant and between January 2024 to June 2024

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 21

Case 2: For this case rule was disabled. In this case Quantity, Location, US are all Synonyms defined in the model configuration, where Quantity --> Stock Quantity, Location--> Storage Location and US --> Plant 1 US

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 22

Case 3: Searching by synonyms defined for the data values. Here synonym "Cake" was created for Materials filtered in the query generated.

Next time "Just Ask": Simplifying Data Exploration - Configuration using a standard ABAP CDS View
Figure 23

Conclusion

In conclusion, Just Ask offers advanced NLQ technology and greater control for administrators compared to Search to Insight. These features reduce ambiguity and improve relevance while providing more customization and flexibility in presenting data to end users, making Just Ask a more powerful tool for natural language query processing.

Monday, 6 May 2024

Fiori PO Approver app Accept and Reject button customization from ECC backend

Many time there are custom requirements for which it requires the need of creating Enhancement in standard SAP functionality.

Overview: PO Approvers are maintained in Release Strategy. Once the PO is generated it is set to be approved by PO approvers based on the levels maintained in PPOME structure. Only then the PO will be set to 03 status in EKKO.

Pre-requisite: All the roles and authorization must be given to the approvers to access the PO Approval Tile in SAP Fiori.

Friday, 2 February 2024

Tip: SAP GUI Scripting VBA Code Snippet to Detect all IDs of the UI Elements

In a few cases it is in business context not allowed to install additional analyze software or tools. So applications that are permissible and available must be used, e.g. like Microsoft Office applications. This makes things a bit more laborious, but not impossible.

Here a Visual Basic for Application (VBA) example to detect all IDs of the UI Elements of a session of the SAP GUI for Windows with SAP GUI Scripting. The result is written into a Microsoft Excel table.

The sub routine Start connects to the session and calls the recursive sub routine GetAll, which detects all IDs. The global variable gColl stores all IDs as an array of strings.

Wednesday, 31 January 2024

MDG DQM: Troubleshooting DQM validation rules for central governance - Product Master S/4 HANA

INTRODUCTION


In this blog post we will cover a few steps on how we can troubleshoot the BRF+ validations which is the underlying framework for MDG DQM. This module of MDG is still evolving rapidly as we move towards cloud first and a clean core approach. As MDG developers we are still pretty comfortable with classical BADI's for doing validations and we all know it's quite easy to troubleshoot the rules. But when it comes to DQM we might wonder how do my rules get called? how can i troubleshoot my rules if they are not working as expected? 

So let's see how we can troubleshoot the rules.

Saturday, 16 December 2023

Release News 2308: Enumerations in ABAP CDS

This blog post explains the new ABAP CDS enumerations.

Release info

  • 2308 SAP BTP ABAP Environment
  • ABAP Release 7.58
  • SAP S/4HANA 2023

Creating a CDS enumerated type


In ADT, an enumerated type is created as a repository object of the type Type. 

Saturday, 2 September 2023

ALV IDA Using CDS View Long Text using (Calculation Field)

Mostly people facing problem to how to use long text using function module, Call class in CDS while creating ALV IDA from CDS View. In this blog I will share my knowledge of ALV IDA Using CDS View and ALV IDA Calculation field (Mostly is used for virial element). Using Calculation Field in this blog I am going to display Long Text and Other Field

In this blog I will focus on below points.

1. Create CDS View (Generic) with 2 or 3 fields.
2. Create class with interface calculation field.
3. Long Text working in method
4. Creation of ALV IDA Program