Overview of ABAP for BTP
The foundation of SAP modification and development has always been ABAP. Developers may now fully utilize cloud-based solutions and expand the reach of ABAP applications to unprecedented levels thanks to the integration of ABAP on BTP. BTP offers a flexible and scalable platform that makes it possible to integrate numerous SAP and non-SAP services with ease.
Begin with Creating a Trial user and installing ADT tools
SAP has given a provision to create a trial user in the BTP environment - Create a Trial user - SAP BTP ABAP Environment
Install ABAP Development tools - Install ADT Tools
Create a cloud project - Cloud Project
Create and Expose the CDS View in the BTP environment
Once you installed the ADT and created a cloud project it will look similar to the one below.
Now create an ABAP Package like the one below.
Enter the package name and description and click next
Select Create a new request and enter the description to assign the package under a Transport Request and finish the package creation.
Create a CDS data definition by right-clicking the package as shown below.
Enter the CDS name and Description
Assign the Transport Request for the CDS.
After clicking finish CDS view will be created.
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'CDS DATA MODEL'
define root view entity ZCDS_LEARN
as select from ztab_travel as Travel
/* Associations */
association [0..1] to /DMO/I_Agency as _Agency on $projection.agency_id = _Agency.AgencyID
association [0..1] to /DMO/I_Customer as _Customer on $projection.customer_id = _Customer.CustomerID
association [0..1] to I_Currency as _Currency on $projection.currency_code = _Currency.Currency
{
key mykey,
travel_id,
agency_id,
customer_id,
begin_date,
end_date,
@Semantics.amount.currencyCode: 'currency_code'
booking_fee,
@Semantics.amount.currencyCode: 'currency_code'
total_price,
currency_code,
overall_status,
description,
/*-- Admin data --*/
@Semantics.user.createdBy: true
created_by,
@Semantics.systemDateTime.createdAt: true
created_at,
@Semantics.user.lastChangedBy: true
last_changed_by,
@Semantics.systemDateTime.lastChangedAt: true
last_changed_at,
/* Public associations */
_Agency,
_Customer,
_Currency
}
Here we completed our first CDS creation in the ABAP on BTP environment. We can see the data preview by running the CDS in the eclipse.
No comments:
Post a Comment