cancel
Showing results for 
Search instead for 
Did you mean: 

Replicating Custom Fields for Products in CRM from ECC

karuna_gangireddy
Contributor
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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>

karuna_gangireddy
Contributor
0 Kudos

Hi,

I had a break thru. I am now able to get the data into the custom field in the BDoc PRODUCT_MAT . I followed the code from the attachment mentioned in the note:428989. My issue here is the BDoc is getting the value but the field in the screen is not showing the value. I am able to see my settype in the structure COMT_PROD_MAT_MAINTAIN_API. In my badi i am updating the structure that is the underlined structure of my settype in COMT_PROD_MAT_MAINTAIN_API. But for some reason i am not able to see the entry in my Ztable for this settype and so is on the screen.

Could any one please let me if i am missing anything?

Thanks

Karuna.

karuna_gangireddy
Contributor
0 Kudos

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.

karuna_gangireddy
Contributor
0 Kudos

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.