Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
Andi_M
Product and Topic Expert
Product and Topic Expert
In most of my Business Partner workshops I was asked the question: How shall we handle our Z-Fields from Customer/Vendor Master Data in Business Partner transaction.

Short Answer: You have to rebuild the fields in Business Partner transaction.

In this Cookbook I'll guide you step by step to implement a Z-Field from table KNA1 into Business Partner transaction.

How to add a bunch of Z-Fields on a custom tab in BP transaction, you can learn at blog post SAP S/4HANA BP screen enhancement with custom tab written by badrinathravi.

Introduction


Purpose and target


The purpose of this document is to describe how to implement a BDT enhancement. A field from table KNA1 has to be re-implemented in Business Partner transaction as well to ensure availability in SAP S/4HANA.

Remark: This procedure can be used for all the single fields from Customer or Vendor tables. This Cookbook is not made for fields related to Table Controls as of partner assignment for example from KNVP.

Foundation for this document is SAP note

2309153 - BP_CVI: Guideline Version 1.14 for customer enhancements in CVI (customer/vendor integrati...

Target audience: Functional expert, Development expert

Version: SAP S/4HANA On premise 1610 and higher

There is a field in table KNA1 which was available in XDxx transaction.



In case you are adding this field completely new, don't forget to mark for Change Document at Data Element level to track changes at this field.


 

 

 

 

 

 

 

 

 

 

This field has to be re-implemented in SAP S/4HANA to be available in transaction Business Partner with customer role.


Implementation


Determine Area in Business Partner transaction where to place the new field


In this example the field should be placed in customer role, tab (Screen) ‘Customer: General Data’, Section ’ Additional General Data’

  1. Run transaction BP and navigate to role ‘Customer’->tab ‘Customer: General Data ’New field should be placed directly below the field ‘Plant’. To determine screen control settings of BDT, place the cursor into field plant and enter OK-Code BDT_ANALYZER into transaction field

  2. BDT_ANALYZER is starting and gives information about screen control. For later assignment of new view the following information is important:Navigate to
    Section CVIC45- Additional General Data
    and open folder viewsNote down section number (for example CVIC45)

  3. To get View details navigate into view CVIC62 by clicking on name CVIC62Note down
    Application: CVIC
    Differentiation Type: 0
    Data Set: CVIC11


 

Create Technical Objects


 

Create Function Group



  1. Run Object Navigator with transaction SE80


Create PBO Function Module



  1. From context menu of new Function Group choose Create-> Function Module

  2. Enter name, Function Group and Short Text of new Function Module

  3. Enter Coding
    function z_cvic_bupa_pbo_zvic01.
    *"----------------------------------------------------------------------
    *"*"Local Interface:
    *"----------------------------------------------------------------------
    data:
    lt_kna1 type table of kna1,
    table_name_kna1 type fsbp_table_name value 'KNA1'.

    * step 1: request data from xo for dynpro structure
    cvi_bdt_adapter=>data_pbo(
    exporting
    i_table_name = table_name_kna1
    importing
    e_data_table = lt_kna1[]
    ).
    if lt_kna1[] is initial.
    clear gs_kna1.
    else.
    read table lt_kna1 into gs_kna1 index 1.
    endif.

    endfunction.

    Save and activate


Create PAI Function Module



  1. From context menu of new Function Group choose Create-> Function Module

  2. Enter name, Function Group and Short Text of new Function Module

  3. Enter Coding
    FUNCTION z_cvic_bupa_pai_zvic01.
    *"----------------------------------------------------------------------
    *"*"Local Interface:
    *"----------------------------------------------------------------------
    DATA: false TYPE boole-boole VALUE ' ',
    lt_kna1 TYPE TABLE OF kna1,
    table_name_kna1 TYPE fsbp_table_name VALUE 'KNA1'.

    FIELD-SYMBOLS: <kna1> LIKE LINE OF lt_kna1.

    CHECK cvi_bdt_adapter=>is_direct_input_active( ) = false.
    * step 1: update xo memory from technical screen structure
    cvi_bdt_adapter=>get_current_bp_data(
    EXPORTING
    i_table_name = table_name_kna1
    IMPORTING
    e_data_table = lt_kna1[]
    ).

    IF lt_kna1[] IS INITIAL.
    IF gs_kna1 IS NOT INITIAL.
    gs_kna1-kunnr = cvi_bdt_adapter=>get_current_customer( ).
    APPEND gs_kna1 TO lt_kna1.
    ENDIF.
    ELSE.
    READ TABLE lt_kna1 ASSIGNING <kna1> INDEX 1.
    <kna1>-zcust = gs_kna1-zcust.
    ENDIF.

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

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

    * SPACE to implement own PAI checks

    ENDFUNCTION.

    Save and activate.


Create Technical Screen



  1. From context menu of new Function Group choose Create-> Function Module

  2. Enter screen number

  3. Enter screen attributes
    Short Text and type Subscreen

  4. Navigate to Layout (Screen Painter)

  5. Create Text Field ‘End-Customers’

  6. Accept dictionary reference proposal

  7. Create Input field at position 25

  8. Define Field as NUMC via double click at field!!! Pay attention to field format. This must fit to format of field in table KNA1. !!!

  9. Activate the new object and close Screen PainterNavigate to screen Flow Logic

  10. Assign PBO Module

  11. Create PBO Module with double click at pbo
    Enter sub routine pbo

  12. Create sub routine pbo with double click at pbo
    Enter coding
    *&---------------------------------------------------------------------*
    *& Form PBO
    *&---------------------------------------------------------------------*
    *& text
    *&---------------------------------------------------------------------*
    *& --> p1 text
    *& <-- p2 text
    *&---------------------------------------------------------------------*
    FORM pbo .
    call FUNCTION 'BUS_PBO'.
    ENDFORM.

     

  13. Assign PAI Module

  14. Create PAI Module with double click at paiEnter sub routine pai

  15. Create sub routine pai with double click at paiEnter coding
    *&---------------------------------------------------------------------*
    *& Form PAI
    *&---------------------------------------------------------------------*
    *& text
    *&---------------------------------------------------------------------*
    *& --> p1 text
    *& <-- p2 text
    *&---------------------------------------------------------------------*
    FORM pai .
    call FUNCTION 'BUS_PAI'.
    ENDFORM.​



 

Extend Complex Interface CVIS_EI_EXTERN


To ensure data transportation from Business Partner to Customer master data the complex interface of CVI has to extended by the additional field.

  1. Open ABAP Dictionary run transaction SE11 and enter data type CVIS_EI_EXTERN

  2. Use forward navigation to reach customer’s central data using double click


  3. Both structures DATA and DATAX needs to get an append

  4. Create append to DATA structure typeNavigate into structure with double click

  5. Create Append structure ZKNA1_ENH

  6. Add structure component and component type as definition in KNA1

  7. Save and Activate changes

  8. Navigate back to Structure CMDS_EI_CMD_CENTRAL

  9. Create append to DATAX structure typeNavigate into structure CMDS_EI_VMD_CENTRAL_DATA_XFLAG with double click

  10. Create an Append Structure ZKNA1_ENHX

  11. Add structure component ZCUST component type BAPIUPDATE

  12. Save and activate changes

  13. Leave transaction SE11


Customizing settings in BDT


Create Field Group



  1. Open BDT menu using BUPT in OK-Code field

  2. Navigate to Screen Layout section and open Field Groups

  3. Create a new Field Group in Customer Name space

  4. Create Field Group 600
    Function Module CVIC_BUPA_EVENT_FMOD2_ENH is used to determine field control (mandatory, hidden, …) from customizing

  5. Assign fields from technical screen to field groupSave your changes


Create View



  1. Navigate to Screen Layout section and open Views

  2. Create a new View and take Values from Chapter ‘Determine Area in BP transaction where to place the new field’. Use technical screen program name and number from chapter ‘Create Technical Screen’ Use PBO and PAI function module names from chapters ‘Create PAI Function Module’ and ‘Create PBO Function Module’

  3. Assign Field Group to View

  4. Save your changes


 

Assign View to Section



  1. Navigate to Screen Layout section and open Sections

  2. Position Cursor on Section determined in Chapter ‘Determine Area in BP transaction where to place the new field’

  3. Mark Section and choose Section->View Assignment from navigation tree

  4. Choose New Entries

  5. Enter data for new assignmentUse View number from Chapter ‘Create View’ Save the data


 

Test



  1. Start Transaction BP

  2. Search for a customer

  3. Display the customer

  4. Select role ‘Customer’

  5. Navigate to tab ‘Customer: General Data’



Conclusion


With this guidance you are able to implement additional fields at Business Partner transaction on your own.

Fiori App Extension


To Extent Fiori Apps please have a look at following blog posts:

Create Custom fields for Business Partner SAP Fiori screens in SAP S/4HANA

SAP Fiori for SAP S/4HANA – How to extend a SAP Fiori app in SAP S/4HANA

52 Comments
Private_Member_7726
Active Contributor
Hmm, back to the BP bare-bones... Whatever happened to the "Easy Enhancement Workbench, (no less)" 🙂
FUNCTION z_cvic_bupa_pai_zvic01.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"----------------------------------------------------------------------
" No, please - no... NO! NOOOOOOOO!
" Please, all this stuff goes so nicely into a (local) singleton... It costs what -
" 5, 10, or maybe 15 minutes more to extract it..? To set up a good example to
" immitate, for programmers, likely acting upon only «gefährliches Halbwissen»,
" who might have to maintain, or worse still - copy this x times... 🙂

DATA: false TYPE boole-boole VALUE ' ',
lt_kna1 TYPE TABLE OF kna1,
table_name_kna1 TYPE fsbp_table_name VALUE 'KNA1'.

...
<...>
...

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

* SPACE to implement own PAI checks
" No, please, no - just noooooooo! https://www.youtube.com/watch?v=umDr0mPuyQc 🙂
ENDFUNCTION.

 
kgash2000
Explorer
0 Kudos
Hi Andi,

I have a question around BP datasets missing in ERP SAP_APPL 617 Sp 0018. I see that a lot of standard Customer and Vendor fields are missing from the datasets / field groups / views and are not available on the BP. Is there any add_on / Note / SP which can help with the bringing this content into the our environment?
miscusi83
Explorer
0 Kudos
Hi Andi,

is there a cookbook also to do the same for BP IC Web Client views? How can I add KNA1 fields to the BP master data table BUT000? In our current project, the SAP GUI is no longer used by the IC agents, they use the IC Web Client instead.

Thanks!

Mireille
kjyothiraditya
Participant
0 Kudos
how can we implement the same using in-app extensibility ? any pointer please
former_member517243
Participant
0 Kudos
Hi Andi,

Nice blog.

Point 2 is not clear, "Create a new ViewTake Values from Chapter ‘Determine Area in BP transaction where to place the new field’" . From where are you referring these chapters.

 

Regards

Mohinder

 

 

 

 

 
Andi_M
Product and Topic Expert
Product and Topic Expert
Andi_M
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Mohinder,

Application is a given one due to customer integration.

Dataset is given by the other views closed to the place of new view.

Best Regards

Andi
former_member682879
Discoverer
0 Kudos
Hi Experts,

 

I have some problem here, i already enhanced custom field following all of step above, but when i change / update data with existing BP, the data from custom field can not be change. Please help.

Thank you,

Indro
stemper
Newcomer
0 Kudos
Hello Andi,

I tried to implement z-fields following your guide ahead. But I get an error when creating PBO / PAI function modules as the global structure gs_kna1 is not available. And as the function modules do not have any import parameters I am wondering how this can work. Can you please advice?

Thanks in advance,

best regards, Stefan
brahms86
Active Contributor

Just go in that function group to the “Includes” section in the object list.

There must be a “TOP-Include”. In that top-include you can declare these structures.

DATA declarations in top-include

KR,

Steffen

Hi Andi,

I have created a custom field in BP transaction against Company code > Customer: Payment Transaction screen .  I have done all the configuration through BUPT. Issue is that the custom field is not getting saved in KNB1 table.(KNB1 table is enhanced with custom field)

 

Could you please help me .

 

Thanks,

Karuna
0 Kudos
Hi Andi,

Thanks for your effors. It was a very enlightening article. I also adapted it for the KNVV table and succeeded.

Thanks.

Omer
vadivuckarasi
Explorer
0 Kudos
Hi Andi Mauersberger,

Thanks for wonder document. It helped me a lot to add a field in BP.

Thanks,

Vadivuckarasi

 
lukasz_dippel
Participant
0 Kudos
Hello Andi, please look at my question here.

CVI between BP and Customer. | SAP Community

Thank you.
Yogesh_bagul
Explorer
0 Kudos
andi.mauersberger

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
Hi Andi,

 

I need a requirement to add couple of Z fields to Table control in BP .

Exactly to say in BP--> Credit management--> Control Data--> External credit information

Can you please let me know how can we add those Z-fields using BDT.

 

Regards

Raghavendra
landedasilva
Explorer
0 Kudos
Nice blog. It worked 100% for me when I was adding a custom field in Billing tab for BP role Customer. Thanks for sharing.

In section Customizing settings in BDT, item 5 (Assign fields from technical screen to field group), please be aware that the system will issue warnings that these fields do not exist in screen. And if you insist the warnings become error messages. I got stuck there for some time without knowing how to get passed, but I managed to save it and get by.
marcela_martinez
Participant
0 Kudos
Hi Raghavendra,

I need to do the same but in Payment Transactions folder, at Bank Details table control. If you solve it can you share some guidelines with me?

Thanks in advance and kind regards.

Marcela.
rafael_zaragatzky
Active Contributor
0 Kudos

Hi Andi and everybody else,

I have the need to add two fields to the section Conditions on the Purch. org. data screen.

It was easy to follow Andi's instruction and I think I have defined the view correctly - I can click on the "Screen painter" button there and see my Dynpro. I think I also linked the view correctly - the same application CVIV and the data set CVIV06 as for the view CVIV76 Purchase order currency which also exists in the section Conditions.

If I put a break-point in the PBO module of my custom screen, the dubugger gets there. The Dynpro is also generated correctly.

But still the new fields won't show on the BP screen. Any idea what can be wrong please? Maybe the fields need to be activated in some "Field status" option in IMG?

TIA

Raf

former_member569644
Discoverer
0 Kudos
Hi Andi,

thank you very much 🙂

Vasek
Former Member
0 Kudos
Hi Andi ,

I followed all the steps in order and the z field was added, but it does not detect the changes I have made, it gives the message "no changes have been made" and it does not write to the kna1 table, what am I doing wrong?
Andi_M
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Hüseyin,

it seems that your changed field data was not 'transported' into table structure. Please double check blog section 'Create PAI Function Module' and check assignment to your view definition.

Andi

Former Member
thank you very much i solved the problem my own fault
former_member658126
Participant
Is your issue resolved, i am also facing same issue

 
former_member658126
Participant
0 Kudos
Hi Yogesh,

 

Is your issue resolved? i am also facing same issue

 
former_member658126
Participant
0 Kudos
Are you able to update the data?

 
former_member658126
Participant
0 Kudos
Hi Huseyin,

 

Please let me know how the issue was fixed. I am stuck with the same. Made changes as per blog, Data not updated to LFM1 table. Suggest your inputs

 
former_member658126
Participant
0 Kudos
Hi Andi,

 

I am facing issue with saving data from bp with custom fields. Please suggest

 
0 Kudos
Excellent article, thank you so much!
former_member543666
Discoverer
0 Kudos
I made the implementation, but the Z field is open for change, even though it is in the display module.
What can it be?
Trix
Explorer
0 Kudos
Please, check the settings in customizing under:
Cross-Application Components > SAP Business Partner > Business Partner > Field Groupings:

- Configure Field Attibutes per BP Role
hari_babu15
Explorer
0 Kudos
Hi Andi,

Thank you for great article.

Please let me know. can we update UKMBP_CMS_SGM table? i tried same steps as above KNA1, it is working fine. but when i use UKMBP_CMS_SGM table it is giving dump. I need to update zfield in credit segment data.

 

Thank you!.

Babu.
Andi_M
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi Hari,

sorry, my focus is CVI. I don't know the details in Credit Management but I've seen that following structures are referred to:

UKM_S_BP_CMS

UKM_S_BP_CMS_SGM

I hope that helps you. Otherwise you should contact your Credit Management consultant and/or developer.

Best Regards
Andi
hari_babu15
Explorer
0 Kudos
Hi Andi,

 

Thank you so much for replying to me.

As per my analysis entries which are available in table CEXO_MO for BUSINESS_PARTNER only we can use.

Thank you!

Regards,

Hari.

To anyone having trouble saving the data using cvi_bdt_adapter=>data_pai_with_company_cod

In my case(adding LFB1 data) the custom fields had to be added to
VMDS_EI_COMPANY_DATA and VMDS_EI_COMPANY_DATAX
the same way they were added to
CMDS_EI_VMD_CENTRAL_DATA and CMDS_EI_VMD_CENTRAL_DATA_XFLAG.

Madjid
Participant
0 Kudos
very good
thank for share your info
purush_r
Explorer
0 Kudos
Thanks for the Blog, it was really very helpful. I have a quick question, if I want to hide this custom fields based on Company code or some condition how to do that.
mary_lins3
Member
0 Kudos
Hi Andi,

We are now also facing the same issue as others above.   We have verified that BPUT configuration is set up correctly and FM PBO/PAI objects / XO methods do pull in the updated screen fields plus extended DATA and DATAX within basic Customer/Vendor structures

(Complex Interface CVIS_EI_EXTERN)


per your tutorial above but saving to the database from those custom BP fields (KNA1 and LFA1) is not successful even though messaging says the change has been made.

Can you suggest anything else that could be missing/incorrect?

Thank you for any additional guidance!
akshayd1998
Participant
0 Kudos


Custom LFB1 field


Hello Friends,

I've followed the above method shared by Andi and created a custom field in BP in company code section. The field is accepting value properly but when I click on Save button it goes in to the PBO FM "cvi_bdt_adapter=>data_pbo"  but in import parameter my custom field value gets blank the entered value disappears while on enter click it goes into the PBO FM and values remains/does not disappear .Please help me to resolve this ASAP.
Andi_M
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hello Akshay,

please double check your PBO/PAI function modules which are assigned at your field group. At this function modules please check the field values. Start with PAI function module and check at saving the data.
hutner
Explorer
0 Kudos
I follow your instructions and is working fine. But now I want to add a Button to my screen painter.

The button is displayed in the bp transaction. But when I click the button i get the message "function code is unkown"

What is missing?
Andi_M
Product and Topic Expert
Product and Topic Expert
Hello Stefanie,

you have to

  1. define you function code at transaction BUS9

  2. define and assign button logic at BDT-Event FCODE at transaction BUS7


As an example you can take function code CVIC_KNVA_DELE (Delete Unloading Point).

At transaction BUS9 you will find this function code and it's field group assignment.

At transaction BUS7 you will find function module CVIC_BUPA_EVENT_FCODE. At this FM you will find statement
* delete loading point
when fcode_loadpnt_dele.
perform delete_load_point.

with logic for this button.

I hope this will help you.

Best Regards

Andi
hutner
Explorer
0 Kudos
Yes, I figured it out myself. Thank you for replying anyway.
hutner
Explorer
0 Kudos

I have further problem.

i want to block new vendors  automatically by saving-> lfa1-sperq and lfa1-sperm. 

is the fcode DSAVE the right position for that?

And how can I get vendor data for example postcode city (which not saved)

*  lv_newKred = cvi_bdt_adapter=>is_current_vendor_new( ).
*  IF lv_newKRED EQ 'X'.
*    lt_roles = cvi_bdt_adapter=>get_current_roles( ).
*    READ TABLE lt_roles ASSIGNING FIELD-SYMBOL(<ls_roles>) WITH KEY role = 'ZVENMM'.
*    IF sy-subrc EQ 0.
*
*
*      cvi_bdt_adapter=>get_current_bp_data(
*        EXPORTING
*          i_table_name = table_name_lfa1
*        IMPORTING
*          e_data_table = lt_lfa1[]
*      ).
*      IF lt_lfa1[] IS NOT INITIAL.
*        ASSIGN lt_lfa1[ lifnr = cvi_bdt_adapter=>get_current_vendor( ) ] TO FIELD-SYMBOL(<ls_lfa1>).
*        <ls_lfa1>-sperm = 'X'.
*        <ls_lfa1>-SPERq = 'Z4'.
**           gs_lfa1-SPERM = 'X'.
**            gs_lfa1-SPERQ = 'Z4'.
**             APPEND gs_lfa1 TO lt_lfa1.
*        cvi_bdt_adapter=>data_pai(
*          i_table_name = table_name_lfa1
*          i_data_new   = lt_lfa1[]
*        ).
*      ENDIF.
*    ENDIF.
*  ENDIF.

RamPurush
Newcomer
0 Kudos

Hi,

I am able to add the new Z fields to BP transaction, but the Z field is editable even in display mode. How to make it non editable.

I added Z fields for both customer and Vendor, for vendor there is no issue, but for Customer few fields are editable in display mode.

GitteGreibe
Participant
0 Kudos

Hi @Andi_M 

Thank you for such a detailed guide 😊
We have followed it to enhance our BP with a new field on the customer unloading point (table KNVA).
The enhancement works fine in transaction BP / app Maintain BP.

But what about mass changes, for example via tr. MASS or MASSD?
Where do you put in your extensions to also handle that part?

I’m asking because we have experienced that when we do a mass change to our customers (changing another field on the customer than our new Z-field) then our Z-field is being cleared. So we loose our Z-values somewhere during the MASS-process.
We have tried to do some error investigation.
It seems that we loose the values in our Z-field in method FILL_CUSTOMER_DATA (Class CL_MAINTAIN_BP_FROM_CV). Maybe even earlier in the process.
Specifically, I think that structure E1KNVAM must be enhanced with the new Z-field as well.

My question to you: Do you do any extensions in the structures used by the method FILL_CUSTOMER_DATA to get the Mass-transactions to work for customers and not blank out the values in your Z-fields? The same question goes of course for the suppliers as well; but our specific problem is on the customers.

I hope to hear from you 😊

Best regards,
Gitte Greibe

Andi_M
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Gitte,

unfortunately I'm not familiar with mass functionality. Maybe there is someone else within community who can help.

Best Regards
Andi

GitteGreibe
Participant
0 Kudos

Hi Andi

Thanks for getting back to me.
In my mind, it's not possible to implement enhancements on the business partner without also covering the mass changing functionality. It's a crucial part in the business to be able to do mass changes.

Best Regards
Gitte. 

PGAKHAR
Discoverer
0 Kudos

Hi @Andi_M ,

Can you please share your views?

Followed same Steps that you mentioned above for Vendor Under General Data. But field is non-editable even in change mode. can you please help?

 

Andi_M
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi PGAKHAR,

I can just guess because there might be several reasons. Please check the assigned function module at your new field group. In my example I'm at customer but you are about to enhance vendor. Please try Function Module CVIV_BUPA_EVENT_FMOD2_ENH. Function Module CVIC_BUPA_EVENT_FMOD2_ENH and CVIV_BUPA_EVENT_FMOD2_ENH might be similar but you should use this one for vendors.