At Business Partner creation process you have to decide whether to create a Business Partner as person or organization (and very seldom as group).
Unfortunately there is no restriction of Business Partner Grouping depending on Business Partner Type person or organization. Independent on Business Partner Type you will always see all defined Business Partner Groupings.
In this blog I will describe a way how to reduce available Business Partner Groupings based on selected Business Partner Type. With this solution you can restrict available Business Groupings dependent on selected Business Partner Type (person, organization).
Introduction
The purpose of this blog is to describe how to influence available Business Partner Groupings at Business Partner creation with transaction BP.
Target audience: Functional Experts
Version: SAP S/4HANA On Premise 1610 and higher
A detailed description of used BAdI BUPA_NUMBER_GROUP you will find at SAP Note
995155 - Filtering the values in the number grouping dropdown
Starting Point
If you run transaction BP and create a person you will get a screen like this.
As you can see there are all defined Business Partner Groupings listed.
Target is to reduce available values just to this two entries if you create a person:
0170 Consumer
0200 Contact Person
Foundation is a custom customizing table where possible combinations of Business Partner Type and Business Partner Groupings are stored.
Create control table
To define allowed Business Partner Groupings per Business Partner Type you have to create customizing table (inclusive table maintenance screen) in customer name space which you can maintain via transaction SM30.
At this example I defined only Business Partner Groupings 0170 and 0200 for persons:
As you can see only person (Business Partner Type 1) is entered for Business Partner Groupings 0170 and 0200.
BAdI Implementation
Create an implementation for BAdI BUPA_NUMBER_GROUP at transaction SE19.
Implement following example coding at method IF_EX_BUPA_NUMBER_GROUP~VALID_NUMBER_GROUP
METHOD if_ex_bupa_number_group~valid_number_group.
DATA: lt_group TYPE TABLE OF zbp_type_group,
lv_type TYPE bu_type,
ls_values TYPE LINE OF bus_screen-dropdown_values,
lv_sytabix TYPE sy-tabix.
lv_type = iv_request->gs_navigation-bupa-creation_type.
SELECT * FROM zbp_type_group INTO TABLE lt_group WHERE type = lv_type.
LOOP AT et_dropdown_values INTO ls_values.
lv_sytabix = sy-tabix.
READ TABLE lt_group WITH KEY bu_group = ls_values-key TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
DELETE et_dropdown_values INDEX lv_sytabix.
ELSE.
lv_sytabix = lv_sytabix + 1.
ENDIF.
ENDLOOP.
ENDMETHOD.
Test transaction BP
If you now run transaction BP and create a person you will see the reduced available Business Partner Groupings.
Further Improvement
To reduce available Business Partner Roles based on selected Business Partner Grouping please have a look at blog
SAP S/4HANA Business Partner restrict Business Partner Roles based on Grouping at creation