Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
navinoth
Discoverer
0 Kudos
3,037

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.

navinoth_0-1706601693044.png

 

Now create an ABAP Package like the one below.

navinoth_1-1706601693058.png

 

Enter the package name and description and click next

navinoth_2-1706601693067.png

 

Select Create a new request and enter the description to assign the package under a Transport Request and finish the package creation.

navinoth_3-1706601693075.png

 

navinoth_4-1706601693083.png

 

Create a CDS data definition by right-clicking the package as shown below.

navinoth_5-1706601693090.png

 

navinoth_6-1706601693097.png

 

Enter the CDS name and Description

navinoth_7-1706601693104.png

 

Assign the Transport Request for the CDS.

navinoth_8-1706601693111.png

 

After clicking finish CDS view will be created.

navinoth_9-1706601693117.png

 

navinoth_10-1706601693129.png

@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.

navinoth_11-1706601693136.png

 

navinoth_12-1706601693143.png

 

Conclusion:

Here we created a CDS view on the ABAP on BTP, we continue to learn more and will see how to expose this as a service to consume in the upcoming series of blogs.

Labels in this area