TECHNICAL GYAN GURU https://technicalgyanguru.com All SAP information on 1 place Sat, 21 Sep 2024 12:31:32 +0000 en-US hourly 1 https://wordpress.org/?v=6.7 https://technicalgyanguru.com/wp-content/uploads/2024/04/cropped-cropped-technical--32x32.png TECHNICAL GYAN GURU https://technicalgyanguru.com 32 32 SAP XI/PI – Invoice Attachment Transfer from ARIBA to VIM https://technicalgyanguru.com/sap-xi-pi-invoice-attachment-transfer-from-ariba-to-vim/?utm_source=rss&utm_medium=rss&utm_campaign=sap-xi-pi-invoice-attachment-transfer-from-ariba-to-vim https://technicalgyanguru.com/sap-xi-pi-invoice-attachment-transfer-from-ariba-to-vim/#respond Fri, 08 Nov 2024 08:15:00 +0000 https://technicalgyanguru.com/?p=6116 The documents that are connected to the invoice in the Ariba Network system should be transferred to the VIM system via PI Integration as part of the Ariba Supplier Invoice…

The post SAP XI/PI – Invoice Attachment Transfer from ARIBA to VIM first appeared on TECHNICAL GYAN GURU.

]]>
The documents that are connected to the invoice in the Ariba Network system should be transferred to the VIM system via PI Integration as part of the Ariba Supplier Invoice process. From there, the attachment can be viewed from the VIM workspace transaction /OPT/VIM_WP.

Only Ariba network PDF invoices are accepted by VIM, allowing them to accurately supply goods, materials, and services. Beginning with Ariba cloud integration version CI9, Ariba supports BASE64-encoded data and has included a document transfer feature.

PI Mappings and UDF’s Used:

PI mappings for attachment fields in IDOC

Below UDF’s are used in PI Mappings

1. GETATTACHMENTATTRIBUTES

2. GETATTACHMENTCONTENT

3. SPLITATTACHMENTCONTENT

S/4HANA Setting up:

The comprehensive setup instructions needed to activate the document transfer feature are listed below.

Step 1: Create custom document types beginning with Z in t-code OAC2, as indicated below.

Step 2: Next, link these custom document types to the business entity using t-code OAC3.

Type of Object: /OPT/V1001
Type of Document: Z_DOC
Link Condition: X
Link Condition: X
CA Storage System (It is “MA” according to guidelines; client-to-client variations may occur. Basis designed the storage system name as CA.)
url: TOA01
Retention as of: Null or blank

The aforementioned procedures will be carried out by BASIS, although BASIS needs feedback from the technical team.

Step 3: Ariba offers a single standard IDOC extension/ARBA/INVOICE for handling invoice attachments.

Set up WE81’s extension/ARBA/INVOICE against the INVOIC message type.

Improving the VIM Class to Manage ARIBA Documents:

As can be seen below, a Registration ID was formed in VIM against the IDoc once it had been successfully generated.

If the VIM process code is set in the WE20 partner profile, the same registration ID (ex:344) ought to show up in the VIM inbound work place tcode /OTX/PF03_WP.

After submitting the registration ID on tcode /OTX/PF03_WP, a DP document will be generated in the VIM workspace.

Standard Ariba document archiving can be triggered via the VIM class /OTX/PS03_CL_VIM_MODULE_IDOPDF method PROCESS_MODULE. This method can also be used to archive bespoke documents attached from the Ariba network.

Reading attachment content from IDOC and manually putting it in the CA content repository is how all Ariba invoices are automatically generated, following the same procedure as ordinary Ariba documents.

You can access the ARIBA documents that are connected here. Only PDF documents are supported by VIM.

Please feel free to ask questions in the space provided below if you need any help understanding any of the tutorial’s sections. We make an effort to respond to every question.

Please share your thoughts.

Let’s Web Dynpro. Part IV

The post SAP XI/PI – Invoice Attachment Transfer from ARIBA to VIM first appeared on TECHNICAL GYAN GURU.

]]>
https://technicalgyanguru.com/sap-xi-pi-invoice-attachment-transfer-from-ariba-to-vim/feed/ 0 6116
Attachments for SAP XI/PI – ARIBA Invoices sent via PI to S/4HANA https://technicalgyanguru.com/attachments-for-sap-xi-pi-ariba-invoices-sent-via-pi-to-s-4hana/?utm_source=rss&utm_medium=rss&utm_campaign=attachments-for-sap-xi-pi-ariba-invoices-sent-via-pi-to-s-4hana https://technicalgyanguru.com/attachments-for-sap-xi-pi-ariba-invoices-sent-via-pi-to-s-4hana/#respond Thu, 07 Nov 2024 08:26:00 +0000 https://technicalgyanguru.com/?p=6119 Integration with SAP systems has never been more intriguing, especially with Ariba, Workday, Concur, Successfactors, Fieldglass, Hybris, and other satellite cloud solution vendors banging on doors every day. 🙂 I…

The post Attachments for SAP XI/PI – ARIBA Invoices sent via PI to S/4HANA first appeared on TECHNICAL GYAN GURU.

]]>
Integration with SAP systems has never been more intriguing, especially with Ariba, Workday, Concur, Successfactors, Fieldglass, Hybris, and other satellite cloud solution vendors banging on doors every day. 🙂 I just had the chance to work on a SAP PI-based ARIBA to SAP connectivity. Without SAP PI, we can also integrate Ariba with SAP. However, we’ll examine how PI functions in the midst today.

The subject has been separated into the following sections: Introduction; S4 HANA Configurations; PI Mappings and UDFs Used; and BADI Implementation.

Introduction: The documents that are connected to the invoice from the ARIBA supplier system should be transmitted to the S/4HANA system via PI connectivity so that it may be opened from the MIR4 transaction as part of the ARIBA supplier invoice process.

Drawings, photos, or documents in any format attached by the provider via the ARIBA network may be included in the invoice file format. He would be able to accurately supply goods, materials, and services with these attachments. The document transmission feature was added by ARIBA starting with cloud integration version CI9. Data encoded in BASE64 is sent and received by ARIBA.

UDFs and PI Mappings Employed:

Please refer to the PI mappings listed below for every field in the IDOC attachment segments.

Utilizing UDFs in PI mappings

Now let’s examine a few of the UDFs this interface makes use of. It should be noted that UDF stands for User Defined Function.

  • GETATTACHMENTATTRIBUTES
  • GETATTACHMENTCONTENT
  • SPLITATTACHMENTCONTENT

S/4HANA Setting up:

The comprehensive setup instructions needed to activate the document transfer feature are listed below.

Step 1: Create special document types in t-code OAC2 as indicated below:

Step 2: Next, using the ARIBA guidelines listed on page 142, link these new document types to Business object BUS2081 using t-code OAC3.

Kind of Object: BUS2081
Type of Document: Z_DOC, Z_PDF, Z_XLS
Link Condition: X
System of Storage: Z1 (It is “MA” according to guidelines; client-to-client variations may occur. Basis generated storage system name Z1)
url: TOA01
Retention as: Null or blank

The technical team must supply inputs to BASIS so that it can execute the aforementioned procedures.

Step 3: One standard IDOC extension/ARBA/INVOICE is supplied by ARIBA for handling invoice attachments.

Set up WE81’s extension/ARBA/INVOICE against the INVOIC message type.

BADI Application:

Use the BADI INVOICE_UPDATE function to implement the code.Modify Prior to Update

To retrieve the content of the invoice attachment from the archive link, use the standard ARIBA FM/ARBA/ARCHIVE_IDOC_ATTACH.

IDOC will be created with the content of the attachments as indicated below:

You can check the attachments in MIR4 transaction.

I’ve attempted to include every detail. If you are still experiencing problems, don’t hesitate to ask inquiries in the part below the comments. I shall reply to you.

The post Attachments for SAP XI/PI – ARIBA Invoices sent via PI to S/4HANA first appeared on TECHNICAL GYAN GURU.

]]>
https://technicalgyanguru.com/attachments-for-sap-xi-pi-ariba-invoices-sent-via-pi-to-s-4hana/feed/ 0 6119
11 Steps to Include a New Field in an Already-Existing SAP LSMW Batch Input Recording https://technicalgyanguru.com/11-steps-to-include-a-new-field-in-an-already-existing-sap-lsmw-batch-input-recording/?utm_source=rss&utm_medium=rss&utm_campaign=11-steps-to-include-a-new-field-in-an-already-existing-sap-lsmw-batch-input-recording https://technicalgyanguru.com/11-steps-to-include-a-new-field-in-an-already-existing-sap-lsmw-batch-input-recording/#respond Wed, 06 Nov 2024 20:22:00 +0000 https://technicalgyanguru.com/?p=6122 Alright. Why in the world do we care about LSMW in this paper when S/4HANA migration cockpit should ideally replace it? 🔥🎥 The simple answer is that not all people…

The post 11 Steps to Include a New Field in an Already-Existing SAP LSMW Batch Input Recording first appeared on TECHNICAL GYAN GURU.

]]>
Alright. Why in the world do we care about LSMW in this paper when S/4HANA migration cockpit should ideally replace it? 🔥🎥 The simple answer is that not all people work on S/4HANA projects. 👍👍 You heard correctly. Though you may have heard of BTP, cloud computing, etc., the truth is that some clients are still not even using HANA databases, let alone S/4HANA. 🙏 Furthermore, LSMW remains active and vibrant. 😄😀

I can say with absolute certainty that tomorrow, if not today, a consultant in some corner of the SAP globe will need to add a new field to an already-existing LSWM. We continue with this tutorial with that belief. 🧡🤡

Assume you have successfully constructed an LSMW Batch Input Recording. Your client requests that you include a different field (from the same screen) in your recording one lovely morning. Thus, your initial thought might be to add the additional field to your recorder and restart recording your procedure. 💡💡 Why start from scratch again? We wish to demonstrate to you in this comprehensive lesson how to add a new field quickly and easily without having to record the entire procedure over.

Example Scenario:

Let’s say we want to delete the data for the “Date of Last Goods Movement” and add a new field from T-Code IQ02 to our recording.

  1. Open T-Code LSMW, select the project, subproject, and object you want to add a new field to, then hit the toolbar’s Continue button (F8).
  1. Select “Define Object Attributes” on the following screen, then hit Execute from toolbar (or Ctrl + F8).
  1. To examine all of your recordings, select the “Recordings: Overview” button located in front of your recording name on the following screen.Click Edit Recording (or Ctrl + F2) from the toolbar after choosing the name of your recording. You must now add your new field to this list in order to view all of the action that has been logged here. Keep in mind that the new field needs to be on the screen that you previously recorded.

4- At this point, you should enter the T-Code (IQ02 in our example) for which you want to add a new field to your recording and locate the field you wish to edit (Date of Last Goods Movement).To access the Assistant page, click F1 and then select “Technical Information.” The Technical Information page should seem as follows to you.

If all of the data in the “Field Description for Batch Input” on this page matches the data you recorded in the previous step, duplicate the “Dynpro Field” for the following step.

Return to the Edit Recording screen. Using the data from the previous step, choose the Program Name and Screen Number. Then, click More -> Edit -> Add Dynpro Field (Extended) (or Ctrl + Shift + F4). You now need to fill in the Screen Field box with the saved data from the previous stage and click Continue (Ent).er).

6-Once the new field has been added to your screen, double-click it. On the resulting page, provide the requested information while keeping the Default Value clear and uncluttered. Next, carry on.

7- You may now save the recording process after adding your new field to your procedure. However, we still have some work to do to finish our voyage.

8-To add a new field to the input source, select the “Define Source Fields” step after returning to the Process phase. To modify the input structure, click the change button and select Table Maintenance from the toolbar (Ctrl + F9).

9- We need to add a new line to the source table in the new page based on our new field, as seen in the image below. Save the table now, then return to the process phase.

10- You should choose “Define Field Mapping and Conversion Rules” as the final step to finish our work and upload the new field mapping. Click Change and choose the newly added field from the new page. Select Source Field now using the Toolbar.

11–On the Assign Source Field page, select the new field and press Enter. Click Continue after disregarding any warning messages that may appear. You can now save this step as well.

12- That’s all there is to it. You have successfully added a new field to your LSMW Batch Input Recording, and it is now ready for testing.

What is the process for moving your revised LSMW from Quality to Production?


When everything functions as it should, transmit it to the P server. You can accomplish this in two ways. Either option two or the same procedure on P server can be done first. The project must be exported from this server and imported to a new server as a backup option. To export the project, navigate back to LSMW T-Code, enter your project, subproject, and object once more, then select More -> Extras -> Export Project (or press Ctrl + F8) to save it to your local computer.

Thank You for your valuable time.

Let’s Web Dynpro. Part V

The post 11 Steps to Include a New Field in an Already-Existing SAP LSMW Batch Input Recording first appeared on TECHNICAL GYAN GURU.

]]>
https://technicalgyanguru.com/11-steps-to-include-a-new-field-in-an-already-existing-sap-lsmw-batch-input-recording/feed/ 0 6122
Section 16 of CDS: Utilizing Built-In Features in CDS IV https://technicalgyanguru.com/section-16-of-cds-utilizing-built-in-features-in-cds-iv/?utm_source=rss&utm_medium=rss&utm_campaign=section-16-of-cds-utilizing-built-in-features-in-cds-iv https://technicalgyanguru.com/section-16-of-cds-utilizing-built-in-features-in-cds-iv/#respond Tue, 05 Nov 2024 06:27:00 +0000 https://technicalgyanguru.com/?p=5493 We have discussed SQL functions, unit/currency conversion functions, and date functions in our Built In Functions in CDS section; however, we did not cover the Time function. We’ll pick up…

The post Section 16 of CDS: Utilizing Built-In Features in CDS IV first appeared on TECHNICAL GYAN GURU.

]]>

We have discussed SQL functions, unit/currency conversion functions, and date functions in our Built In Functions in CDS section; however, we did not cover the Time function. We’ll pick up where we left off in the previous post today. Now let’s dive right into what may be the final installment of this Built-In Functions series.

Let’s go over the Time Functions in this post. It will be quite easy to go through the four functions indicated below with Time.

  • Time Is Valid
    It is necessary to pass a single parameter. It is imperative that the field type be TIMESTAMP – DEC – Length 15.The remaining features of this blog operate in the same way.
  • UTC HOUR
    The best thing about this is that no parameters are required. Provides the Coordinated Universal Time (UTC) by default.
  • ADD A SLEEP
    The result is the total of the numbers when, as the name implies, we add the seconds to the timestamp.
  • SLITS IN BETWEEN
    We had days between in our last issue, remember? There are now seconds in between.

It is improper to violate customs.How come the Code isn’t available to us?

@AbapCatalog.sqlViewName: 'ZTM_FNS_SQL_V'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Time Functions'
define view ZTM_FNS as select from zdt_concr_rept as a{
    key a.rpt_id as RPT_Comment,
    a.ztime as RPT_TMSP,
    tstmp_is_valid(a.ztime) as valid1,   
    tstmp_current_utctimestamp() as UTC_TM,
    tstmp_add_seconds(a.ztime, cast( 15 as abap.dec(15,0) ), 'INITIAL') as ADDED_TM,    
    //TESTING DIFFERENCE OF SECONDS
    tstmp_seconds_between(tstmp_current_utctimestamp(), a.ztime , 'FAIL') as difference 
}

Nothing that demands particular attention.

If you find this boring, check out our extra section. This section will link to all other worlds as well as SAP.

OData: Many of you have heard of this lovely idea and have worked with it.However, what if CDS was connected to the outside world (apart from SAP) via OData service?

Also Consider: ABAP on HANA Course

@AbapCatalog.sqlViewName: 'ZTYPE_CAST_V'
 @AbapCatalog.compiler.compareFilter: true
 @AbapCatalog.preserveKey: true
 @AccessControl.authorizationCheck: #NOT_REQUIRED
 @EndUserText.label: 'Type Casting Examples'
 define view ZTYPE_CAST
   as select from sflight as a
 {
   key a.carrid,
   key a.connid as originalConn,
   key a.fldate,
       cast (a.connid as abap.char(2) )
       as castedConn,
       a.planetype as originalType,
       cast( a.planetype as abap.char( 2 ) )
                   as castedType
 }
Observe keenly there are two warnings. Let’s see what are they.

So effectively two things needs to be kept in mind.

  1. Apply Type casting only when changing from one data type to other. If it is done within same data type the very purpose is not served.
  2. Need to be very careful such that no harm is done to data.

Output validates the earlier assertion.

Another insightful lesson for me! I attempted to insert castConn, the non-primary key, before fldate. However, SAP denied me access.

This concludes the functions series and Ishan’s specific request.

Return to CDS View via OData exposure. At technicalgyanguru, we already have a few articles on OData from CDS Annotations.However, our next piece on OData from CDS will be unique and captivating.Because there isn’t much room here, you’ll have to wait a little while longer. We pledge not to bother you too much and to deliver it in as little as two days. Please continue to watch.

We really appreciate your input. Kindly, provide your feedback down below.

WSDL file in SAP – Part I

The post Section 16 of CDS: Utilizing Built-In Features in CDS IV first appeared on TECHNICAL GYAN GURU.

]]>
https://technicalgyanguru.com/section-16-of-cds-utilizing-built-in-features-in-cds-iv/feed/ 0 5493
Part 23 of ABAP for SAP HANA. How Can AMDP Be Used to Access Database Schema Dynamically? https://technicalgyanguru.com/part-23-of-abap-for-sap-hana-how-can-amdp-be-used-to-access-database-schema-dynamically/?utm_source=rss&utm_medium=rss&utm_campaign=part-23-of-abap-for-sap-hana-how-can-amdp-be-used-to-access-database-schema-dynamically https://technicalgyanguru.com/part-23-of-abap-for-sap-hana-how-can-amdp-be-used-to-access-database-schema-dynamically/#respond Mon, 04 Nov 2024 16:50:40 +0000 https://technicalgyanguru.com/?p=5488 As everyone knows, SAP developed the ABAP Managed Database Procedure (AMDP) to create SQL script-based programs known as Database Procedures.By employing AMDP techniques, it has become easier to access data…

The post Part 23 of ABAP for SAP HANA. How Can AMDP Be Used to Access Database Schema Dynamically? first appeared on TECHNICAL GYAN GURU.

]]>

As everyone knows, SAP developed the ABAP Managed Database Procedure (AMDP) to create SQL script-based programs known as Database Procedures.By employing AMDP techniques, it has become easier to access data from various database schema using SQL script since we no longer require a database user to program the database operations.

The following is the syntax to retrieve data from an underlying database schema:

FROM “” SELECT *.”” WHERE -> that you’ll include in the AMDP method implementation.

Please take note of the precise distinctions between the Open SQL and SQL script syntax. To accurately identify the underlying way to access the necessary data of that , we must mention the Physical Schema Name.In the event that the physical schema is omitted, the default schema is selected automatically. You can use the function module DB_DBSCHEMA_CURRENT to find the default schema.

You would now be asked the following queries:

Why are we discussing several database schemas?

What would be wrong if I simply retrieved the data using CDS or Open SQL directly?

Since I have written AMDP selection without using a physical schema name, what are you referring to?

Why and when would I need to use such DB procedures to pull data as an ABAP programmer?

According to what I’ve learned, not every table in the underlying database schemas has a dictionary view associated with it. Because of this, not all of them are visible in SE11 or SE16. However, these tables may still exist and contain essential business master and transaction data. Any SAP or non-SAP system could be the source of these data, and by employing the SAP LT replication technique,

The basis person informed you that this table is physically located in a schema named DEV_SCHEMA, but that the names of the schemas in production and quality would be PROD_SCHEMA and QUAL_SCHEMA, respectively (different schema names in various systems is the standard procedure, nothing new).

Using the syntax mentioned above, you would now write the AMDP code below: –

SELECT * FROM “DEV_SCHEMA”.”ZCCARD_DETAILS” WHERE  customer_name = ‘SAPYard’.

This will function flawlessly in development, but it will collapse in quality as there isn’t a physical schema named “DEV_SCHEMA.” The physical schema for quality is QUAL_SCHEMA.

The Schema Mapping Concept, which is once more an underlying database table in the physical schema “_SYS_BI,” was created to address this issue. It contains the alias for every physical schema. All systems have the same alias, but the physical schema names that are associated to it vary.

Thus, the schema mapping entries in the development system might resemble this: –

ALIAS ( called as AUTHORING SCHEMA or logical name)Physical Schema
ZS4_ALIASDEV_SCHEMA
ALIAS ( called as AUTHORING SCHEMA )Physical Schema
ZS4_ALIASQUAL_SCHEMA

Thankfully, all you need to do now is refer to the Alias name in the AMDP select query as seen below: –

Obtain the physical schema using the alias -> Choose the query first

In the second select query, obtain the card details by correctly referencing the physical schema name that you obtained in step 1.

But is there a syntax specific to SQL scripts?Which allows for the transmission of the schema name in such a dynamic manner?Well, not that I’m aware of.

Are we therefore stuck? Now what are our options?

This can be answered by using AMDP’s standard provided macro, $ABAP. Schema.

The alias is automatically transformed into the physical schema name by this macro, which then inserts it into the SELECT query directly. The way it is written is:

  • FROM “$ABAP.Schema( ZS4 )” is selected.Where customer_name = “SAPYard” in “ZCCARD_DETAILS”.

Fantastic! With this technique, giving a dynamic physical name is no longer an issue because you only need to pass the logical name—the macro will take care of the rest. You also avoid writing two select queries.

Please also review my other article, Code.

Is that all there is to it? Well, no!

Before we can use this syntax, there are a few things we need to do.

Let me start by stating that, although I did not use the alias name ZS4_ALIAS that I displayed to you, I did use the logical name ZS4. What is this ZS4 now? From where is this coming?

Now let’s get started:

The logical database schema, or ZS4, can be produced with Eclipse ADT. Click NEW item after opening the project. Go to Others -> Explain the definition of a logical schema. After completing the wizard, turn it on.

Select the logical database schema under other.

You have successfully mapped the underlying physical schema name in the transaction DB_SCHEMA_MAP, according to this screen. Before proceeding with the transaction, please activate the logical schema; else, it won’t be seen there.

You can observe that the entry with the logical name ZS4 has occurred in the transaction DB_SCHEMA_MAP.

Select the record, select EDIT, provide the name of the physical schema, and select SAVE. It is also an option to transfer this logical name to other systems.

It is important to keep in mind that even while the logical schema name can be moved through transport, the physical schema name attachment in transaction DB_SCHEMA_MAP needs to be completed explicitly in the target system. This turns into a cutover task.

The post Part 23 of ABAP for SAP HANA. How Can AMDP Be Used to Access Database Schema Dynamically? first appeared on TECHNICAL GYAN GURU.

]]>
https://technicalgyanguru.com/part-23-of-abap-for-sap-hana-how-can-amdp-be-used-to-access-database-schema-dynamically/feed/ 0 5488
S/4HANA VDM 1 Employing CDS Virtual Data Model for Embedded Analytics https://technicalgyanguru.com/s-4hana-vdm-1-employing-cds-virtual-data-model-for-embedded-analytics/?utm_source=rss&utm_medium=rss&utm_campaign=s-4hana-vdm-1-employing-cds-virtual-data-model-for-embedded-analytics https://technicalgyanguru.com/s-4hana-vdm-1-employing-cds-virtual-data-model-for-embedded-analytics/#respond Fri, 01 Nov 2024 07:59:00 +0000 https://technicalgyanguru.com/?p=5505 Most of you should be familiar with Core Data Services by now.You DO NOT need to be using SAP on HANA or S/4HANA to use CDS because it is database…

The post S/4HANA VDM 1 Employing CDS Virtual Data Model for Embedded Analytics first appeared on TECHNICAL GYAN GURU.

]]>

Most of you should be familiar with Core Data Services by now.You DO NOT need to be using SAP on HANA or S/4HANA to use CDS because it is database independent.One innovation that the S/4HANA programming approach is depending on is CDS. We can generate OData, develop SAPUI5 apps, construct graphs, and show charts using CDS. The beauty of CDS is in that.

Now that we are familiar with the fundamentals of CDS, it is imperative that we study the following advanced topic. It’s called the Virtual Data Model, or VDM. Virtual refers to nonexistent.Put differently, VDM functions as an intermediary for the CDS, strategically structured and adjusted to produce a more accurate depiction of the data.

The architecture for creating a Virtual Data Model (VDM) in S/4HANA will be covered in this article. VDM is constructed from CDS. Any discussion of VDM implies that CDS Views, or Core Data Services, are the foundation.

The architecture and programming model of SAP S/4HANA heavily rely on CDS Views. For all SAP Fiori Applications, VDMs and CDS are the primary data sources and data modes. On VDM, all recent advancements in S/4HANA are built.

Why is VDM required?

  • Understandability: Business, non-technical, and functional people can all grasp VDM with ease.
  • Reusability: After they are launched, customers and partners can reuse parts of the VDM perspective, which are expected to be reused by other teams.
  • Leading S/4HANA Programming Model: For all S/4HANA initiatives, VDM is the recommended programming model. CDS/VDM is the basis for other data models, such as Analytic and OData Models. Also, VDM is used in the development of all new SAP standard Fiori Apps.
  • Performance: Because VDM views are run directly at the database level, they take advantage of all of its features and performance.
  • Transport Management: As the foundation of VDM, CDS makes use of the reliable, dependable ABAP Application Infrastructure and Change
  • How Can a Transient Provider Be Created?
  • How Can SAP Analysis for Office (AO) See VDM?
  • How Can UI Annotations and CDS Views Be Used to Build Fiori Apps?

Embedded denotes integrated. With S/4HANA System, embedded analytics refers to built-in analytics. It creates virtual data models, or representations of operational data, using the technology of SAP ABAP Core Data Services, also known as CDS.

SAP HANA Pre-delivered CDS views, which are pre-packaged analytical tools included with Embedded Analytics, allow users to execute real-time data analytics on transactional data without having to know much about the underlying data tables or structures. The views can be used directly or combined with new views (or modified/enhanced views) to generate new data models, depending on the analytical needs of a business.

Building a semantic overlay on top of the current database architecture is the fundamental idea behind a virtual data model.

VDM can be divided into two primary categories:

  • Interface Views
  • Basic View
  • Composite View

Consumption Views

  1. Interface Views
    Because they are built directly on top of DDIC tables or views, Basic Views (Core Entity Views, Text Views, and Hierarchy Views) interface with database tables to retrieve data. To put it briefly, Basic Views are created when you are directly picking data from a database table.
  2. One or more Basic Views serve as the foundation for Composite Views. To create a composite view, several basic views can be put together and calculations made using functions and expressions. Composite views have the option of being reusable or consumption-specific.

2. Consumption View

  • Because Consumption Views are constructed on top of Composite Views, they are incompatible with DDIC tables and Basic Views.
  • The views that are exposed to front-end tools such as SAP Analytics Cloud, BEX Queries, Analysis for Office, Fiori Apps, etc. are called consumption views.
Virtual Data Model Diagram
  • @VDM.viewType: # BASIC , COMPOSITE,CONSUMPTION
  • @Analytics.DataCategory: #DIMENSION , FACT,CUBE
  • @Analytics.Query: # TRUE,FALSE
  • @Analytics.dataExtraction.enabled: #TRUE, FALSE
  • @ObjectModel.dataCategory: #TEXT, HIERARCHY
  • @Odata.Publish: TRUE

Today’s task will involve creating CDS Views for Sales Flow. For VBAK (Sales Header), Basic CDS View ZVDM_I_VBAK is made. Basic CDS View ZVDM_I_LIPS is built for Delivery Header and Item, and Basic View ZVDM_I_VBAP is created for VBAP (Sales Item).

On top of the Basic CDS Views mentioned above is the Composite CDS view ZVDM_CO_SALES.

The Composite View above serves as the foundation for the Consumption View ZVDM_C_SALES.

In our practice today, we also used Partner CDS View and Standard Material CDS View.

We are going to construct CDS Views for Sales Flow as part of today’s activity. ZVDM_I_VBAK, the Basic CDS View, is made for VBAK (Sales Header). For VBAP (Sales Item), Basic View ZVDM_I_VBAP is constructed, and for Delivery Header and Item, Basic CDS View ZVDM_I_LIPS is created.

  • The Basic CDS Views above provide the foundation for the Composite CDS view ZVDM_CO_SALES.
  • Built upon the Composite View mentioned above is the Consumption View ZVDM_C_SALES.
  • In today’s activity, we also employed Partner CDS View and Standard Material CDS View.

Take the CDS Basics Quiz 1.

Exercise 1: Make a Simple CDS See: ZVDM_I_VBAK (FACT, BASIC)

@Analytics.dataCategory: #FACT — Since this is a basic view, we are fetching the transactional table here without using any semantic annotations.

Used the annotations below to specify the CDS view’s size and data class in accordance with the specifications

  • @ObjectModel.dataClass.usageType: #TRADESIONAL
  • UsageType.serviceQuality @ObjectModel: #B
  • UsageType.sizeCategory @ObjectModel.usage: #XL
@AbapCatalog.sqlViewName: 'ZVDM_VIEW_VBAK'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Sales header data( Basic View , Fact table)'
@VDM.viewType: #BASIC
@Analytics.dataCategory: #FACT
@Analytics.dataExtraction.enabled: true
@ObjectModel.representativeKey: [ 'SalesDocument' ]
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #B
@ObjectModel.usageType.sizeCategory: #XL
define view ZVDM_I_VBAK 
 as select from vbak 
{
      //Key
  key vbeln as SalesDocument,
      
      //Category
      vbak.vbtyp                                           as SDDocumentCategory,
      vbak.auart                                           as SalesDocumentType,
      
      // Created By , Date and Time
      vbak.ernam                                           as CreatedByUser,
      vbak.erdat                                           as CreationDate,
      cast( vbak.erzet as creation_time preserving type )  as CreationTime,
      
      //Organization
      vbak.vkorg                                           as SalesOrganization,
      vbak.vtweg                                           as DistributionChannel,
      vbak.spart                                           as OrganizationDivision,
      vbak.vkgrp                                           as SalesGroup,
      vbak.vkbur                                           as SalesOffice,
      
      //Sales Customer
      vbak.kunnr                                           as SoldToParty,
      
      //Amount
      vbak.netwr                                           as TotalNetAmount,
      vbak.waerk                                           as TransactionCurrency, 
       
      vbak.vdatu                                           as RequestedDeliveryDate, 
      vbak.vsbed                                           as ShippingCondition,
      vbak.autlf                                           as CompleteDeliveryIsDefined,
      vbak.lifsk                                           as DeliveryBlockReason,
      //Reference
      vbak.vgbel                                           as ReferenceSDDocument,
      vbak.vgtyp                                           as ReferenceSDDocumentCategory,
      
      //Status
      vbak.gbstk                                           as OverallSDProcessStatus,
      vbak.abstk                                           as OverallSDDocumentRejectionSts
      
}

Exercise 2: Make a Simple CDS View: ZVDM I VBAP (FACT, BASIC)

Using Association I created a CDS view (Basic, FACT) from VBAP and attached it to the above CDS view (ZVDM_I_VBAK).

@AbapCatalog.sqlViewName: 'ZVDM_VIEW_VBAP'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Sales Item data( Basic View , Fact table)'
@VDM.viewType: #BASIC
@Analytics.dataCategory: #FACT
@Analytics.dataExtraction.enabled: true
@ObjectModel.representativeKey: [ 'SalesDocument']
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #B
@ObjectModel.usageType.sizeCategory: #XL
define view ZVDM_I_VBAP
  as select from vbap
  association[1..1]  to ZVDM_I_VBAK                    as _vbak         on  $projection.SalesDocument     = _vbak.SalesDocument
  
{
  key vbap.vbeln                                                   as  SalesDocument,
  key vbap.posnr                                                   as  SalesDocumentItem,
      vbap.matnr                                                   as  Material,
      
      vbap.arktx                                                   as  SalesDocumentItemText,
      vbap.posex                                                   as  UnderlyingPurchaseOrderItem,
    
      vbap.kwmeng                                                  as  OrderQuantity,
      vbap.vrkme                                                   as  OrderQuantityUnit,
     
      vbap.zmeng                                                   as  TargetQuantity,
      vbap.zieme                                                   as  TargetQuantityUnit,
     
      //Pricing
      vbap.netwr                                                   as  NetAmount,
      vbap.waerk                                                   as  TransactionCurrency,
      vbap.netpr                                                   as  NetPriceAmount,
      
      //Shipping 
      vbap.vstel                                                   as  ShippingPoint,
      vbap.werks                                                   as  Plant,
      vbap.lgort                                                   as  StorageLocation,
      vbap.route                                                   as  Route,
      
      //Reference Dosument
      vbap.vbelv                                                   as  OriginSDDocument,
      vbap.posnv                                                   as  OriginSDDocumentItem,
      vbap.vgbel                                                   as  ReferenceSDDocument,
      vbap.vgpos                                                   as  ReferenceSDDocumentItem,
      vbap.vgtyp                                                   as  ReferenceSDDocumentCategory,
      vbap.uepos                                                   as  HigherLevelItem,
      
      //Status
      vbap.gbsta                                                   as  SDProcessStatus,
      vbap.absta                                                   as  SDDocumentRejectionStatus,
  
  //Make Association
    _vbak
}

Exercise 3: Make a Simple CDS ZVDM_I_LIPS (BASIC, FACT) is displayed.

utilizing Association a CDS View (Basic, FACT) was created from the LIPS and LIKP data.

@AbapCatalog.sqlViewName: 'ZVDM_VIEW_LIPS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Delivery Item data( Basic View , Fact table)'
@VDM.viewType: #BASIC
@Analytics.dataCategory: #FACT
@Analytics.dataExtraction.enabled: true
@ObjectModel.representativeKey: [ 'ReferenceSDDocument' ]
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #B
@ObjectModel.usageType.sizeCategory: #XL
define view ZVDM_I_LIPS 

as select from lips 
  //Associations
  association[1..1] to likp       as _likp      on $projection.DeliveryDocument    = _likp.vbeln
  
{
  //Keys  
  key vbeln                                                          as DeliveryDocument,
  key posnr                                                          as DeliveryDocumentItem,
  key vgbel                                                          as ReferenceSDDocument,
      matnr                                                          as Material,
      pstyv                                                          as DeliveryDocumentItemCategory,
      lgort                                                          as StorageLocation,
      lgpla                                                          as StorageBin,
      lgtyp                                                          as StorageType,
      
      //delivery
      arktx                                                          as DeliveryDocumentItemText,
      
      @Semantics.unitOfMeasure: true
      vrkme                                                          as DeliveryQuantityUnit,
      
      @DefaultAggregation: #SUM
      @Semantics.quantity.unitOfMeasure: 'DeliveryQuantityUnit'
      lfimg                                                           as ActualDeliveryQuantity,
      
      @DefaultAggregation: #SUM
      @Semantics.quantity.unitOfMeasure: 'DeliveryQuantityUnit'
      ormng                                                           as OriginalDeliveryQuantity,
      
      @Semantics.unitOfMeasure: true
      meins as BaseUnit,
      
      //reference  
      
      vgpos                                                           as ReferenceSDDocumentItem,
      vgtyp                                                           as ReferenceSDDocumentCategory,
      
      //Status
      gbsta                                                           as SDProcessStatus,
      fksta                                                           as DeliveryRelatedBillingStatus,
      
      // Pricing
      vbelv                                                           as OriginSDDocument,
      posnv                                                           as SDDocumentItem,
      vbtyv                                                           as SalesSDDocumentCategory,
      ematn                                                           as BaseUnit1,
      werks                                                           as DelPlant,
//      _likp.kunag                                                     as ShipToParty,
  
   // Make Associations
   _likp
    
}

Worksheet 4: Construct Composite CDS View: ZVDM CO SALES (CUBE, COMPOSITE)

Using the custom CDS views ZVDM_I_VBAP, ZVDM_I_LIPS, and Standard Material CDS views as a basis, a Composite View was created. Partners in SalesDocumentItemPartner, I_Material, and I_MaterialText.

Here, we represented the currency and quantities using semantic annotations in the composite view, and we created the Transient Provider using the specialized annotation @Analytics.datacategory; #CUBE.

Add the RSRTS_ODP_DIS transaction to your favorites. This is for the Temporary Provider Preview.

Use of @Anlytics.dataCategory:#CUBE in the CDS View will result in the creation of a transient provider in the S/4HANA system.It is applicable to several reporting tools.

@AbapCatalog.sqlViewName: 'ZVDM_VIEW_SALES'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Sales Composite View(Composite View ,CUBE)'
@VDM.viewType: #COMPOSITE
@Analytics.dataCategory: #CUBE
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #B
@ObjectModel.usageType.sizeCategory: #XL
@Search.searchable: true
define view ZVDM_CO_SALES 

  as select from  ZVDM_I_VBAP as VBAP 
  association[0..*]  to ZVDM_I_LIPS                    as _LIPS         on  $projection.SalesDocument        = _LIPS.ReferenceSDDocument and
                                                                            $projection.SalesDocumentItem    = _LIPS.ReferenceSDDocumentItem
  association[1..1]  to I_Material                     as _Material     on  $projection.materialNumber       = _Material.Material
  association[0..*]  to I_MaterialText                 as _MaterialText on  $projection.materialNumber       = _MaterialText.Material
  association[0..*]  to I_SalesDocumentItemPartner     as _Partneritem  on  $projection.SalesDocument        = _Partneritem.SalesDocument  and
                                                                            $projection.SalesDocumentItem    = _Partneritem .SalesDocumentItem                                                
{
  //VBAP
  //@ObjectModel.foreignKey.association: '_vbak'
  @Search.defaultSearchElement: true 
  key VBAP.SalesDocument,
  
  key VBAP.SalesDocumentItem,
  
  _vbak.SalesOrganization as SalesOrganization,
  
  Material as materialNumber,
  
  @EndUserText.label: 'Material Descrption'
  @EndUserText.quickInfo: 'Material Desc'
  @Semantics.text: true
  _MaterialText[ 1:Language = $session.system_language ].MaterialName as MaterialDescrption, 
  
  
  SalesDocumentItemText,
  UnderlyingPurchaseOrderItem,
  case
       when (_LIPS.DeliveryDocument is null ) then 'No Follow ON Document Created'                                           
       else _LIPS.DeliveryDocument
       end as Status,
  _LIPS.DeliveryDocument,
  _LIPS.DeliveryDocumentItem,
  
  @Semantics.unitOfMeasure: true
  OrderQuantityUnit,
  
  @Semantics.unitOfMeasure: true
  TargetQuantityUnit,
  
  @Semantics.currencyCode: true
  TransactionCurrency,
  
  ShippingPoint,
  Plant,
  StorageLocation,
  Route,
  OriginSDDocument,
  OriginSDDocumentItem,
//  ReferenceSDDocument  as SalesDocument NU,
//  ReferenceSDDocumentItem as SalesDocumentItem,
  ReferenceSDDocumentCategory,
  HigherLevelItem,
  SDProcessStatus,
  SDDocumentRejectionStatus,

//  _LIPS.Material,
  _LIPS.DeliveryDocumentItemCategory,
//  _LIPS.StorageLocation,
  _LIPS.StorageBin,
  _LIPS.StorageType,
  _LIPS.DeliveryDocumentItemText,
   
   @Semantics.unitOfMeasure: true
  _LIPS.DeliveryQuantityUnit as DELIVERYQUNATITYUNIT,
  
  @Semantics.quantity.unitOfMeasure: 'DELIVERYQUNATITYUNIT'
  _LIPS.OriginalDeliveryQuantity,
  
  _LIPS.BaseUnit,
//  _LIPS.ReferenceSDDocument,
//  _LIPS.ReferenceSDDocumentItem,
//  _LIPS.ReferenceSDDocumentCategory,
  _LIPS.SDProcessStatus as DeliveryStatus,
  _LIPS.DeliveryRelatedBillingStatus,
//  _LIPS.OriginSDDocument,
//  _LIPS.SDDocumentItem,
  _LIPS.SalesSDDocumentCategory,
  
   //Aggregations 
   @DefaultAggregation:#SUM
   @Semantics.quantity.unitOfMeasure: 'OrderQuantityUnit'
   OrderQuantity,
   
   @Semantics.quantity.unitOfMeasure: 'TargetQuantityUnit'
   @DefaultAggregation:#SUM
   TargetQuantity,
   
   @Semantics.amount.currencyCode: 'TransactionCurrency'
   @DefaultAggregation:#SUM
   NetAmount,
   
   @Semantics.amount.currencyCode: 'TransactionCurrency'
   @DefaultAggregation:#SUM
   NetPriceAmount,
   
   @Semantics.quantity.unitOfMeasure: 'DELIVERYQUNATITYUNIT'
   @DefaultAggregation:#SUM
   _LIPS.ActualDeliveryQuantity,        
   
  /* Associations */
  _vbak,
  _LIPS,
  _Material,
  _MaterialText,
  _Partneritem 

}

With ADT (Eclipse/HANA Studio), you may preview the data of each VDM created individually by simply pressing F8 or right-clicking and selecting Preview.

To learn how to Create Transient Provider was one of the article’s objectives. And we already have knowledge. Transient Provider is automatically created when you construct the Composite View with annotation @Analytics.datacategory; #CUBE.

How Can a Transient Provider Be Used?

Transaction Code: RSRTS_ODP_DIS; execute. Select ODP Name: ZVDM_VIEW_SALES (SQL View Name of Composite and CUBE Name), ODP Context: ABAP Core Data Services.

Note that the SQL View Name was selected, not the CDS Entity View name. You can access SQL View Name at the Data Dictionary Level.

Select the Standard Query option.

From the FREE Characteristics, choose the fields you wish to study (we choose sales order, sales order item, and material).

That is all. Congratulations! Using the Transient Provider was a successful use. The Composite View’s output is visible to you in the Transient Provider. ABAP developers typically don’t use it.It’s for reporting people (you could feel more at ease if your friend is a BI, BO, or BW).

How Can SAP Analysis for Office (AO) See VDM?

  • The only thing Analysis Office is is a SAP Business Objects Add-on for Microsoft Excel and PowerPoint.
  • The two images below illustrate steps 1 through 5 for using CDS view in Analysis for Office.

Please install Analysis Office for Microsoft Excel if you are unable to see the Analysis Menu.

  • As an alternative, you could take the actions listed below.
  • Launch Excel and select the Analysis Menu Tab.

Go to Insert Data Source and hit Select Data Source

Step 6: Select the S/4HANA System and give your credentials.

Step 7:  Search with Composite View SQL Name and Select your CDS view

chosen CDS view.


If for any reason you are unable to locate your CDS SQL Name. Try searching after entering 2C in front of your CDS SQL.In other words.

Step 8: Since we haven’t used any filter annotations or @AnalyticsDetails, the Analysis Office’s first screen will only display measurements automatically.Axis annotations for Query.

While filters are available in Consumption View, we haven’t utilized them here because we’re using Composite Cube View instead of Consumption View. You may give parameters a try.

@consumption.filter annotation:{ MultipleSelections: True, SelectionType: # Range, Mandatory: False}

Step 9: Drag and Drop Required Fields in to Rows.

We can use below annotation to display the fields automatically rows and columns.

Annotation : @AnalyticsDetails.Query.Axis: #Rows /#Columns

That means, if you use @AnalyticsDetails.Query.Axis: #Rows, the Analysis Office would automatically show the data from the VDM. You do not need to drag and drop the fields.

If you do not want to show some fields in the Analysis Office, you may use below annotation with value #FREE. It will not display.

@AnalyticsDetails.Query.Axis: #FREE

This excel sheet can be saved and provided as a template for the end user. End user can change the input parameter via prompts and view data accordingly.

Exercise 5 – Create Consumption View: ZVDM_C_SALES

Finally, let’s created a Consumption View based on the Composite View to create an App in Fiori

We have used semantics annotations in the Consumption View to represent the currency and quantities and also used other UI annotations.      

Below 2 Annotations are used for displaying the text in the Fiori Apps      

@EndUserText.label: ‘Sales Order Number’
@EndUserText.quickInfo: ‘Sales Order NO’

Below 2 Annotations are used for positioning fields and selection fields in the Fiori Apps.  

@UI.lineItem: [{position:10 ,importance: #HIGH}]
@UI.selectionField: [{position: 10}]

It is necessary to publish the CDS view as an OData Service to consume it in Fiori Apps. Below annotation helps.

@ODATA.Publish: true

@AbapCatalog.sqlViewName: 'ZVDM_V_SALES'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Consumption(Sales Information)'
@VDM.viewType: #CONSUMPTION
@OData.publish: true
@Search.searchable: true
define view ZVDM_C_SALES 
//with parameters 
//@EndUserText.label: 'Sales Orgnization'
//@Consumption.defaultValue: 'US01'
//p_salesorg: vkorg
  as select from ZVDM_CO_SALES
 {
    //ZVDM_CO_SALES
    @EndUserText.label: 'Sales Order Number'
    @EndUserText.quickInfo: 'Sales Order NO'
    @UI.lineItem: [{position:10 ,importance: #HIGH}]
    @UI.selectionField: [{position: 10}]
    @ObjectModel.foreignKey.association: '_VBAK'
    @Search.defaultSearchElement: true
    key SalesDocument,
    
    @EndUserText.label: 'Sales Order Item Number'
    @EndUserText.quickInfo: 'Sales Order Item NO'
    @UI.lineItem: [{position:20 }]
    key SalesDocumentItem,
    
    @EndUserText.label: 'Follow On Document'
    @EndUserText.quickInfo: 'Delivery Document'
    @UI.lineItem: [{position:30, importance: #HIGH}]
    Status,
    
    @EndUserText.label: 'Material Number'
    @EndUserText.quickInfo: 'Material NO'
    @UI.lineItem: [{position: 30}]
    materialNumber,
    
    @EndUserText.label: 'Material Dec'
    @EndUserText.quickInfo: 'Material Descrption'
    @UI.lineItem: [{position: 40}]
    MaterialDescrption,
    
    @EndUserText.label: 'Sales Orgnization'
    @EndUserText.quickInfo: 'Sales Org'
    @UI.lineItem: [{position: 50}]
    SalesOrganization   as SalesOrganization,

    @EndUserText.label: 'Sales Doc Type'
    @UI.lineItem: [{position: 60}]
    _vbak.SalesDocumentType as SalesDocType,
    
    @UI.lineItem: [{position: 70}]
    _vbak.DistributionChannel                                       as DChannel,
    
    @UI.hidden: true
    SalesDocumentItemText,
    
    @UI.hidden: true
    UnderlyingPurchaseOrderItem,
    
    @UI.lineItem: [{position: 80}]
    DeliveryDocument,
    
    @UI.lineItem: [{position: 90}]
    DeliveryDocumentItem,
  
    @UI.lineItem: [{position: 110}]
    @Semantics.unitOfMeasure: true
    OrderQuantityUnit,
    
    @UI.lineItem: [{position: 130}]
    @Semantics.unitOfMeasure: true
    TargetQuantityUnit,
    
    @UI.lineItem: [{position: 150}]
    @Semantics.currencyCode: true
    TransactionCurrency,
    
    NetPriceAmount,
    ShippingPoint,
    Plant,
    StorageLocation,
    Route,
    OriginSDDocument,
    OriginSDDocumentItem,
    ReferenceSDDocumentCategory,
    HigherLevelItem,
    SDProcessStatus,
    SDDocumentRejectionStatus,
    DeliveryDocumentItemCategory,
    StorageBin,
    StorageType,
    DeliveryDocumentItemText,
    DELIVERYQUNATITYUNIT,
    ActualDeliveryQuantity,
    OriginalDeliveryQuantity,
    BaseUnit,
    DeliveryStatus,
    DeliveryRelatedBillingStatus,
    SalesSDDocumentCategory,

    
    
    //Aggregations
    @Semantics.quantity.unitOfMeasure: 'ORDERQUANTITYUNIT'
    @DefaultAggregation:#SUM
    @UI.lineItem: [{position: 100}]
    OrderQuantity,
    
    @Semantics.quantity.unitOfMeasure: 'TARGETQUANTITYUNIT'
    @DefaultAggregation:#SUM     
    @UI.lineItem: [{position: 120}]
    TargetQuantity,
    
    @Semantics.amount.currencyCode: 'TRANSACTIONCURRENCY'
    @DefaultAggregation:#SUM
    @UI.lineItem: [{position: 140}]
    NetAmount,
        
    /* Associations */
    //ZVDM_CO_SALES
    _vbak,
    _LIPS,
    _Material,
    _MaterialText,
    _Partneritem
}

OData Service Activation

When we create OData from CDS using annotation, we need to go to the backend SAP System and perform this step manually one time. After we activate the OData Service and create the related DPC and MPC and add the OData Service to the Service Catalog, we do not need to perform this step again, even if we make changes in the original CDS Views.

Let’s see, how we activate the OData Service.

Open the t-code /n/iwfnd/maint_service and press the Add Service button. 

In the Add Selected Services screen provide a System Alias, and then press the Get Services button.  The Technical Service Name field, ZVDM_C_SALES, can be provided to filter the results if necessary. 

Selecting the service should result in the Add Service dialog appearing.  Here you can assign it a package and choose the enter button to complete the process.

The above steps would activate the OData Service and Add it to the Service Catalog. Once it is in the Service Catalog, it is ready to be consumed in the WebIDE while developing Fiori Apps.

If you go back to /N/IWFND/MAINT_SERVICE t-code, you should see your OData Service in the Service Catalog.

Choose your OData and click on SAP Gateway Client (or go to t-code /N/IWFND/GW_CLIENT) to test your OData Service. If it returns status code 200, you are all set. Your OData is working correctly.

Did you notice, the OData Service name is your CDS View name with a suffix _CDS?

Create Fiori Apps Using CDS Views & UI Annotations

Exercise 6 – Fiori Apps using List Report Template

Create Fiori App from Standard Template using SAP WebIDE Full-Stack. This SAP WebIDE Full-Stack will open from SAP Cloud Platform Cockpit.

We connected Cloud Connector and SAP Cloud Platform Cockpit.

Once you are in the WebIDE, select Project from Template in the SAP WebIDE Full-Stack and select the List Report Application.

Select the SAP Backend System and OData Service and click on finish button.

Once, finished, you may Deploy the App to your ABAP repository. You need to do this step, only if you are planning to move your App to your next SAP environment say Quality and then to Production using Transport. For testing, you may skip this step.

Select SAP System and give application name and description. Select the transport request and confirm it so your application is deployed to the backend SAP System.

Now, let’s test our App.

Did you realize? We did not write an single line of code in the App in WebIDE and we are ready to test out of the box. That is the beauty of creating App using CDS/VDM Views.

Click on Run-> Run as Web Application

Select the flpSandbox.html file

Our Fiori App is ready. Click on our app (ZSALES_REPORT).

It will show a blank output.

You need to click on Go button to see the report.

Fiori App  display will change based on the Semantics annotations, UI Annotations, Text Annotations.

We can use different annotations for Charts, Header Info, Images, Navigation etc.

Exercise 7 – Fiori Overview Page Report(OVP) Template

We will not go in to the details of this template but we will just explain few annotations.

Annotation @UI.headerInfo:   Use this annotation to define the typeName which will be shown as the card header, as well as a title and header

@UI.headerInfo: {
typeNamePlural: ‘Sales Orders’,
//  imageUrl: ‘VenkatImg’,
typeName: ‘Sales Order’,
  title: {
    label: ‘Order ID’,
    value: ‘SalesDocument’
  },
  description: {
    label: ‘Customer’,
    value: ‘Customer’
  }
}

Annotation @UI.identification: Used for navigating from one view to other view using Semantic Navigation.

@UI.identification: {type: #FOR_INTENT_BASED_NAVIGATION, semanticObjectAction: ”, label: ”, position: ”}

Annotation @UI.chart : Used for displaying the Charts in the Fiori app.

@UI.chart:[{
    qualifier: ‘chartLineItem’,
    title:’Order Net Amount’,
    chartType: #COLUMN,
    dimensions: [‘SalesDocument’],
    measures: [‘NetAmount’, ‘NetPriceAmount’],
    dimensionAttributes: {dimension: ‘SalesDocument’, role:#SERIES},
    measureAttributes: [{measure: ‘NetAmount’, role: #AXIS_1}, {measure:
NetPriceAmount’, role: #AXIS_1}]
 }]

Annotation @UI.dataPoint : Used for displaying the KPI values.

@UI.dataPoint: {title: ‘Net Amt’,
    criticalityCalculation: {
    improvementDirection: #TARGET,
    deviationRangeLowValue: 000,
    toleranceRangeLowValue: 600,
    toleranceRangeHighValue: 1000,
    deviationRangeHighValue: 1400
    }}

@AbapCatalog.sqlViewName: 'ZVDM_V_SALES1'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Sales OVP Report'
@VDM.viewType: #CONSUMPTION
@OData.publish: true
@Search.searchable: true
@UI.headerInfo: {
  typeNamePlural: 'Sales Orders',
//  imageUrl: 'mytestImg',
  typeName: 'Sales Order',
  title: {
    label: 'Order ID',
    value: 'SalesDocument'
  },
  description: {
    label: 'Customer',
    value: 'Customer'
  }
}
@UI.chart:[{
    qualifier: 'chartLineItem',
    title:'Order Net Amount',
    chartType: #COLUMN,
    dimensions: ['SalesDocument'],
    measures: ['NetAmount', 'NetPriceAmount'],
    dimensionAttributes: {dimension: 'SalesDocument', role:#SERIES},
    measureAttributes: [{measure: 'NetAmount', role: #AXIS_1}, {measure: 'NetPriceAmount', role: #AXIS_1}]
 }]
 @UI.presentationVariant: [{qualifier: 'top5Changed', maxItems: '5',  sortOrder.by: 'SalesDocument', sortOrder.direction: #DESC }]
define view ZVDM_C_SALES1
//with parameters 
//@EndUserText.label: 'Sales Orgnization'
//@Consumption.defaultValue: 'US01'
//p_salesorg: vkorg
  as select from ZVDM_CO_SALES
 {
    //ZVDM_CO_SALES
//    @EndUserText.label: 'Sales Order Number'
//    @EndUserText.quickInfo: 'Sales Order NO'
    @UI.lineItem: [{position:10 ,qualifier: 'ordOverView',importance: #HIGH,label: 'Sales Order'}] --,{qualifier: 'chartLineItem'}]
    @UI.selectionField: [{position: 10}]
    //@ObjectModel.foreignKey.association: '_VBAK'
    @Search.defaultSearchElement: true
    key SalesDocument,
    
//    @EndUserText.label: 'Sales Order Item Number'
//    @EndUserText.quickInfo: 'Sales Order Item NO'
//    @UI.lineItem: [{position:20 }]
    key SalesDocumentItem,
    
    @UI.selectionField: [ { position: 20 } ]
    @UI.lineItem:  { position: 20, qualifier:'ordOverView', label: 'Customer' }
    _Partneritem.Customer as Customer,
    
//    @EndUserText.label: 'Follow On Document'
//    @EndUserText.quickInfo: 'Delivery Document'
//   // @UI.lineItem: [{position:30, importance: #HIGH}]
//    @UI.identification: [{position: 10}]
//    @UI.fieldGroup: [{qualifier: 'Account Group' }]
    Status,
    
//    @EndUserText.label: 'Material Number'
//    @EndUserText.quickInfo: 'Material NO'
//    @UI.lineItem: [{position: 30}]
    @UI.identification: [{position: 10}]
    materialNumber,
    _vbak.CreatedByUser as CreatedBy,
    
//    @EndUserText.label: 'Material Dec'
//    @EndUserText.quickInfo: 'Material Descrption'
//    @UI.lineItem: [{position: 40}]
    @UI.identification: [{position: 20}]
    MaterialDescrption,
    
//    @EndUserText.label: 'Sales Orgnization'
//    @EndUserText.quickInfo: 'Sales Org'
//    @UI.lineItem: [{position: 50}]
    SalesOrganization   as SalesOrganization,

//    @EndUserText.label: 'Sales Doc Type'
//    @UI.lineItem: [{position: 60}]
    _vbak.SalesDocumentType as SalesDocType,
    
//    @UI.lineItem: [{position: 70}]
    _vbak.DistributionChannel                                       as DChannel,
    
    @UI.hidden: true
    SalesDocumentItemText,
    
    @UI.hidden: true
    UnderlyingPurchaseOrderItem,
    
//    @UI.lineItem: [{position: 80}]
    DeliveryDocument,
    
//    @UI.lineItem: [{position: 90}]
    DeliveryDocumentItem,
  
//    @UI.lineItem: [{position: 110}]
    @Semantics.unitOfMeasure: true
    OrderQuantityUnit,
    
//    @UI.lineItem: [{position: 130}]
    @Semantics.unitOfMeasure: true
    TargetQuantityUnit,
    
//    @UI.lineItem: [{position: 150}]
    @Semantics.currencyCode: true
    TransactionCurrency,
    
//    @UI.identification: [{position: 20}]
//    @UI.fieldGroup: [{qualifier: 'Account Group' }]
    @UI.dataPoint: {title: 'Price Amount', valueFormat:{ numberOfFractionalDigits: 2 }}
    @UI.lineItem:  [{ position: 40, qualifier:'ordOverView', label: 'Tax Amount', type: #AS_DATAPOINT},{qualifier: 'chartLineItem'}]
    @Semantics.amount.currencyCode: 'TransactionCurrency'
    NetPriceAmount,
    
    ShippingPoint,
    Plant,
    StorageLocation,
    Route,
    OriginSDDocument,
    OriginSDDocumentItem,
    ReferenceSDDocumentCategory,
    HigherLevelItem,
    SDProcessStatus,
    SDDocumentRejectionStatus,
    DeliveryDocumentItemCategory,
    StorageBin,
    StorageType,
    DeliveryDocumentItemText,
    DELIVERYQUNATITYUNIT,
    ActualDeliveryQuantity,
    OriginalDeliveryQuantity,
    BaseUnit,
    DeliveryStatus,
    DeliveryRelatedBillingStatus,
    SalesSDDocumentCategory,  
    
    //Aggregations
    @Semantics.quantity.unitOfMeasure: 'ORDERQUANTITYUNIT'
    @DefaultAggregation:#SUM
//    @UI.lineItem: [{position: 100}]
    OrderQuantity,
    
    @Semantics.quantity.unitOfMeasure: 'TARGETQUANTITYUNIT'
    @DefaultAggregation:#SUM     
//    @UI.lineItem: [{position: 120}]
    TargetQuantity,
    
    @Semantics.amount.currencyCode: 'TRANSACTIONCURRENCY'
    @DefaultAggregation:#SUM
//    @UI.lineItem: [{position: 140}]
   @UI.dataPoint: {title: 'Net Amt', 
    criticalityCalculation: {
    improvementDirection: #TARGET,
    deviationRangeLowValue: 000,
    toleranceRangeLowValue: 600,
    toleranceRangeHighValue: 1000,
    deviationRangeHighValue: 1400
    }}
   @UI.lineItem:  [{ position: 30, qualifier:'ordOverView', label: 'Net Amount', type: #AS_DATAPOINT},{ qualifier: 'chartLineItem'}]
    NetAmount,
        
    /* Associations */
    //ZVDM_CO_SALES
    _vbak,
    _LIPS,
    _Material,
    _MaterialText,
    _Partneritem
}

To get the above OVP results we have to change some code in the Manifest.jason file in the WebIDE tool.

As promised in the beginning of this article, we completed Transient Provider, Analysis For Office and Smart Template Application based on CDS VDM Views.

You can explore more about the annotations in CDS views and surprise yourself.

This is my first article at Technicalgyanguru. Your suggestions are welcomed. Do let me know what topics you want me to cover in Core Data Services and Virtual Data Models.

The post S/4HANA VDM 1 Employing CDS Virtual Data Model for Embedded Analytics first appeared on TECHNICAL GYAN GURU.

]]>
https://technicalgyanguru.com/s-4hana-vdm-1-employing-cds-virtual-data-model-for-embedded-analytics/feed/ 0 5505
Section 17 of CDS. How Can I Fix the ABAP CDS GUID Mismatch Linking Issue? https://technicalgyanguru.com/section-17-of-cds-how-can-i-fix-the-abap-cds-guid-mismatch-linking-issue/?utm_source=rss&utm_medium=rss&utm_campaign=section-17-of-cds-how-can-i-fix-the-abap-cds-guid-mismatch-linking-issue https://technicalgyanguru.com/section-17-of-cds-how-can-i-fix-the-abap-cds-guid-mismatch-linking-issue/#respond Thu, 31 Oct 2024 07:26:00 +0000 https://technicalgyanguru.com/?p=5499 I attempted to demonstrate Open SQL’s limitations in relation to SQL Script in my most recent piece. Today, I want to draw attention to a CDS constraint and provide a…

The post Section 17 of CDS. How Can I Fix the ABAP CDS GUID Mismatch Linking Issue? first appeared on TECHNICAL GYAN GURU.

]]>

I attempted to demonstrate Open SQL’s limitations in relation to SQL Script in my most recent piece. Today, I want to draw attention to a CDS constraint and provide a quick workaround. One issue with ABAP CDS Views is that you can’t join tables together if the GUIDs aren’t the same, that is, if one GUID is declared as CHAR and the other as RAW.

CRMD_PARTNER has PARTNER_NO defined as CHAR(32), while BUT000 has PARTNER_GUID defined as RAW(16). The mismatched join fields will cause an error and prevent the view from activating when you attempt to combine these two tables together in an ABAP CDS view. This limitation stems from the HANA SQL query language.

GUID is what we’ll be using for the demonstration. Any field with a mismatched data type could be the problem. And everyone would benefit from our modification.

Making another TYPE of view to handle the join is an easy way to get around this problem. What I’m talking about is an ABAP Dictionary View.Yes, the CDS View can be saved via the standard ABAP Dictionary View.

Dictionary views, as opposed to ABAP CDS views, use Native SQL, which enables the joining of data types that aren’t compatible for GUIDs.

Dictionary views don’t need source code entries, hence there isn’t a DDL source file connected with them because they are built within the SAP GUI editor (ABAP Perspective of HANA Studio or in regular GUI).

Several restrictions on dictionary views

Joins can only be made between tables.

Only INNER JOIN can be used to join them.

There is only one use per table in the view because you cannot alias table names.

No grouping or computation is feasible.

The aforementioned restrictions make it clear that these views must be kept basic, which is appropriate given our goal, which is to merely establish a connecting view between two tables so that it can be used with other, more intricate ABAP CDS views.

Dictionary views can be made using transaction code SE11 directly in the SAP GUI or via the ABAP perspective in SAP HANA Development Studio.

To create in SAP HANA Development Studio, take the following actions:

  • Visit the ABAP viewpoint.
  • Launch the package that needs the view added to it.
  • Expand the Folder Dictionary >> Views.
  • Right-click the name of the “Views” folder.
  • Choose “New Dictionary View.”
  • Alternatively
  • Visit the ABAP viewpoint.
  • To add the view, right-click on the package and select
  • Choose “Other ABAP repository object” by clicking New.
  • Slide open the Dictionary folder.
  • Choose Dictionary View, then Click Next.
  • Next

6. You’ll see the screen that follows.

You can construct two different kinds of views: External View and Dictionary View.In this instance, dictionary views are the only thing that matter.

7. Enter the view name desired and select Dictionary View

  1. The transaction code SE11 maintenance screen appears. From there, you may choose the relevant tabs to add tables, join criteria, fields to output, and selection criteria to apply.

Alternatively, the following procedures can be used to construct the view directly within the SAP GUI.

  • Put in the transaction code SE11.
  • After entering the view name, select Create.

After entering a description, specify the tables and necessary join requirements.

4. Fill out the required basic fields. For a link table, these should only include the CLIENT and the two GUIDs that are used in the join.

You can add more fields if you’d like, but remember that the main purpose of this view is to serve as a connecting table, so simplicity is preferable.

The type mismatch between the GUIDs will be displayed in the activation log, along with the following cautions.

After making all the necessary entries, save, activate, and designate to a transport.

We can disregard the alert.The database view is now available.

See Also: Complete SAP ABAP on HANA Tutorials.

As of right now, the following view can be used to join CRMD_PARTNER with BUT000 inside of an ABAP CDS view:

SELECT FROM CRMD_PARTNER AS PART
INNER JOIN ZVW_PARTNER_LINK AS LINK
ON LINK.CLIENT = PART.CLIENT 
AND LINK.PARTNER_NO = PART.PARTNER_NO
INNER JOIN BUT000 AS B000
ON B000.CLIENT = LINK.CLIENT
AND B000.PARTNER_GUID = LINK.PARTNER_GUID
{
<desired fields>
}

Take a good look at the database view in the sample above. By serving as the intermediary between the two CDS Views, the database view has successfully solved the issue of joining CRMD_PARTNER direct with BUT000 with GUID mismatch (data element mismatch). Additionally, as it is a CDS View, it allows for the possible use of LEFT OUTER JOIN between the tables.


The post Section 17 of CDS. How Can I Fix the ABAP CDS GUID Mismatch Linking Issue? first appeared on TECHNICAL GYAN GURU.

]]>
https://technicalgyanguru.com/section-17-of-cds-how-can-i-fix-the-abap-cds-guid-mismatch-linking-issue/feed/ 0 5499
CDS Part 18: Using CDS Views to Create Bar and Donut Charts https://technicalgyanguru.com/cds-part-18-using-cds-views-to-create-bar-and-donut-charts/?utm_source=rss&utm_medium=rss&utm_campaign=cds-part-18-using-cds-views-to-create-bar-and-donut-charts https://technicalgyanguru.com/cds-part-18-using-cds-views-to-create-bar-and-donut-charts/#respond Wed, 30 Oct 2024 08:53:00 +0000 https://technicalgyanguru.com/?p=5522 Three batches of students in our instructor-led online ABAP CDS training have just finished. The result of our training is this paper. Without any prior experience with HTML, JS, or…

The post CDS Part 18: Using CDS Views to Create Bar and Donut Charts first appeared on TECHNICAL GYAN GURU.

]]>

Three batches of students in our instructor-led online ABAP CDS training have just finished. The result of our training is this paper. Without any prior experience with HTML, JS, or Fiori, we demonstrated to the participants how to use the CDS in SAP Fiori. Our most well-liked training session was on creating Fiori Apps using CDS View. As a result, we considered sharing the same with Technicalgyanguru customers and our larger audience.

We have two objectives, as the title indicates. Using ABAP CDS, generate a bar chart first, and a donut chart second. Let’s get right to the instruction without skirting the issues.

Objective 1: Use CDS to create a SAP Fiori bar chart without any HTML or JS coding.

  • There are six tasks to complete.
  • Establish CDS View
  • Open CDS View in OData Format
  • Create and/or Enable the OData Service
  • Put the CDS View’s UI Annotations to Use
  • In the Web IDE, create the Fiori App.
  • Using the Fiori App, Add Cards

Create a CDS View and retrieve data from the database table in step one.

@AbapCatalog.sqlViewName: ‘ZTM_FNS_SQL’
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: ‘CDS View to for Fiori App’

// CDS View for List Report (Bar Chart).
define view ZTM_FNS
  as select from t001k
{
  key bukrs    as com_code,
  key count(*) as tot_plants
}
group by
  bukrs

Step 2: Make the CDS View Available as OData

@OData.publish: true

Step 3: Use the t-code /N/IWFND/MAINT_SERVICE to activate the OData in the SAP Backend.

As soon as the service appears in the list below, indicated by the green arrow. Select the default DPC and MPC classes by double clicking on it, then activate and save it in a transport (or $tmp).

  • The OData will appear in the Service Catalog in t-code /N/IWFND/MAINT_SERVICE once it has been launched.
  • The CDS name will be your OData Service name, followed by _CDS.

Select SAP Gateway Client and run an OData test.

The initial test status code is 200, indicating a successful result. Let us test the Entity Set using URI –  /sap/opu/odata/sap/ZTM_FNS_CDS/ZTM_FNS

$format=json.

Thus, we may say that OData functions properly.

Please watch the free video course on SAP OData Services and the tutorial series if you are unfamiliar with SAP OData Concepts.

Apply the UI Annotations to the CDS View in Step Four.

  • @UI.lineThe item is utilized liberally.
  • @UI.lineItem: [{ label: ‘Company Code’, position: 10}]

The determination of position is done in multiples of 10. For instance, 10, 20, 30, etc., with 10 in the top spot.

We require a qualifier if we utilize a single CDS View to create two Cards, or separate charts (such as a bar chart and a donut chart on the same page). It aids in the Fiori’s Card identification. Separate ones are for the Bar Chart and the Donut Chart. The UI uses qualifier to assist distinguish between the Cards.

The UI Annotation is enhanced with the Qualifier ‘Q1’. It can be any name. You can also name your Qualifier as ‘Technicalgyanguru’. ?

@UI.lineItem: [{ position: 10, label: ‘Company Code’, qualifier: ‘Q1’}]

TOT_PLANTS in our CDS View is a measure. The measures (numbers) are indicated in UI.lineItem type #AS_DATAPOINT.

Now, let us enhance the UI annotation for TOT_PLANTS field.

@UI.lineItem: [{ position: 20, label: ‘Total Plants in CC’, qualifier: ‘Q1’, type: #AS_DATAPOINT } ]

When you specify a field as DATAPOINT, you need to specify the UI.dataPoint Properties before the #AS_DATAPOINT type is mentioned.

      @UI.dataPoint:
{
      title: ‘Number of Plants in CC’,
      criticalityCalculation: {
             improvementDirection: #TARGET,
             toleranceRangeLowValue: 8,
             deviationRangeHighValue: 10
                               }
       }

The CriticalityCalculation helps in coloring the bar. With the above values, if the toleranceRangeLowValue is 8 to 10, then Green. If deviationRangeHighValue is 10 or more, it will be Red. If it is below 8, it will be Yellow.

The CDS should look like this now.

Note: When we write the UI Annotations in CDS Views, it generates the Annotation file behind the scene which will be used by Fiori App. The Annotation file has the suffix _VAN. (We will see its usage in the next part below)

If your CDS View name is ZMATMAS, then you OData Service will be ZMATMAS_CDS and you Annotation file will be ZMATMAS_CDS_VAN. Hope this is clear. ?

Step 5 – Create Fiori App in WebIDE

We will select the Category as SAP Fiori Element and template as Overview PageDo see the preview of overview page on the right.

Give the Project Name, Namespace and Title.

Choose your SAP backend system and give userid and password.

Choose the OData we created in the above steps and hit Next.

Select the Annotation File,

Provide the password and backend userid. Look below

New Project is created.

Let us test it. Yes, that’s it. Your Fiori App is ready. No coding needed. Told youuu.. 

Give the backend userid and password. Check below, there is no output shown. Why?

as the Card has not yet been uploaded. Our activity comes to an end there.

Also See: ABAP on HANA Tutorials: Comprehensive

Step 6: Add a card using the Fiori App.

When you right-click Project, choose “New Card.”

 List Card.

Using #‘qualifierName’ to define the qualifier in the Annotation Path (LineItem) is a crucial step.

For the Selection Screen, use the Selection Variant.
For the first default presentation, use PresentationVariant.

Measures are for DataPoint (number). These qualities will be useful in the upcoming activity.

We must choose Add OData Select under Card Properties. The OData URI options like $select, $top, and so forth will be enabled.

List Type = Extended or Condensed
List Flavor = Bar
Sort By = com_code
Sort Order = Ascending

Hit next.

Finish.

The Card properties are added to the Manifest file when we save it. One alternative would be to manually enter the code for each property we choose in the wizard steps above to the Manifest file.However, we favor less coding and greater automation. We also promise to use no Fiori code in this tutorial.

Company Code is displayed in ascending order in the output above. We can modify the sorting by tot_plants and in descending order in the manifest file if you would like to sort by Total Plant counts.

OutPut Now

Why are 11 Red and 8 Green?

as our CDS View was where the criticality computation was established. Just take another look at the code. You can play around with the numbers to acquire the colors you like.

You’ve managed to write an application with a bar chart without utilizing any HTML, CSS, or JS code.

Also Read: Virtual Data Model for Embedded Analytics

Now let’s update the SAP Fiori App on the right with a Donut Chart.

Goal 2: Make a SAP Fiori Donut Chart with CDS without knowing any HTML or JS code.

The same six stages must be followed for this practice as well.

  • Establish CDS View
  • Open CDS View in OData Format
  • Create and/or Enable the OData Service
  • Put the CDS View’s UI Annotations to Use
  • In the Web IDE, create the Fiori App.
  • Using the Fiori App, Add Cards

We will utilize the same CDS to accomplish our goal of displaying the bar chart and donut chart on the same layout.

Step 1: Make updates to the previously generated CDS View.

The UI Annotation for Charts must be at the Top level. The single user interface can have several charts. Qualifiers must be used to identify and distinguish them.

// Donut Chart Annotation
@UI.chart: [{
      qualifier: ‘Q2’,
      title: ‘Plant Count’,
      chartType: #DONUT,
      dimensions: [‘com_code’],
      measures: [‘tot_plants’],
      dimensionAttributes: [{ dimension: ‘com_code’, role: #CATEGORY }],
      measureAttributes: [{ measure: ‘tot_plants’, role: #AXIS_1, asDataPoint: true }]
      }]

As mentioned in the last exercise, the measure (number) should appear in the user interface as DataPoint.

measureAttributes: [{ measure: ‘tot_plants’, role: #AXIS_1, asDataPoint: true]

Note: When making bar charts, the X and Y axes need to be given. But when creating donut charts, the measures and dimensions have to be mentioned.

This is how the CDS will now look.

Add a new card for the doughnut chart to the Fiori App.

The final step is to add the new Card to the Fiori App.

Choose Right Click -> New -> Card.

The Annotation Path should ideally appear in the drop-down menu. However, in our situation, it is not appearing (not sure why; I assume we need to reassign the _VAN file because we inserted new annotations).

The wizard adds a couple of lines to the manifest file, as we saw in our earlier example. Since the annotation path is not being added automatically, we will either manually add the lines to the manifest file or add them directly.

Add the lines of code that follow. Should your qualifier differ, be sure to adjust it. Q2 is the second qualifier for our case.

“card01”: {
“model”: “ZTM_FNS_CDS”,
“template”: “sap.ovp.cards.charts.analytical”,
“settings”: {
“title”: “{{card01_title}}”,
“subTitle”: “{{card01_subTitle}}”,
“entitySet”: “ZTM_FNS”,
“chartAnnotationPath”: “com.sap.vocabularies.UI.v1.Chart#Q2”,
“dataPointAnnotationPath”: “com.sap.vocabularies.UI.v1.DataPoint#Q2”,
“identificationAnnotationPath”: “com.sap.vocabularies.UI.v1.Identification#Q2”,
“navigation”: “dataPointNav”
}
}

Go to i18n and add it.

The UI can have more Cards added to it. To add a card, follow the same procedures.Simply enter the new card details in the manifest file directly if the wizard isn’t working.

Point to Note: Qualifiers are required if we use a single CDS View to build two or more cards. It aids in the Fiori’s Card identification. There are separate ones for the Bar Chart (Q1), Donut Chart (Q2), Pie Chart (Q3), and so on. Qualifier so aids in the UI’s ability to distinguish between the Cards.

We remain inspired by your thoughts and feedback. Please continue to send them.Please let us know what subjects you would like us to address in the Core Data Services and Virtual Data Model sections.

Let’s Web Dynpro. Part VI

The post CDS Part 18: Using CDS Views to Create Bar and Donut Charts first appeared on TECHNICAL GYAN GURU.

]]>
https://technicalgyanguru.com/cds-part-18-using-cds-views-to-create-bar-and-donut-charts/feed/ 0 5522
Eclipse Set-Up for ABAP Cloud in ABAP on Cloud – 3 https://technicalgyanguru.com/eclipse-set-up-for-abap-cloud-in-abap-on-cloud-3/?utm_source=rss&utm_medium=rss&utm_campaign=eclipse-set-up-for-abap-cloud-in-abap-on-cloud-3 https://technicalgyanguru.com/eclipse-set-up-for-abap-cloud-in-abap-on-cloud-3/#respond Tue, 29 Oct 2024 09:02:00 +0000 https://technicalgyanguru.com/?p=5540 The creation of a SCP trial account and a service key were the topics of the last two tutorials. The subsequent procedures for installing the Eclipse Platform, which acts as…

The post Eclipse Set-Up for ABAP Cloud in ABAP on Cloud – 3 first appeared on TECHNICAL GYAN GURU.

]]>

The creation of a SCP trial account and a service key were the topics of the last two tutorials. The subsequent procedures for installing the Eclipse Platform, which acts as the ABAP on Cloud Integrated Development Environment (IDE), will be covered in this article.

Given the diverse backgrounds of the audience, it is important to comprehend a few nuances in each of the specialized fields:

SAP ABAP/Functional: NO T-Code use in ABAP Cloud and NO GUI Screens.
No longer must they be recalled or used. Some examples of often used ones are SE11, SE80, SE24, SM30, SU01, ST12, MM01, ME21, VA01, etc.

  1. OData Consultants: Forget about central hub systems, RFC destinations, registration of services, gateway services, and T-Codes, among other things.

Indeed, the admin must create this one-time activity even though the destinations are predetermined in the SCP.

After installing JDK and Eclipse, it’s time to open Eclipse.

See Also: SAP Fiori ABAP Programming Model – 1 – Overview

To see the screen that is displayed below, double-click the desktop icon or launch from the Start menu:

Development objects can be given a workspace by using the screen above.

Simply select “Launch.”

Note that the menu bar labeled “Help” has a drop-down list. Press it.

Select “About Eclipse.”

5. Verify that the version is 4.11 or greater.

6. Use the same “Help” drop-down menu to select “Install New Software.

7. A new pop-up window appears with the placeholder value “type or select a site” at the top of the “Work with: Section.

8.After selecting “Add,” enter the following links in the new pop-up box according to the version.

9. After selecting “Add,” the screen below appears:

10. As indicated, choose every instrument that is relevant:
Press the “Next” button.

Select on “Next”.

11. Every component listed as “To be Installed” is visible:

12. Click “Finish” to begin downloading the necessary tools after agreeing to the terms.

13. Watch the Eclipse IDE’s right bottom and wait.

14. As demonstrated, a successful installation produces a pop:

15. Select “Restart Now” and watch for the IDE to reopen.

16. Select “Other” by using the navigation as indicated below:

17. After choosing “ABAP,” click “Open.

18. The ABAP icon is displayed in the upper left corner. Press the button.

19. Note that the project explorer space now has “Create an ABAP Cloud Project” marked.

20. Additionally, the “Release Notes” are essential for verifying that the project is using the most recent ABAP Environment releases.

The setup for learning ABAP on Cloud Hands-On is now complete. We’ll discuss the completion of the ABAP Cloud using the service key we generated in the previous post in the following one.

I recognize that you are eager to develop your first cloud-based ABAP program. My friend, please be patient. We can’t wait to present our first ABAP code in the cloud. We assure you that patience bears sweet fruits. We’re about to write our first ABAP program on the cloud.

The post Eclipse Set-Up for ABAP Cloud in ABAP on Cloud – 3 first appeared on TECHNICAL GYAN GURU.

]]>
https://technicalgyanguru.com/eclipse-set-up-for-abap-cloud-in-abap-on-cloud-3/feed/ 0 5540
ABAP on Cloud – 7 – Insert Records through Class and Create Metadata Extension https://technicalgyanguru.com/abap-on-cloud-7-insert-records-through-class-and-create-metadata-extension/?utm_source=rss&utm_medium=rss&utm_campaign=abap-on-cloud-7-insert-records-through-class-and-create-metadata-extension https://technicalgyanguru.com/abap-on-cloud-7-insert-records-through-class-and-create-metadata-extension/#respond Mon, 28 Oct 2024 08:21:00 +0000 https://technicalgyanguru.com/?p=5557 Let’s start where we left off in the previous article, just for a change! Please take a moment to read our previous article, then come back here to get the…

The post ABAP on Cloud – 7 – Insert Records through Class and Create Metadata Extension first appeared on TECHNICAL GYAN GURU.

]]>

Let’s start where we left off in the previous article, just for a change! Please take a moment to read our previous article, then come back here to get the full tale.

When you double-click the wrench icon, a new window containing the ZEMP_DTLS table’s technical specifications emerges.

We can add the data class, size category, storage type, buffering, and other features, just as in conventional ABAP. We can also specify the Log Changes.

Buffering: Since we are aware of the precise kind of action being carried out, this version of ABAP is far better than the traditional one.

How can the entries be added to the database? Through ABAP Course?

First step:

Select “Other ABAP Repository Object” with a right-click on your ABAP Cloud Project.
After expanding “Source Code Library,” choose “ABAP Class.” Select “Next.”

Step 2:

After entering the name and description, click “Next.” Choose the standard TR. Complete.

Step Three:

Take note of the Global Class section and the Class-relevant Local Types tab.

Worldwide Class

As is common knowledge, the section must contain all necessary data, such as the definition of the class, methods, and parameters (for importing, exporting, updating, and returning).

Section 1: Fixed Techniques

The following variations of the statement “CLASS-METHODS distinguish different types of method declaration” are listed in the SAP documentation:

  • Generally used static techniques
  • Any number of input and output parameters can be defined for static methods in classes and interfaces using the most general form of the CLASS-METHODS statement.
  • Static Functional Approaches
  • Classes and interfaces’ functional methods can have any number of formal parameters and have precisely one return value.
  • Constructors that are static
  • Methods with the preset name class_constructor that are automatically called before their class is used are known as static constructors of classes. Static constructors cannot be expressed in interfaces and lack a parameter interface.
  • Event handlers that are static
  • The static methods of classes and interfaces that get called when a class or interface event occurs are known as static event handlers. An event handler’s formal parameters are limited to input parameters.

Section 2: Dynamic Methods

As can be observed in the ABAP documentation, the various instance method variations are as follows.

Methods for general instances
It is possible to define instance methods with any combination of input and output parameters using the general version of the METHODS statement.

Practical instance techniques
Functional methods can take any number of formal parameters and have precisely one return value.

builders of instances
When a class is instantiated, methods with the name constructor are called automatically; these are known as instance constructors. Constructors don’t have any output parameters and can have any number of input arguments. In interfaces, they cannot be declared.

Event coordinators
Although they can be called directly from statements or within statements, event handlers are primarily called in response to an event triggered by an interface or class.

Step 4:

After defining an interface, put a method into practice.

We must use the crucial “if_oo_adt_classrun” interface in order to add new entries and see the status.

Step 5:

To insert records, add the necessary code.

Step 6:

Run Program F9

A few things to note here:

Unlike standard ABAP, we are operating without a GUI or selection screen to view the output.
Here, we have an object known as CONSOLE that records the necessary output.

A basic internal table is declared in our code.
New values are included.

There’s one thing that matters here. Zempid = cl_system_uuid=>create_uuid_c32_static() is what we’re using.
For those in the know, this is hardly a novel idea. Please let us know if you are unsure.

Put written statement here.
Ultimately, the success message appears in the console thanks to out->write(‘Success’).

Thus, this is among the MOST IMPORTANT example codes that can be utilized wherever in the ABAP Cloud where CODE ALONE is required to manipulate data.

In the interim, until a Fiori App is ready, this is the appropriate course of action for adding, editing, and removing records.

Step 7:

Verify that records have been added to the database table.

F8 is the shortcut to launch the DB Table data preview.

Exactly right! A record is made.

Again you see we have done wonderful job so far!!!

Step 9:

Yes, a database table was created. Completed. Click this.

Access Control for Data: False. Let us ignore this for the time being.

We are able to manage both this and the authorizations topic.

Extension of Metadata – No. Next Subject!!!

Definition of Behavior – No. Next Article

Next Article: Behavior Implementation – No.

Let’s try to be fair now. Let’s add some metadata extensions to give the view more strength.
Choose “Core Data Services” -> New -> Metadata Extension with a right-click.
Alternatively, right-click the package and select “Core Data Services” -> New -> Metadata Extension -> New -> Other ABAP Repository Object.

then, Next -> Next -> Finish.

Step 10:

Put in the code as shown below:

@Metadata.layer: #CUSTOMER
@UI.headerInfo: { typeName: 'Employee Detail',
typeNamePlural: 'Employee Details',
title.value: 'zempid',
title.criticality: 'zempdesg'
}
annotate view Z_I_EMP_DTLS
with
{
@UI.facet: [{ id : 'zempid',
              type: #IDENTIFICATION_REFERENCE,
              label: 'Employee Details'}]  
@UI.lineItem: [{position: 10, label: 'Employee ID'}] 
@UI.identification: [{ position: 10, label: 'Employee ID' }]  
zempid;

@UI.lineItem: [{position: 20, label: 'Employee Name'}] 
@UI.identification: [{ position: 20, label: 'Employee Name' }]
zempname;

@UI.lineItem: [{position: 30, label: 'Employee Designation'}] 
@UI.identification: [{ position: 10, label: 'Employee Designation' }]
zempdesg;

@UI.lineItem: [{position: 40, label: 'Employee Gender'}] 
@UI.identification: [{ position: 10, label: 'Employee Gender' }]
zgender;

@UI.lineItem: [{position: 50, label: 'Employee Salary'}] 
@UI.identification: [{ position: 10, label: 'Employee Salary' }]
zsalary;

@UI.lineItem: [{position: 60, label: 'Salary Currency'}]
@UI.identification: [{ position: 10, label: 'Salary Currency' }] 
zcurrency_key;
}

Turn on. by pressing Ctrl + F3.

Was there a logical conclusion to the article? Have we overlooked anything?

It goes without saying that the code contained in the metadata extension and its annotations need to be addressed. These are critical because they allow ABAP to become a UI (proxy) Expert.

Have fun coding and don’t stop asking questions! Recall that there are numerous unresolved issues in the essay that need to be addressed.

We hope that our astute insights will highlight a few points; please include them in the comment area.

Please leave a comment!

WSDL file in SAP – Part I

The post ABAP on Cloud – 7 – Insert Records through Class and Create Metadata Extension first appeared on TECHNICAL GYAN GURU.

]]>
https://technicalgyanguru.com/abap-on-cloud-7-insert-records-through-class-and-create-metadata-extension/feed/ 0 5557