在ABAP development tools里创建一种新的Resource类型

123 阅读1分钟

Create a new Resouce in AIE

Development Object

  1. report ZTEST_RESOURCE
  2. ZCL_ADT_RES_PRODUCT
  3. ZCL_PRODUCT_ADT_RES_APP
  4. ZCL_ADT_RES_PRO_CONTENT_HANDLE
  5. BAdI implementation: ZCL_PRODUCT_IMPL

Consumer report

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.

Content Handler

Super class: CL_ADT_REST_ST_HANDLER
Just re-implement CONSTRUCTOR:

  • 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

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.

Maintain filter:

要获取更多Jerry的原创文章,请关注公众号"汪子熙":