How to enable buffering for the RAP BO of a customizing table

Estimated read time 5 min read

Introduction

For a scalable and high-performance ABAP application, configuration data should always be accessed using the ABAP application server buffer.

In this blog, you will learn how to provide buffered access to your configuration data for your application and other software components if you have created a RAP BO for the customizing table.

This blog is relevant for

SAP S/4HANA Cloud Public EditionSAP S/4HANA Cloud Private Edition  SAP BTP ABAP environment  

Further reading:

Related blog postsLearn how you can use ABAP technology to develop innovative applications and business solutions across SAP’s portfolio on SAP Learning Site.

Direct access to the table

In your application code, you can use ABAP SQL to access the customizing table directly.
This is the leanest way to access the data. A valid pattern is to encapsulate the SQL statements in an API class.

To enable buffering, open the technical settings of the table and select buffering state and buffering type. Activate the table.

Unlike the use of ABAP SQL with CDS view or ABAP EML, no access control is performed by default. See ABAP help documentation when choosing the buffering type.

Other applications should not use ABAP SQL statements on your configuration tables. They can use a (released) version of the aforementioned API class but the standard pattern is to release a CDS view.

CDS View

Other applications should use a (released) version of a CDS view to access the configuration data of your application.

Before releasing the CDS view, you should test an example ABAP SQL statement to ensure that the buffer is used.
Create an executable ABAP class with such a statement. In ADT, right-click and select Profile As -> ABAP Application (Console). Continue with the default settings. Then open the ABAP Traces view and then open the recorded trace.
Navigate to the “Database Accesses” section and make sure that 1 is entered in the “Buffered Accesses” column.

METHOD if_oo_adt_classrun~main.
SELECT SINGLE * FROM zi_pwid WHERE id = ‘TWO’ INTO @DATA(result).
ENDMETHOD.

 Buffer is not used:

Buffer is used:

To enable buffering for the CDS view, you need to create a CDS view entity buffer. For more information, see https://community.sap.com/t5/application-development-and-automation-blog-posts/buffering-cds-view-entities/ba-p/13520422

ABAP EML

It is not recommended to use ABAP EML to read configuration data. If you still want to create a read-only projection RAP BO for your configuration data for other applications, you need to create buffer objects for the CDS view entities for buffered access.

In the SAP BTP ABAP Environment, I could not create a trace where you can see if the buffer is used or not. If you have access to transaction ST05, you can check it.

METHOD if_oo_adt_classrun~main.
READ ENTITY zi_pwid
ALL FIELDS WITH VALUE #( ( id = ‘TWO’ ) )
RESULT DATA(read_result).
ENDMETHOD.

Buffer is not used:
 

 Buffer is used:

 

 

 

 

 

 

​ IntroductionFor a scalable and high-performance ABAP application, configuration data should always be accessed using the ABAP application server buffer.In this blog, you will learn how to provide buffered access to your configuration data for your application and other software components if you have created a RAP BO for the customizing table.This blog is relevant forSAP S/4HANA Cloud Public EditionSAP S/4HANA Cloud Private Edition  SAP BTP ABAP environment  Further reading:Related blog postsLearn how you can use ABAP technology to develop innovative applications and business solutions across SAP’s portfolio on SAP Learning Site.Direct access to the tableIn your application code, you can use ABAP SQL to access the customizing table directly.This is the leanest way to access the data. A valid pattern is to encapsulate the SQL statements in an API class.To enable buffering, open the technical settings of the table and select buffering state and buffering type. Activate the table.Unlike the use of ABAP SQL with CDS view or ABAP EML, no access control is performed by default. See ABAP help documentation when choosing the buffering type.Other applications should not use ABAP SQL statements on your configuration tables. They can use a (released) version of the aforementioned API class but the standard pattern is to release a CDS view.CDS ViewOther applications should use a (released) version of a CDS view to access the configuration data of your application.Before releasing the CDS view, you should test an example ABAP SQL statement to ensure that the buffer is used.Create an executable ABAP class with such a statement. In ADT, right-click and select Profile As -> ABAP Application (Console). Continue with the default settings. Then open the ABAP Traces view and then open the recorded trace.Navigate to the “Database Accesses” section and make sure that 1 is entered in the “Buffered Accesses” column. METHOD if_oo_adt_classrun~main.
SELECT SINGLE * FROM zi_pwid WHERE id = ‘TWO’ INTO @DATA(result).
ENDMETHOD. Buffer is not used:Buffer is used:To enable buffering for the CDS view, you need to create a CDS view entity buffer. For more information, see https://community.sap.com/t5/application-development-and-automation-blog-posts/buffering-cds-view-entities/ba-p/13520422ABAP EMLIt is not recommended to use ABAP EML to read configuration data. If you still want to create a read-only projection RAP BO for your configuration data for other applications, you need to create buffer objects for the CDS view entities for buffered access.In the SAP BTP ABAP Environment, I could not create a trace where you can see if the buffer is used or not. If you have access to transaction ST05, you can check it. METHOD if_oo_adt_classrun~main.
READ ENTITY zi_pwid
ALL FIELDS WITH VALUE #( ( id = ‘TWO’ ) )
RESULT DATA(read_result).
ENDMETHOD.Buffer is not used:   Buffer is used:        Read More Technology Blog Posts by SAP articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author