How to find out the background database table and table field names of the data returned by the SAP ABAP standard OData service

A friend of the author's knowledge planet asked how to find a SAP ABAP OData service, and which fields the exposed fields came from which database tables in the SAP ABAP background.

To answer this question, we need to comprehensively apply the knowledge we have learned in the past, including single-step debugging of ABAP background programs.

In this article, we still use the previously used SAP CRM standard Fiori application My Accountsas an example to explain.

After clicking the My Accounts tile in Fiori Launchpad, you can see the list of Accounts data returned by the SAP OData service.

Click on one of the line items to enter the details page of Accounts. The fields seen here on the SAP UI5 application interface are retrieved from the SAP background business server by the OData service corresponding to the application.

In actual SAP integration projects, we sometimes need to know which fields in which database tables these OData return field values ​​are stored in. These information serve as the theoretical premise of the secondary development of system integration.

The previous article of this tutorial has introduced how to use the Chrome developer tool to find the name of the OData service used by the SAP UI5 application, and the OData service sent by the SAP UI5 application deployed on the SAP Gateway system at runtime. It is received and processed by which SAP background server.

This article first introduces another way to directly find the OData service name used by the My Accounts application without using the Chrome developer tools.

Following the steps introduced in this tutorial by the author, you can easily find the name of the OData service as CRM_BUPA_ODATA.

And you can quickly get the following list, which is CRM_BUPA_ODATAthe list of SAP database tables that OData accesses at runtime.

From the list, we can easily find out which storage fields in the database table the Account field on the Fiori UI corresponds to.

The Accesses column in the third column in the figure above indicates the number of times the database table represented by this row is accessed during the entire execution process, and the fourth column Netrepresents time spent accessing the database table, in microseconds. Short Description is the description information of the database table, and Package is the name of the ABAP development package.

As can be seen from the description information in the above figure, the BUT000 table stores the header information of the Business Partner data model. The Account model shown in the My Accounts application discussed in this article is a special type of Business Partner.

For example, the values ​​of First Name and Last Name displayed by the My Accounts application:

It is actually stored BUT000in NAME_LASTthe and NAME_FIRSTfields of the database table as shown in the figure below.

Use PERSNUMBERthe field as a foreign key:

It can also be linked to other database tables, such as those that also appear in the SAT transaction code result list ADR12, Account displayed on Fiori UI WebSite, are stored in URI_SRCHthe fields .

Summarize

This article first introduces how to quickly find the OData service name used by a known SAP UI5 application name through SAP official tools. Then it introduces how to record all the details of the ABAP code executed in the debugger through the built-in ABAP Trace in the ABAP debugger, and save it as a Trace file that can be viewed in the transaction code SAT. Finally, through practical examples, it shows how to check which database tables are accessed when the OData service is running in the transaction code SAT, and match the fields on the SAP UI5 interface with the fields of these database tables one by one.

Guess you like

Origin blog.csdn.net/i042416/article/details/130161193