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).
The purpose of this blog is to describe how to influence available Business Partner Groupings at Business Partner creation with transaction BP.
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:
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.
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
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.
lv_sytabix = lv_sytabix + 1.
Test transaction BP
If you now run transaction BP and create a person you will see the reduced available Business Partner Groupings.
To reduce available Business Partner Roles based on selected Business Partner Grouping please have a look at blog