天天看點

在ABAP development tools裡建立一種新的Resource類型Content Handler

Create a new Resouce in AIE

Development Object

report ZTEST_RESOURCE

ZCL_ADT_RES_PRODUCT

ZCL_PRODUCT_ADT_RES_APP

ZCL_ADT_RES_PRO_CONTENT_HANDLE

BAdI implementation: ZCL_PRODUCT_IMPL

Consumer report

在ABAP development tools裡建立一種新的Resource類型Content Handler

Resource Controller

Super class: CL_ADT_REST_RESOURCE

in our example, we re-implement GET method, which is responsible for assembling corresponding data for requested resouce and delegate the data to response instance.

在ABAP development tools裡建立一種新的Resource類型Content Handler

Content Handler

Super class: CL_ADT_REST_ST_HANDLER

Just re-implement CONSTRUCTOR:

在ABAP development tools裡建立一種新的Resource類型Content Handler

co_st_name: specify simple transformation name, which will be used to transform the assembled ABAP structure by resouce controller into xml data which will be passed to client. co_root_name: * co_content_type: specify what kind of data will be passed to client.

Application Class

Central point to expose the resouce to ADT framework. Super class: CL_ADT_DISC_RES_APP_BASE

在ABAP development tools裡建立一種新的Resource類型Content Handler

Tell framework that all URI having prefix /crm/product will be handled by the resouce controller ZCL_ADT_RES_PRODUCT.

BAdI Implementation

Create a new implementation on enhancement spot SADT_REST_RFC_APPLICATION, specify the application class as BAdI Implementation class.

在ABAP development tools裡建立一種新的Resource類型Content Handler

Maintain filter:

在ABAP development tools裡建立一種新的Resource類型Content Handler