Enterprise Resource Planning Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
badrinathravi
Product and Topic Expert
Product and Topic Expert
65,639
Introduction -

This requirement came up as a part of customer migration from SAP ECC system to SAP S/4HANA system. They had a few custom fields on Customer master data which had to be preserved post conversion. These fields had to be placed in a custom tab on Business Partner transaction.

Links / References -

You would find detailed explanation in SAP cookbook.

SAP note 2309153 – Cookbook for enhancing the SAP Business Partner with additional customer/vendor fields

Additionally,

There is blog post written by andi.mauersberger on this topic - https://blogs.sap.com/2019/11/07/sap-s-4hana-business-partner-field-enhancement/

 

Current example would add custom fields to an additional tab instead of an existing one.

[Custom fields attached on KNVV table needs to placed on Business Partner custom tab for updates]

We would follow steps under scenario B of cookbook.

Steps -

BUS1


BUS23


BUS4


BUS5



BUS6





Screen is attached to Sales Area section of Customer Screen


BUS3




BUS2


 


BUSD – Data Set attached to standard Business Role



 

BP Screen Customer role –

 


Extend structure CVIS_EI_EXTERN by appending custom fields to respective DATA / DATAX sub structures identified

 

Function group –

FUNCTION-POOL ZZ_CVI.
data:  gs_knvv               type knvv,

Screen 9001 – Create sub-screen and add custom fields to screen

MODULE USER_COMMAND_9001 INPUT.
CALL FUNCTION 'ZCVI_CUST_PAI'.
ENDMODULE.

MODULE STATUS_9001 OUTPUT.
CALL FUNCTION 'ZCVI_CUST_PBO'.
if cvi_bdt_adapter=>get_activity( ) = '03'.
“disable screen field for editing
endif.
ENDMODULE.

Code –

function ZCVI_CUST_PAI.
data:
lt_knvv         type table of knvv,
ls_sales_area   type cvis_sales_area.
field-symbols:
<knvv>          like line of lt_knvv.
constants:
lc_dynp_struc   type fsbp_table_name value 'GS_KNVV',
lc_bdt_view     type bu_sicht        value 'ZCUS01'.

check cvi_bdt_adapter=>is_direct_input_active( ) = abap_false.
check cvi_bdt_adapter=>get_current_sales_area( ) is not initial.
* step 1: update xo memory from dypro structure
cvi_bdt_adapter=>get_current_bp_sales_data(
exporting
i_table_name = 'KNVV'
importing
e_data_table = lt_knvv[]
).

if gs_knvv is not initial.
if lt_knvv[] is not initial.
read table lt_knvv assigning <knvv> index 1.
if sy-subrc = 0.
<knvv>-ZZDIVISION = gs_knvv-ZZDIVISION.
<knvv>-ZZDEPARTMENT = gs_knvv-ZZDEPARTMENT.
<knvv>-ZZSECTION = gs_knvv-ZZSECTION.
<knvv>-ZZTEAM = gs_knvv-ZZTEAM.
<knvv>-ZZRESPOSIBLE = gs_knvv-ZZRESPOSIBLE.
endif.
endif.
endif.

cvi_bdt_adapter=>data_pai_with_sales_area(
i_table_name = 'KNVV'
i_data_new   = lt_knvv[]
i_validate   = ' '
).

** step 2: check fields
*  check cvi_bdt_adapter=>get_activity( ) <> cvi_bdt_adapter=>activity_display.

endfunction.

FUNCTION ZCVI_CUST_PBO.

data: lt_knvv type table of knvv.
* step 1: receive data from xo
if cvi_bdt_adapter=>get_current_sales_area( ) is initial.
clear gs_knvv.
else.
cvi_bdt_adapter=>data_pbo_with_sales_area(
exporting
i_table_name = 'KNVV'
importing
e_data_table = lt_knvv[]
).
if lt_knvv[] is initial.
clear gs_knvv.
else.
read table lt_knvv into gs_knvv index 1.
endif.
endif.

** step 2: update text fields for dynpro
**Required only if screen field names are different

ENDFUNCTION.

 

Conclusion - We can extend customer / vendor master data table append structures on Business Partner transaction code for maintenance.

 
24 Comments
former_member606190
Discoverer
0 Kudos
Thanks for this amazing tutorial!

 

I have a question. My Zfields in KNVV are not getting updated. Do I need to use DSAVE and DCHCK events? Any insight?

 

I used your code, and included my KNVV-ZCustomFields in an existing Tab like the blog by andi.mauersberger on this topic – https://blogs.sap.com/2019/11/07/sap-s-4hana-business-partner-field-enhancement/

 

Thank you!
badrinathravi
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Marielys,

Check if custom fields appended on CVIS_EI_EXTERN sub structure are populated properly. (DATA / DATAX)

No additional coding is required.

 

 
0 Kudos
Hi Badrianth,

Thanks for your amazing work.

I did all the steps completely. but my KNVV-ZFIELD field is not updated in the table. I have made the necessary additions for CVIS_EI_EXTERN. For DATA and DATAX structures.

The field comes to the screen. But when you press the SAVE button, this data is clear.
former_member757771
Discoverer
0 Kudos
Hi Badrinath,

Thanks for explaining in detail.

I have made the necessary additions for CVIS_EI_EXTERN for DATA and DATAX structures at vendor and customer level(S/4 HANA version 2020 FP01). The fields are appearing on screen. But when I press the SAVE button, the existing data is clear and newly entered data is getting cleared. Could you please suggest?

Thanks,

Deepashree S
former_member757771
Discoverer
0 Kudos
Hi Omer,

Is the issue resolved ? Even i am facing the same issue.

I have made the necessary additions for CVIS_EI_EXTERN for DATA and DATAX structures at vendor and customer level(S/4 HANA version 2020 FP01). The fields are appearing on screen. But when I press the SAVE button, the existing data is clear and newly entered data is getting cleared. Could you please suggest?

Thanks,

Deepashree S
Yogesh_bagul
Explorer
0 Kudos
badrinathravi Thank you for details step. I would like to update the custom field in table UKMBP_CMS (SAP Credit Management: Credit Master Data for Partner) in BP transaction. I have added field on screen and tried but no luck to get it update.

Do you have any input on this how to update the credit profile tab custom fields.

Your response will be highly appreciated.

Thanks in Advanced,

 

Thanks & Regards,

Yogesh Bagul
former_member788068
Discoverer
0 Kudos
Hi Yogesh,

 

I do have similar requirement to add custom fields in External credit information table control in credit profile, If your issue is solved can you please let us know the approach.

 

Regards

Raghavendra
marcela_martinez
Participant
0 Kudos
Hi yogesh_bagul and badrinathravi

Thanks Badrinath for the tutorial.

I have the same requirement as Yogesh has but in Payment Transactions table control (Bank Details). I need to add a custom display field from LFBK table. Could you please guide me with the steps for changing a table control in BP t-code? I am a bit confuse with Badrinath and Yogesh saying that he can solve it with the tutorial.

Thanks in advance and kind regards.

Marcela.
maddhpa
Explorer
0 Kudos
Nice Explanation
hutner
Explorer
0 Kudos
Hello I have the same issue. Did you solve this problem?
former_member658126
Participant
0 Kudos
Hi Badrinath,

 

I followed your blog, i am able to see the fields added to SCreen but data is not getting updated in table. Please suggest any badi used for saving data
former_member658126
Participant
0 Kudos
Even i am facing same issue, Please reply if it worked for you with any changes
anete
Participant
0 Kudos

To get screen fields updated make sure fields on the new custom screen are named with GS_KNVV-zfield

venkatasunil16
Explorer
0 Kudos

Hi badrinath Ravi & All ,

I followed all the steps mentioned in this blog and cross verified multiple times . Custom fields are appearing in desired position but  data is not flowing from Customer master (XD03) to bp screen . Data is flowing to CVIS_EI_EXTREN structure and PBO  module , but not displaying on screen . Could you let us know what could have gone wrong ?  

Regards ,

Sunil V

Lourdes_br
Participant
0 Kudos

Hello badrinath Ravi & All,
My requirement is create new field on BUT050 table, field is created and correctly displayed on screen - But not saved on table.  CVIS_EI_EXTERN-PARTNER_RELATION-CENTRAL_DATA-MAIN-DATA cannot be enhanced. How to proceed on this case ? 

Thanks in advance.
Maria

Andi_M
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Maria,

unfortunately I don't know the possibility to extend BUT050.
From my experience this is the first time I hear a customer wants to extend Relationship. I think this is the reason why standard development does not support such extension.

Thinking a bit further in SAP S/4HANA extensibility with clean core approach. If you find a workaround for your requirement, this will not supported by Clean Core approach.

Sorry for the bad news.
Best Regards
Andi

Lourdes_br
Participant
0 Kudos

Hello @Andi_M ,
I just wanted to hear a second opinion. 
Thank you for answering. 

Best Regards
Lourdes

cosmin_90
Discoverer
0 Kudos

Hi Andi,

Is it possible to delete the '3050099' entry from BUS6?

cosmin_90_0-1748293086436.png

If I try to delete it, it gives the following message:

Nr. mesaj SV117

Diagnosis

You have changed an entry which, according to the name space definition is managed by SAP.

System Response

Your changes may be overwritten at each subsequent upgrade or release change.

Procedure

Avoid changing this data. If the change is inavoidable, document it carefully, so that it can be repeated, if necessary, after an upgrade or release change. The best way to do this is to put the data in a change request, which you can export before an upgrade or release change, and import again afterwards.

 

 

Andi_M
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Cosmin,

item 3050099 can be deleted because this is your own added new screen in screen sequence. The message you see is just a warning to tell you that you are doing a big change by removing a whole screen tab. At this point you should know what you are doing. Confirm message with <ENTER> and proceed.

Best Regards
Andi

Arun221990
Newcomer
0 Kudos

Hi Andi,

I have a requirement to add a custom tab in BP for vendor role with custom table fields and upon save the data should be saved in the custom table. I have followed the SAP cookbook and did the development but the Badi implementation of enhancement spot vendor_extension is not getting called and data is not saving in custom table. I could able to fetch data from stable and show it in the new tab but saving back is not working. Can you please share your thoughts on this?

cosmin_90
Discoverer
0 Kudos

Hi Andi, badrinathravi

Thank you for the response.

You were right. I was able to delete it.

After completing the above steps, I was able to implement the custom tab.

However, when I try to create a customer from XD01, I receive the following error

Business partner with GUID XYZ does not exist

Message no. R11124.

Do you have any idea what I might have missed?

Thank you.

walter52abc
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Expert.

I am using BDT to enhance BP with three more customized tab page. All functions works fine.  there is a problem. the steps are as follows:

  1. opening BP 
  2. open one of the customized tab
  3. do some changes and save.

Update log information: like updated user and date should be only save for current active tab, however, the value of the similar fields on other two tabs updated as well in database.

All fields are appended to LFA1. is there any way to deal with such situation. In ECC, three different screens can be processed individually and no side effects between them. Thanks a lot.

 

Best Regards,

Walter

Andi_M
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Walter,

good question. I checked again with "my" field KNA1-ZCUST and changed the value. Checking change log I can't see any additional field change. Just a guess. It might be that there are some fields which are filled automatically. You can set a breakpoint in BAdI CVI_CUSTOM_MAPPER and check at which fields of structure DATAX is set and analyse afterwards where this X is set.

Best Regards
Andi   

walter52abc
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Andi,

Thanks for your timely response.