ABAP Development Tool前後臺互動的原理
在S/4HANA系統裡,SE16,檢視錶PRGN_CORR2的內容:
REL_NAME(release name)指定成751:
S_TCODE是ECC裡的事務碼,而T_TCODE是對應的S/4HANA的新事務碼。
Have you even thought about why you could operate on ABAP backend system using ADT?
This document just gives a brief introduction about how does the ADT backend infrastructure respond your operation done in Eclipse. It contains a hands-on exercise which you could finish in your own ABAP system.
Explore ADT by switching on ABAP
communication log
In order to explore what has happened when we do operations in Eclipse, we need to switch on ABAP communication log.
Click Windows->show view. Make view “ABAP Communication Log” is displayed.
Then click button “Start Logging”:
Try to create one report:
And then you could observe several logs for this report creation. The latest log appears in the topmost of the table.
Now you could know that your operation in Eclipse is sent to ABAP backend system via HTTP Get and HTTP Post with dedicated url and gets processed in ABAP backend. Double click on each line to get the detail view.
In the report creation scenario, the request sent to ABAP backend are just the same as normal what you have done in SAP GUI to create one report:
(1) a query is sent via to check whether the report ZTEST_REPORT_JERRY already exists or not.
(2) Do transport checks based on the package name we have specified.
(3) once all checks pass, send the report creation request via HTTP post.
An example to understand how does ADT infrastructure responds
And how these HTTP request are handled in ABAP backend? Just set breakpoint on the function module SADT_REST_RFC_ENDPOINT, which acts as the central dispatcher and the entry point for all request sent from Eclipse. You should observe that this FM will be called again and again, once you have done something in Eclipse.
If you are patient enough, you could start debugging from this FM to learn how different handlers within the ADT backend infrastructure orchestrate to respond Eclipse front-end.
I write a simple report to simulate the HTTP request sent from Eclipse:
The url ‘/sap/bc/adt/crm/product/STAB_PROD_01’ has prefix /sap/bc/adt/ and is passed into the central dispatcher FM, so it could be processed by the ADT infrastructure. After we have studied how this simple program does work, we have already know the magic of the ADT processing logic.
After report execution, we could get the description of the product specified in url, ‘STAB_PROD_01’, from the variable lv_response.
And below are steps how to build this sample in your system.
(1) Create a BAdI implementation on BAdI definition BADI_ADT_REST_RFC_APPLICATION
You could find lots of standard implementation already created on this BAdI definition, each for their specific use case.
maintain the filter value as below, so that the very url containing the filter value will be handled by this BAdI implementation.
Implement method register_workspaces by just copying below code:
For method get_application_title, you can just hard code something.
Implement method register_resources:
We will create and implement handler class ZCL_ADT_RES_PRODUCT in next step.
(2) Create resource class ZCL_ADT_RES_PRODUCT
In this example, resource class is responsible for retrieve the product description for the product whose id is passed in via url and serialize the description via content handler class ( which will be created in step3 ) and set response accordingly.
Set CL_ADT_REST_RESOURCE as super class and only redefine method GET:
(3) create content handler class ZCL_ADT_RES_PRO_CONTENT_HANDLE
Set CL_ADT_REST_ST_HANDLER as super class, implement CONSTRUCTOR as below:
Define three attributes as below. CO_ST_NAME just contains the technical name of transformation ID which you could find in transaction STRANS, and co_root_name contains the name of root node in XML response.
Create two public types:
Test the sample
(1) our BAdI implementation is returned by GET BADI according to the correct filter value:
(2) Our resource class get called. And the redefined method GET will be executed:
(3) our content handler class is called to transforma the ABAP data into XML using the standard transformation “ID”:
Hope this sample gives you a better understanding on how does ADT work.
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2707055/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ABAP Development Tool如何配置程式碼自動完成的快捷鍵dev
- SAP ABAP Development Tool 提高開發效率的十個小技巧dev
- ABAP Development Tools的語法高亮實現原理dev
- ABAP Development Tool 程式碼模板和其他一些實用技巧彙總dev
- 如何在Chrome development tool裡檢視C4C前臺傳送的請求細節Chromedev
- PHP前後端互動PHP後端
- 如何安裝最新版本的 SAP ABAP Development Tool ( ADT ) 2021年度更新dev
- API前後端互動模式API後端模式
- AJAX-前後端互動的藝術後端
- 前後端資料互動利器--Protobuf後端
- 前後端資料交換互動後端
- 前後端資料的互動--如何確保前後端資料的安全性?後端
- 雲物件 - 重新定義前後端互動物件後端
- 騰訊天氣前後端互動案例後端
- 12.2 Vue前後端互動 P75-Vue後端
- 筆記:前端與後臺互動筆記前端
- Http(s)與後臺互動方式HTTP
- SpringBoot+Vue前後端分離及互動Spring BootVue後端
- 軟體測試--前後端資料互動後端
- 一步步用ABAP Development Tools連線SAP雲平臺上的ABAP程式設計環境dev程式設計
- 前後端資料互動形式隨手筆記後端筆記
- 前後端資料的互動--如何實現資料加密?--02後端加密
- Vue前後端互動、生命週期、元件化開發Vue後端元件化
- SpringMVC前後端分離互動傳參詳細教程SpringMVC後端
- 前後端資料互動(四)——fetch 請求詳解後端
- 前後端資料互動(三)——ajax 封裝及呼叫後端封裝
- SAP ABAP CDS view裡的註解在ABAP後臺是如何被解析的?View
- 前後端資料互動(一)——網路請求詳解後端
- 使用Node.js和Koa框架實現前後端互動Node.js框架後端
- 前後端資料互動(二)——原生 ajax 請求詳解後端
- 前後端API互動如何保證資料安全性?後端API
- 利用Vue3的axios+Python的flask實現前後端互動功能VueiOSPythonFlask後端
- 《秦殤》的臺前與幕後
- Linux任務的前後臺管理Linux
- Node.js實現前後端互動——使用者登陸Node.js後端
- Python 利用三個簡易模組熟悉前後端互動流程Python後端
- 網站後臺模板前臺修改?網站後臺的介面如何修改?網站
- SAP Emarsys 的前後臺技術棧