0% found this document useful (0 votes)
22 views20 pages

SAP ABAP RAP Application Guide

This training document outlines the steps to develop an Adobe form and a RAP application using SAP ABAP, focusing on creating a consumption view and integrating it with a Fiori application. It details the creation of service bindings, testing the SEGW ODATA service, and adding custom actions for PDF previews. The document serves as a guide for building and testing a RAP application with specific functionalities and integration methods.

Uploaded by

snehalchavan899
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views20 pages

SAP ABAP RAP Application Guide

This training document outlines the steps to develop an Adobe form and a RAP application using SAP ABAP, focusing on creating a consumption view and integrating it with a Fiori application. It details the creation of service bindings, testing the SEGW ODATA service, and adding custom actions for PDF previews. The document serves as a guide for building and testing a RAP application with specific functionalities and integration methods.

Uploaded by

snehalchavan899
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SAP ABAP

RAP
Training Document
September 2025

Prepared by: WraysTech Academy


Training Team
Version 1.0

Confidential – For Training & Educational Purpose Only*


Steps to be followed. [Link] an Adobe form and common method to give the
form content output as Base64
In this example I am using XML Based form interface but it is possible to use
the ABAPbased interface as
Dictionary
well.
Form Name:
ZZ1_SALE_ORDER

Here I am creating a new class and build the driver Method to call the form using
back the output form
and return
content
[Link] Let us build a RAP Application using Web UI -> Since we do not have Create,
update and other functionalities, I am not creating behavior definitions.

Create a Consumption View for the Above View Entity:


ZC_RAP_SALE_ORD
@[Link]:#NOT_REQUIRED @[Link]:
'Consumption View for Sales Order' @[Link]: true define root
view entity ZC_RAP_SALE_ORD provider contract transactional_query as
projection on ZI_RAP_SALE_ORD { key SalesDocument, SDDocumentCategory,
SalesDocumentType, CreatedByUser,
Create a new Service Bindings for the Service Definition:
ZBIND_ZC_RAP_SALE_ORD of binding type ODATA V2 - UI and publish it. We can
get the Metadata using Service URL

Create a new Fiori Application in Business Application Studio, Open BTP in Trail
account and make sure your system is configured in Destinations

[Link] a new Fiori Application using the template and use our above ODATA V2-UI
service in BAS
Once the Project is created and all the dependencies is installed. You can preview the
application by right click project1 and choose preview application -> start Fiori-run

Now our RAP Application is ready and separate form driver program is also ready. Let
us see on howto integrateit. ThisIntegrationcan be Donebythefollowing two ways
➔ Using SEGW ODATA -> GET_STREAM Using Custom View Entity that is
➔ implemented by ABAP class using Object model query
[Link] a New SEGW ODATA Project and Implement GET Stream method That
consumes the common driver program and send back the content
Entity properties

Testingthe SEGW ODATA Service


Add the Following highlighted Line in the Consumption view ZC_RAP_SALE_ORD to
expose the fields

Add the Following Lines in the Metadata extension file to establish


the link to:
@UI:{
lineItem: [{ position : 60, label : 'PDF'}, { type : #WITH_URL, url:'LinkToPDF' }]
}

ShowPDF;
Testing the RAP Application- Now we can see the New Field as
clickable link
On clicking the Link, the SEGW Service is called and PDF is
shown
Create a new Service binding for the Custom Entity of type ODATA V2 Web API and
publish it
Test the Service Definition using Service
URL:

Since we get the Data in Base64 format we need to create a extension in the UI
application. Right Click the project and open guided Development
Choose the “1. Add Custom Action to page Using Extensions”, then give the Function
Name and click on create. This will add a new Controller file in the project

Now Choose the “2. Update the manifest”, then give the Entity Set as the root entity
set, Action Id, Row selection and Button text. Then click insert snippet
Extensions will be added by guided development in
manifest file

Need to add the following lines in the


[Link] file
->In the dataSources
property:
->In the models
property:
We can write out custom code in the added Controller file to open PDF
Preview To get the PDF data from RAP ODATA Web API
Now test the Application: Print Preview Button is
added

You can select any Sale order to enable the Print Preview button and click it to open
the PDF file

Common questions

Powered by AI

The 'showPDF' feature in SAP's Business Application Studio greatly enhances the user experience in RAP applications by offering users direct interaction with document outputs like sales orders in their web applications. This feature turns static data into interactive elements where users can click on links to view detailed PDF documents generated using their application's data, without leaving the application interface. This integration into the browsing experience reduces context switching, provides immediate feedback on processed data, and enhances productivity by allowing users to instantly verify form-based data representation and confirm transaction details. Adding this feature through guided development and custom manifest configurations in the UI means that functional enhancements are quick to develop and deploy, further enhancing the application's responsiveness to business needs .

Using guided development in SAP ABAP RAP provides several advantages for updating application components. First, it simplifies the process for developers by offering a structured approach where changes can be made incrementally with step-by-step instructions, reducing the likelihood of errors. This is especially useful when dealing with complex applications that have numerous components, as guided development helps ensure that modifications are consistent across the application's architecture. Additionally, it allows for the straightforward inclusion of new features or extensions, like custom actions or UI enhancements, minimizing manual coding effort and fostering standardization. Finally, this approach is beneficial for maintaining documentation and traceability of changes, facilitating debugging and enhancing collaboration among team members working on the application .

To create a Fiori application using an OData service in SAP ABAP RAP, developers should follow these steps: First, create a new service binding for the service definition (e.g., ZBIND_ZC_RAP_SALE_ORD) and select the binding type as ODATA V2-UI. Next, publish the service binding to make metadata available using its Service URL. Then, open the Business Application Studio (BAS) under the configured trial account within SAP BTP. Use a template to create a new Fiori application by incorporating the specified ODATA V2-UI service. After creating the project and installing dependencies, you can preview the application by right-clicking on the project and selecting 'preview application -> start Fiori-run'. This comprehensive setup facilitates the development of a dynamic and service-linked Fiori application .

The integration of SEGW OData services with a common driver program in SAP ABAP RAP applications optimizes process workflows by linking backend data processing capabilities to frontend applications efficiently. The common driver program acts as a centralized point that handles complex logic, such as rendering Adobe forms, transforming the data into a standardized format like base64 for seamless transmission via OData services. SEGW allows definition and implementation of these services, utilizing methods like GET_STREAM for data retrieval and processing, which are then exposed through consumption views and service bindings. This approach reduces redundancy, ensures consistency across different services utilizing the same logic, and enhances the reusability of established logic and processes, ultimately leading to streamlined workflows and higher system efficiency in the RAP environment .

The 'GET_STREAM' method in SAP OData services plays a crucial role in facilitating the transmission of binary stream data, such as PDF files, within RAP applications. This method enables applications to handle requests where form or document data needs to be dynamically generated and sent as a stream to the client. It is typically used when integrating functionalities like PDF previews in web applications, allowing developers to tap into stored procedures and workflows that generate such binary outputs in real-time. By utilizing 'GET_STREAM', these services ensure that the client receives a seamlessly compatible and consumable data format, supporting the dynamic presentation of documents in applications and enhancing user interaction with transactional data. This method streamlines workflows involving document generation and delivery, crucial for applications that have significant engagement with document management functionalities .

In SAP ABAP RAP, a 'Consumption View' enhances data interaction by abstracting the underlying complexities of the raw data structure and providing a simplified, logical perspective that is conducive to app development and service consumption. It is designed to offer a streamlined interface to expose necessary information to end-users or services without delving into the technical details of how data is stored or managed. Metadata plays a pivotal role in this setup by describing the structural attributes of data, defining how views relate to one another, dictating data processing rules, and ensuring the data is presented consistently and meaningfully within the RAP application's context. The metadata annotations in views enable integration within the ecosystem by providing extensibility and adaptability features necessary for dynamic business environments .

Publishing a service binding of the type 'ODATA V2 - UI' in SAP ABAP RAP provides key benefits, particularly in business applications, by enhancing interoperability and front-end data presentation. ODATA V2 is a widely supported protocol that facilitates communication between SAP systems and various web technologies, ensuring that RAP applications can integrate smoothly with existing SAP infrastructures or third-party applications. This service type supports powerful querying, filtering, and data manipulation capabilities needed for robust business functionality, enabling applications to respond efficiently to data-intensive operations and business logic demands. Furthermore, it allows for the creation of dynamic, user-friendly interfaces that can bind directly to data sources in a scalable manner, essential for delivering comprehensive business solutions within SAP's ecosystem .

The configuration in the 'Manifest.json' file of a Fiori application significantly affects the incorporation of custom actions and features in SAP ABAP RAP by defining how the application interacts with data sources and UI components. By configuring the 'dataSources' and 'models' properties accurately, developers can specify which back-end services to connect and how to bind data to components. Additionally, incorporating extensions through guided development allows developers to embed custom actions directly into the UI, such as adding buttons for functions like PDF previews, seamlessly integrating behind-the-scenes processing tasks with user-triggered events. This configuration flexibility allows the application to scale and adapt to complex business processes, ultimately making the application resourceful, customizable, and user-friendly .

The purpose of creating a base64 output of an Adobe form in the SAP ABAP RAP model is to enable the form's content to be transmitted and utilized across web services where binary data needs to be represented in textual form. This is particularly useful in web-based environments where binary data might be corrupted if not handled correctly. By outputting the form content in base64, it can be easily integrated and consumed by service entities, allowing seamless data exchange within the SAP ecosystem. This integration occurs through the use of a common method, such as a driver program in ABAP, to manage the form's output, which then interacts with RAP application services and OData services to provide necessary transactional and display functionalities .

The '@AccessControl.authorizationCheck:#NOT_REQUIRED' annotation in SAP ABAP RAP signifies that the access control checks are not required for the specified root view entity. This is significant as it implies that the entity can be accessed without performing additional authorization checks, allowing developers to focus on the functional deployment of the service. This is often used in scenarios where the data does not require strict access control or if the service is intended for use in a secure environment where access control is enforced at another level. This type of configuration can speed up the development process by simplifying the governance around the data for certain use cases .

You might also like