Building ABAP Application with RESTful ABAP Programming Model

Jul 8, 2024

Building ABAP Application with RESTful ABAP Programming Model

Introduction

  • Lecturer: Robert
  • Focus of the lecture:
    • Building an app to display, edit, delete, and create YouTube videos using ABAP RESTful Application Programming Model.
    • Key functionalities: create a table, insert data, provision an OData service, adapt UI with metadata extensions, display thumbnails.
  • Tools & Environment:
    • Eclipse development environment for ABAP
    • Previous video recommendation: Eclipse for ABAP developers

Live Demonstration Overview

  • App Features: Overview
    • List view showing video titles, descriptions, and hyperlinks.
    • Edit, create, delete functionalities.
    • Thumbnail display as virtual elements in the first column.

Development Steps

  • Creating a Package in Eclipse
    • Create a package video for the app: favorite packages > right-click > new ABAP package
    • Add a description “YouTube videos”, set super package to local.
  • Creating a Table
    • Create a database table in Data Dictionary: right-click package > new > other ABAP repository > table
    • Fields for the table: title, URL, description, video UUID, timestamps, and user fields.
    • Save and activate the table

Filling Table with Data

  • Executable ABAP Class Creation
    • Create ZL_VIDEO_GENERATOR class to insert data: right-click package > new ABAP class
    • Add interface: IF_OADT_CLASSRUN
    • Implement method to add records into the table
    • Activation & Execution: Save, activate, execute to insert test data
  • Insertion of Real Data
    • Replace test data with actual video entries
    • Script to set title, URL, and description, populate timestamps and user info automatically.

Generating OData UI Service

  • Using Generator
    • Generate artifacts: right-click table > generate ABAP Repository Object > OData UI Service
    • Confirm package, transport request, repository objects, and finish.
    • View generated artifacts: CDS view entity, behavior definitions, ABAP classes, service definitions, metadata extensions
    • Publishing Service: Open service binding and publish
  • UI Preview & Improvements
    • Initial UI review: Check list, format changes needed.
    • Adjust annotations in CDS projection and metadata extensions for UI layout.
    • Implement clickable hyperlinks and hide unnecessary fields (UUID, timestamps, user fields).

Advanced UI Enhancements

  • Creating Virtual Elements
    • Add virtual field for thumbnails in projection view
    • Create ABAP class to calculate thumbnail URLs
    • Script to extract video IDs and construct thumbnail URLs dynamically.
    • Integration into projection view annotations and table
  • Metadata Extension Configuration
    • Adjust list view to display virtual thumbnails in the first column.
    • Update header info in the object page to show title and thumbnail.
    • Save, activate changes, and view in browser for final confirmation.

Conclusion

  • Summary: Demonstrated creation of a functional ABAP application to manage YouTube video entries with enhancements in the UI for a better user experience.
  • Next Steps: Encourage viewers to like, subscribe, and enable notifications for future videos.