Support read and update operation on CUSTOMER_H extension fields

简介: Created by Jerry Wang, last modified on Dec 24, 2015

import note 2183832, and then:


/IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITY - no change

/IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITY - no change

/IWBEP/IF_MGW_APPL_SRV_RUNTIME~PATCH_ENTITY:

keypoint

a. you have to manually insert entry to cl_crm_opportunity_impl=>gt_customer_h in your own code:

[外链图片转存失败(img-GDVe3wH4-1562295211610)(https://user-images.githubusercontent.com/5669954/27517921-cfa72664-59d4-11e7-96d9-cd61b0455c53.png)]


b. you have to manually insert entry to cl_crm_opportunity_impl=>gt_input_fields in your own code as well:


[外链图片转存失败(img-AyV3voPg-1562295211612)(https://user-images.githubusercontent.com/5669954/27517925-d40e3206-59d4-11e7-8da0-83153b9178e5.png)]


complete source code

 METHOD /iwbep/if_mgw_appl_srv_runtime~patch_entity.

   CALL METHOD super->/iwbep/if_mgw_appl_srv_runtime~patch_entity

     EXPORTING

       iv_entity_name          = iv_entity_name

       iv_entity_set_name      = iv_entity_set_name

       iv_source_name          = iv_source_name

       io_data_provider        = io_data_provider

       it_key_tab              = it_key_tab

       it_navigation_path      = it_navigation_path

       io_tech_request_context = io_tech_request_context

     IMPORTING

       er_entity               = er_entity.

   FIELD-SYMBOLS:  TYPE crmt_odata_oppt_header,

                   TYPE crmt_customer_h_com,

                        TYPE crmt_odata_oppt_header-ext_created_by,

                    LIKE LINE OF cl_crm_opportunity_impl=>gt_input_fields.

* Jerry: in CL_CRM_OPPORTUNITY_impl=>PATCH_OPPT_HEADER_ENTITY only extension field name

* like "fld00008c" is passed in, and it is impossible for us to determine which BO part this

* extension field comes from, eg from OPPORT_H or CUSTOMER_H?

* as a result, it is necessary for extension developer to specify mapping in this method

   DATA: ls_input TYPE crmt_input_field_names.

   CHECK iv_entity_name = 'Opportunity'.

   ASSIGN er_entity->* TO .

   CHECK sy-subrc = 0.

   ASSIGN COMPONENT 'EXT_CREATED_BY' OF STRUCTURE  TO .

   CHECK sy-subrc = 0.

   DATA: ls_customer_h LIKE LINE OF cl_crm_opportunity_impl=>gt_customer_h.

   ls_customer_h-fld00008c = .

   ls_customer_h-ref_guid = -guid.

   APPEND ls_customer_h TO cl_crm_opportunity_impl=>gt_customer_h.

   DATA: ls_customer_h_input LIKE LINE OF cl_crm_opportunity_impl=>gt_input_fields,

         ls_name LIKE LINE OF ls_customer_h_input-field_names.

   ls_customer_h_input-ref_guid = -guid.

   ls_customer_h_input-ref_kind = 'A'.

   ls_customer_h_input-objectname = 'CUSTOMER_H'.

   ls_name-fieldname = 'FLD00008C'.

   APPEND ls_name TO ls_customer_h_input-field_names.

   INSERT ls_customer_h_input INTO TABLE cl_crm_opportunity_impl=>gt_input_fields.

 ENDMETHOD.

相关文章
MGA (Managed Global Area) Reference Note (Doc ID 2638904.1)
MGA (Managed Global Area) Reference Note (Doc ID 2638904.1)
247 0
We cannot activate inspection type for article master in transaction code MM41?
We cannot activate inspection type for article master in transaction code MM41?
We cannot activate inspection type for article master in transaction code MM41?
is transfer = C ( only read dynamically) not supported in one order scenario
is transfer = C ( only read dynamically) not supported in one order scenario
105 0
is transfer = C ( only read dynamically) not supported in one order scenario
2015-03-19 header note update in my Appointment
Created by Wang, Jerry, last modified on Mar 23, 2015
113 0
2015-03-19 header note update in my Appointment
How to find where settype DB table COMM_PRMAT is accessed without debugging
How to find where settype DB table COMM_PRMAT is accessed without debugging
How to find where settype DB table COMM_PRMAT is accessed without debugging
How SAP concrete schema id is got based on transaction type plus catalog type
How SAP concrete schema id is got based on transaction type plus catalog type
106 0
How SAP concrete schema id is got based on transaction type plus catalog type
component set load logic - why coms_pcat_bob is accessed during product search
component set load logic - why coms_pcat_bob is accessed during product search
component set load logic - why coms_pcat_bob is accessed during product search
使用ST05 研究product extension field deletion
使用ST05 研究product extension field deletion
138 0
使用ST05 研究product extension field deletion
|
关系型数据库 MySQL 数据安全/隐私保护
Could not obtain connection to query metadata : Public Key Retrieval is not allowed
Could not obtain connection to query metadata : Public Key Retrieval is not allowed
481 0