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
- 長連線在後臺和前臺之間的互動
- 前後臺互動常用到的json格式模板JSON
- jQuery|前後臺xml互動就靠它了jQueryXML
- PHP前後端互動PHP後端
- ABAP Development Tool 程式碼模板和其他一些實用技巧彙總dev
- 如何在Chrome development tool裡檢視C4C前臺傳送的請求細節Chromedev
- API前後端互動模式API後端模式
- 前後端資料交換互動後端
- SSH前後端資料互動後端
- AJAX-前後端互動的藝術後端
- Node之簡單的前後端互動後端
- 如何安裝最新版本的 SAP ABAP Development Tool ( ADT ) 2021年度更新dev
- 前後端資料互動利器--Protobuf後端
- 騰訊天氣前後端互動案例後端
- WEB程式的前後端資料互動流程Web後端
- 雲物件 - 重新定義前後端互動物件後端
- 一種安全的前後端資料互動方案後端
- 前後端資料的互動--如何確保前後端資料的安全性?後端
- Http(s)與後臺互動方式HTTP
- 筆記:前端與後臺互動筆記前端
- Ajax使用jQuery與後臺互動jQuery
- 12.2 Vue前後端互動 P75-Vue後端
- 軟體測試--前後端資料互動後端
- 前後端資料互動形式隨手筆記後端筆記
- Flex與後臺互動的幾種方法詳解Flex
- 一步步用ABAP Development Tools連線SAP雲平臺上的ABAP程式設計環境dev程式設計
- 前後端資料的互動--如何實現資料加密?--02後端加密
- 前後端資料互動(三)——ajax 封裝及呼叫後端封裝
- SpringBoot+Vue前後端分離及互動Spring BootVue後端
- Vue前後端互動、生命週期、元件化開發Vue後端元件化
- SAP Certified Development Consultant SAP NetWeaver 2004 - Application Development Focus ABAPdevAPP
- 一個簡單的vue + koa2前後端互動例項Vue後端
- .NET後臺呼叫JS前臺JS
- SAP ABAP CDS view裡的註解在ABAP後臺是如何被解析的?View
- 使用Node.js和Koa框架實現前後端互動Node.js框架後端