cancel
Showing results for 
Search instead for 
Did you mean: 

CVI between BP and Customer.

lukasz_dippel
Participant
0 Kudos
3,216

Hi.

I'm still not sure about CVI.
We have a requirement to integrate custom ZZ-fields between Customer and BP.
I Added those fields in BUT00 (and BP screens) as well as KNA1 (XD.. and customer screen). And as stated here: (SAP How-To Guide: Extend MDG-S / MDG-C Data Model by a New Field (Reuse Option)) I also Implemented the Enhancement Spot CVI_CUSTOM_MAPPER but it does not move the data change I do from BP to XD.. and vice versa . In another blog: https://blogs.sap.com/2019/11/07/sap-s-4hana-business-partner-field-enhancement/ I see there is no need to add ZZ fields to BUT000. Just to show KNA1-ZZ... in BP tcode. I was also trying to contact Alain Bachi but with no effect so far. Any suggestion would be appreciated. Thank You.

Accepted Solutions (1)

Accepted Solutions (1)

former_member189962
Active Participant
0 Kudos

Hi,

If your requirement is to add the custom field only in the Customer data model (KNA1), then it is not mandatory to add the custom field in the BUT000 table. You can just follow the blog post that you mentioned - https://blogs.sap.com/2019/11/07/sap-s-4hana-business-partner-field-enhancement/

But if your requirement is to enhance the BP data model, then you can add the custom field in table BUT000 and in the KNA1. You can add the logic to synchronize the data between BP and Customer in CVI_CUSTOM_MAPPER BAdI. This way, the data would always be synchronized from BP to Customer or Customer to BP (depending upon the implementation in the BAdI)

Best Regards,

Ankush

lukasz_dippel
Participant
0 Kudos

Thank You, Ankush.

The requirement is to keep Custom fields on both sides (KNA1 and BUT000).

I've already managed to synchronize Customer -> BP.
The problem was with DATAX (update) field. I've changed it as follows

METHOD IF_EX_CVI_CUSTOM_MAPPER~MAP_CUSTOMER_TO_BP.

c_partner-central_data-common-data-ZZ_FIELD = i_customer-central_data-central-data-FIELD.

*c_partner-central_data-common-datax-ZZ_FIELD = i_customer-central_data-central-datax-ZZ_FIELD.

c_partner-central_data-common-datax-ZZ_FIELD = 'X'.

ENDMETHOD.

However BP->Customer synchronization still works unproperly. When I change the value of the ZZ_FIELD on BP screen (A -> B) the customer is updated with A (not with B as I would expect). I think there must be something wrong with PAI , or maybe with screen layout settings like field groups, views, sections and especially with application. I see ( in the link mentioned) the CVIC application is used while I created my own.

Łukasz.

Answers (2)

Answers (2)

Andi_M
Product and Topic Expert
Product and Topic Expert

Hi Lukasz,

please pay attention to your Z-Function Modules at PAI. To me it looks like a data transfer issue from screen filed into data structure. If you manage data transfer in PAI no BAdI-Implementation of CVI_CUSTOM_MAPPER is needed and you don't need to care about DATAX structure.

Andi

lukasz_dippel
Participant
0 Kudos

Andi,

at the end of PAI I used :

cvi_bdt_adapter=>data_pai(
i_table_name = table_name_kna1
i_data_new = lt_kna1[]
i_validate = false).

with lt_kna1[] Z_field modified and the customer was updated. Thank You.

I had to turn of the IF_EX_CVI_CUSTOM_MAPPER~MAP_BP_TO_CUSTOMER (only) not to overwrite the data as I still need the IF_EX_CVI_CUSTOM_MAPPER~MAP_CUSTOMER_TO_BP to update BP while the customer is changed. So BAdI-Implementation of CVI_CUSTOM_MAPPER is needed in my case.

Łukasz.