Skip to Content
author's profile photo
Former Member

Replicating Custom Fields for Products in CRM from ECC

Hi All,

I am having difficulty in replicating SAP standard field values from ECC to custom fields for products in CRM. This is what i did:

1. I created a new settype(ZMASTER_INFO) with a single attribute(ZIND_STD) and added

this new settype to MAT_HAWA. (As all our materials fall under this material type).

2. I am looking to map SAP standard field from ECC to this custom field of mine.

I wrote the code in CRM BADI

'ZPRODUCT_CUSTOMER2->MAP_R3_TO_CRM_MATERIAL' with the following code:

****************************************************************************************************

DATA: ls_ZMASTER_INFO TYPE ZMASTER_INFO_maintain.

DATA: ls_category_bdoc TYPE COMT_PROD_CAT_REL_MAINTAIN,

ls_category TYPE COMT_PROD_CAT_REL,

lt_categories TYPE COMT_PROD_CAT_REL_TAB,

ls_settype TYPE COMT_settype_ext,

ls_cat_settype_rel TYPE COMT_CAT_FRAG_REL,

lt_cat_settype_rel TYPE COMT_CAT_FRAG_REL_TAB,

lt_cat_settype_rel_all TYPE COMT_CAT_FRAG_REL_TAB.

LOOP AT lt_cat_settype_rel_all INTO ls_cat_settype_rel.

CALL FUNCTION 'COM_SETTYPE_READ_SINGLE'

EXPORTING

IV_SETTYPE_GUID = ls_cat_settype_rel-frgtype_guid

IMPORTING

ES_SETTYPE = ls_settype

EXCEPTIONS

NOT_FOUND = 1

NO_IMPORT_VALUES = 2

NO_TEXT_FOUND = 3 .

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CASE ls_settype-frgtype_id.

WHEN 'ZMASTER_INFO'.

ls_ZMASTER_INFO-relation-owner = 'X'.

ls_ZMASTER_INFO-relation-logsys = cs_product_bdoc-header-com_product-logsys.

ls_ZMASTER_INFO-data-ZZ0010 = is_mara-STD_DESCR.

ls_ZMASTER_INFO-DATA_X-ZZ0010 = 'X'.

APPEND ls_ZMASTER_INFO TO cs_product_bdoc-data-ZMASTER_INFO.

APPEND ls_settype-FRGTYPE_GUID TO cs_product_bdoc-data-MNT_SETTYPE.

ENDCASE.

ENDLOOP.

*****************************************************************************************************

Since in ECC i am not having any custom fields i did not write any code in ECC for TPS34 and TBE24. I just wrote this BADI in CRM and using the field S_MARA-STD_DESCR.

I am not sure if i need to write the code in ECC. COUld anyone please confirm if i need the code in ECC?

Also in the CRM BADI, lt_cat_settype_rel_all is EMPTY. Not sure how this gets its value.

Could anyone please suggest if i am missing anything here? Any help is appreciated.

Thanks,

Karuna.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Posted on Sep 21, 2007 at 03:46 PM

    Hi All,

    Its me again. I see the BDOC coming but my settype does not have any value. I also updated DATA_X with 'X' but still the value did not replicate.

    Thanks in advance,

    Karuna.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 22, 2007 at 06:30 AM

    Hi Karuna,

    One more solution is to change the BDoc data content before it hit the Database.

    this can be done in badi: Data_Exchange_badi (if u dont find this try with following search string: xchange)

    In the above mention badi you will find a method which is used to populated the contend jst after bdoc in CRM is being populated by R/3 data.

    Best Regards,

    Pratik Patel

    <b>Reward with Points!</b>

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi All,

      I am able to see the my custom settype name ZMASTER_INFO in the structure

      COMT_PROD_MAT_MAINTAIN_API. In my BADI ZPRODUCT_CUSTOMER2 i am updating

      the structure which is the underlined structure of my settype in

      COMT_PROD_MAT_MAINTAIN_API. I found that my table ZMASTER_INFO is not

      getting updated. Does anyone have any suggestions if i am missing any config setting?

      Thanks,

      Karuna.