cancel
Showing results for 
Search instead for 
Did you mean: 

Custom fields replication in Equipment BDOC

Former Member
0 Kudos

Hi,

We have used AET to extend the IBase stucture in CRM with a custom field.

We want to replicate Equipment to IBase from ECC to CRM.

This custom field was added by AET to the append structure CI_EEW_IBIB,

but it is not in the BDoc structure for CRM_EQ_DMBDOC.

How do I get the custom field to show up in the BDOC?

How/where do I map the Z Equipment fields to the IBase Z fields?

I suspect I can do it with set types and attributes, but I canu2019t find any information on what is the right way to do it.

In CRM in the BAdI method IF_EX_CRM_EQUI_LOAD~PERFORM_LOAD, I think some manipulation can be done.

But if I add my fields using AET, they are not added to CRMT_EQUI_DMBDOC, which is accessible in the BAdI.

Thanks in advance.

Hanlie

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I have a similar requirement. We have custom set types for IBase and that should be updated from some characteristics of Equipment Class of equipments in ECC. Please provide some approach on how to do that.

Regards,

Radhika

Former Member
0 Kudos

Hi Radhika,

Here are the steps:

1. COMM_ATTRSET in CRM.
   Create custom attributes
   create custom set type and add the attributes
   Generate the set type in CRM.  

2. Assign this set type to your Equi 0401 Category in COMM_HIERARCHY

3. Populate the fields in ECC using a BTE and add to TPS34.

   Make sure the BTE is working fine from ECC, and that the fields are populated.

   TPS34:
Process        FM                                      Product
CRM0_200   ZCRM_MAP_EQUI_TO_MW  ZCRMEQUI

   Create ZCRM_MAP_EQUI_TO_MW by copying SAMPLE_PROCESS_CRM0_200

4. Then you need to enhance the BDOC 'CRM_EQ_DMBDOC' to accommodate fields in CRM.
   I created an append structure in CRMT_EQUI_MESS structure.
   Use BADI CRM_EQUI_LOAD method ENLARGE_MAPPED_INBOUND to map fields to
   to BDOC. Documentation for 'Product' BDoc said that creating a transport of the Set Type
   will enhance the BDoc. This works for 'Product' but not for Equipment.

5. Make sure that the fields are populated in the BDoc in CRM

6. Once the data is available in BDOC, you can use ENLARGE_SET_TYPES of
   CRM_EQUI_LOAD Badi to map fields data to new settype.
   Just fill the values from the BDoc and append the attributes and append the Set type.

7. Just a note: Custom Set types can have only maximum 20 attributes.
   So you need to group the attributes in a sensible way in multiple set types, if you have >20 custom fields.

Hope this helps!.

Kind regards

Hanlie

Former Member
0 Kudos

Dear Hanlie,

we have developed the FM at ECC side and maintined in TPS34. so the fields created at ECC is appending to structure.

here i would like to know why we need to do map fields to BDOC(BADI CRM_EQUI_LOAD method ENLARGE_MAPPED_INBOUND to map fields to BDOC.) the fields already appended to structure we just need to take tha values and assign to set types.

could you please guid me on this and if possible share the code for mapping to set types.

Thanks in Advance!

Kind Regards,

Venkat.

Former Member
0 Kudos

Hi Hanlie,

I have done the FM to append the additional field to Bdoc structue at R/3, but somehow it didn't append to the Structure. below is the code used for appending to the structure.

   FUNCTION Z_EQUIP_MAP_MW .
"----------------------------------------------------------------------
"*"Local Interface:
"  IMPORTING
"     REFERENCE(I_OBJ_CLASS) LIKE  BAPICRMOBJ-OBJCLASS
"     REFERENCE(I_OBJ_NAME) LIKE  BAPICRMOBJ-OBJ_NAME
"     REFERENCE(I_BAPICRMDH2) LIKE  BAPICRMDH2 STRUCTURE  BAPICRMDH2
"     REFERENCE(I_KEYWORD_IN) LIKE  CRM_PARA-KEYWORD_IN
"     REFERENCE(I_CRMRFCPAR) LIKE  CRMRFCPAR STRUCTURE  CRMRFCPAR
"  EXPORTING
"     REFERENCE(E_DO_NOT_SEND) LIKE  CRM_PARA-XFELD
"  TABLES
"      T_INT_TABLES STRUCTURE  BAPIMTCS
"      T_BAPISTRUCT STRUCTURE  BAPIMTCS
"      T_MESSAGES STRUCTURE  BAPICRMMSG
"      T_OTHER_INFO STRUCTURE  BAPIEXTC
"  CHANGING
"     REFERENCE(C_BAPICRMDH2) LIKE  BAPICRMDH2 STRUCTURE  BAPICRMDH2
"     REFERENCE(C_RFCDEST) LIKE  CRMRFCPAR STRUCTURE  CRMRFCPAR
"     REFERENCE(C_OBJNAME) LIKE  BAPICRMOBJ-OBJ_NAME
"----------------------------------------------------------------------
DATA: ls_equi TYPE equi,
        l_lenght_equnr TYPE i,
        lv_equnr TYPE equnr.

* Communication Structure
  DATA: BEGIN OF ls_com_key,
           struct(20),
           equnr(18),
        END OF ls_com_key.

* Communication structure (additional EQUI data)
  DATA: BEGIN OF ls_com_data,
           field_name TYPE field_name,
        END OF ls_com_data.


* Field Symbol for Casting BAPIMTCS
  FIELD-SYMBOLS:
      <source_x> TYPE x,
      <target_x> TYPE x.

  CASE i_obj_name.

    WHEN 'EQUIPMENT'.
      break actextmt.
      LOOP AT t_int_tables WHERE tabname = 'EQUI'.

        ASSIGN ls_equi TO <target_x> CASTING.
        ASSIGN t_int_tables-data TO <source_x> CASTING.


        IF <source_x> IS ASSIGNED AND
           <target_x> IS ASSIGNED.
          <target_x> = <source_x>.
        ELSE.
          CONTINUE.
        ENDIF.

        ls_com_key-struct  = 'Custom field'.
        ls_com_key-equnr   = ls_equi-equnr.

*        MOVE-CORRESPONDING ls_Equi TO ls_com_data.
        ls_com_data-Field_name
= ls_equi-field_name.

        t_other_info-field1  = ls_com_key.
        t_other_info-field2  = ls_com_data.

        APPEND t_other_info.
      ENDLOOP.
  ENDCASE.

when we check the bdoc structure in crm we have not found the custom field from ECC .

Kindly advice me on this if any changes needs to be done at both sides R/3 as well as CRM or is this is the way to do the same.

Please do help.

Thanks in Advance!

Best Regards,

Venkat

Former Member
0 Kudos

Hi Hanlie,

Can you please provide me the solution for this.

Kind Regards,

Venkat

Former Member
0 Kudos

Hi Hanlie,

What you said is correct (

Apr 24, 2012 7:58 PM (in response to Radhika Chuttani) ).

That is the BDOC is not extending automatically when I extend Ibase by creating set types and assigning attribues to it.

Could you please let me know how to extend BDOC 'CRM_EQ_DMBDOC' to accommidate new custom fields..?
Please provide me sample code in the BADi if it is required.

Thank you very much,

Best Regards,

Nagarjuna

Former Member
0 Kudos

Hi again all,

A related question is about the replication of standard Equipment from ECC to CRM:

I have done the settings according to the documentation:

for R3PRODSTYP hierarchy.

I get the following errors:

Data cannot be maintained for set type COM_TA_R3_ID

Assign a base category to the product

Error when creating objects

Error when creating products from equipment BDoc

Error when creating objects

Error calling the upload BAdI; method: perform_load

Error when creating products from equipment BDoc

Validation error occurred: Module CRM_DEQUI_VAL, BDoc type CRM_EQ_DMBDOC.

Where did I go wrong or what am I missing?

Thanks!

Hanlie

former_member189549
Active Contributor
0 Kudos

Hello Hanlie,

I believe that you are getting the following errors messages in your system;

Message no. COM_PRODUCT503

Message no. COM_PRODUCT554

Message no. IB_CRM_UPLOAD_MSG019

Message no. IB_CRM_UPLOAD_MSG012

Message no. IB_CRM_UPLOAD_MSG039

This error is due to incorrect customizing in CRD system causes BDOC errors. Please correct following customizing settings:

1. Please check if there duplicate categories with name '0401'. Duplicate category IDs are

not allowed. Please create a category with with different ID. Make sure that the new category has object family '0401' (Equipment) selected and all settypes are maintained. (You can copy these details from category

'0401' - Description 'eQUIPMENT'). Use transaction 'COMM_HIERARCHY' to create new category.

2. IMG => Customer Relationship Management => Master Data => Installed

Base => Replication of Technical Objects from SAP ERP => Define Default

Settings for Replication of Equipment.

Check if the category ID maintained at path for the site 'OLTP' exist in CRM system. Please use the category ID created in step 1 here.

Equipment download should work fine after above customizing changes. The point is the set type cannot be reused if the categories point to the same product type - in your case material. So you need to decide in your customizing about using the right set type and the right category for equipment download.

thanks a lot

Willie