Cookbook GenderDomainChanges
Cookbook GenderDomainChanges
PUBLIC
Required Code Adoptions for Customers using Business Partner Gender Domain Fixed Values in S/4HANA
Contents
1 Introduction ___________________________________________________________ 3
2 Business Process Related Information _____________________________________ 4
3 How to determine Relevancy _____________________________________________ 4
4 Overview of SAP Changes _______________________________________________ 4
4.1 ABAP Data Dictionary ________________________________________________________ 4
4.2 External Interfaces __________________________________________________________ 4
4.3 APIs_______________________________________________________________________ 5
5 Recommended Actions __________________________________________________ 6
5.1 Screen fields referring to data element BU_SEXID or AD_SEX ______________________ 6
5.2 Conditional processing based on Gender Codes _________________________________ 7
5.3 Deriving Supported Gender Codes from domain BU_SEXID ________________________ 7
5.4 Deriving Supported Gender Codes from domain AD_SEX __________________________ 8
5.5 Custom code referring to standard APIs ________________________________________ 8
5.6 Support for existing gender fields ______________________________________________ 9
1 Introduction
You are looking to maintain additional gender values such as Neutral or Diverse in SAP Business
Partner (BP). It was not possible to maintain gender values other than Male, Female and Unknown in a
Business Partner so far. With S/4HANA On-premise 2020, in addition to the existing values Male,
Female and Unknown, two new gender values are available in Business Partner master data:
Nonbinary - an identity other than male or female. For example, Divers in Germany.
Not specified - any identity with legal rights; but chooses not to specify the gender
Further details are available in SAP Help documentation (link to be updated at release date).
To support new gender codes, the existing fixed values for gender related domains in Business Partner
data model have been replaced with new value tables. These value tables will hold gender codes Male,
Female and Unknown (existing from older releases) and new gender codes Nonbinary and Not specified
(new from S/4HANA 2020).
This cookbook provides guidance on how to perform necessary adoptions in custom code to change
over from fixed values of Gender domains to value tables.
• Transaction BP
• Fiori Apps for Business Partner, Customer and Supplier maintenance
• Supported external interfaces for like oData, SOAP, iDocs
• Released APIs
SAP delivered business processes have been adjusted to make use of new value tables for gender
codes instead of domain fixed values. Further sections in this document provide guidelines on relevancy
and recommended actions for customer specific coding for Business Partner maintenance.
ABAP domains listed below have been changed to support additional gender codes.
If you have custom ABAP artefacts (screens, programs, classes, services etc.) for BP Maintenance
referring to these domains, the changes are relevant for you.
4.3 APIs
BP Maintenance Modules • New field ‘GENDER’ added to
BUPA_CREATE_FROM_DATA BAPIBUS1006_CENTRAL_PERSON,
BUPA_CENTRAL_CHANGE which is part of BUS_EI_EXTERN
BUPA_CENTRAL_MAINT_PERIOD • New GENDER field supports all values
BUPA_CENTRAL_MAINT_FROM including new ones
• Existing field SEX continues to support
values Male, Female and Unknown for
compatibility
• Target systems have to adopt their code
to read from this new field
BP Read Modules • New GENDER field supports all values
BUPA_CENTRAL_GET_DETAIL including new ones
BUPA_CENTRAL_GETLIST • Existing field SEX continues to support
BUPA_CENTRAL_READ_DETAIL values Male, Female and Unknown for
BUP_BP_DATA_SELECT_ALL compatibility
Address Maintenance Modules • New field ‘GENDER’ added to structures
BAPI_ADDRESSPERS_CHANGE BAPIAD2VI, BAPIAD2VL, BAPIAD3VI
BAPI_ADDRESSCONTPART_CHANGE and BAPIAD3VL
BAPI_ADDRESSPERS_SAVEREPLICA • New GENDER field supports all values
BAPI_ADDRCONTPART_SAVEREPLICA including new ones
• Existing field SEX continues to support
values Male, Female and Unknown for
compatibility
• Target systems have to adopt their code
to read from this new field
Address Maintenance Modules • New GENDER field supports all values
BAPI_ADDRESSCONTPART_GETDETAI including new ones
L • Existing field SEX continues to support
BAPI_ADDRESSPERS_GETDETAIL values Male, Female and Unknown for
compatibility
5 Recommended Actions
5.1 Screen fields referring to data element BU_SEXID or AD_SEX
Custom screens using data elements BU_SEXID or AD_SEX as a reference to screen field will
need adoptions to support all the gender values. As these domains no longer contain fixed values
but instead get the gender values from value help tables TB995 or TSAD15 respectively,
application screens may get affected in a way that no gender codes show up on screen or even if
they appear the values may not get saved to the database. Therefore, applications must replace
the data element from the screen field with a new data element. A sample implementation from
Central Business Partner is provided below.
• For the corresponding UI field for e.g. ‘SEXID’, create a new data element which is of type
CHAR(1). You can also use ‘BU_SEXID_SCREEN’. This neither has fixed values nor
value table.
• Associate the new data element to the UI field.
• In the flow logic, introduce the code to populate the F4 help in ‘PROCESS ON VALUE-
REQUEST.’
For e.g. FIELD BUS000FLDS-SEXID MODULE F4_SEXID.
• In this module introduce the logic to populate the F4 help for SEXID field.
• Sample code for the module is below:
CONSTANTS:
lc_gender TYPE bus_screen-field_name
VALUE 'BUS000FLDS-SEXID'.
DATA : lt_gender_values TYPE bus_screen-dropdown_values,
ls_gender_values TYPE bus_screen_dropdown_value,
lt_tb995t TYPE BUS_T_GENDER_DATA,
ls_tb995t TYPE tb995t.
IF sy-subrc = 0.
• GET_ALL_GENDERS – this method will return all supported gender values for a specific
language. The return data would be in 2 tables - one with updated gender values from TB995
& TB995T table and the second table with values from fixed domain.
• VALIDATE_GENDER – this method will validate a given gender code against list of
supported genders.
• CONVERT_BUPA_TO_ADDRESS_GENDER – keys for Male and Female are different
between Business Partner (BU_SEXID) and Business Addresses (AD_SEX). This
method will help to convert the gender keys from BU_SEXID to AD_SEX
• CONVERT_ADDRESS_TO_BUPA_GENDER – this method will help to convert the
gender keys from AD_SEX to BU_SEXID.
• Interface IF_BUPA_GENDER_UTIL provides constants with gender code value for each
of supported genders.
…
CALL FUNCTION 'BUPA_CREATE_FROM_DATA'
EXPORTING
iv_category = '1'
is_data = ls_bp_data
is_data_person = ls_bp_data_person
iv_check_address = ' '
IMPORTING
ev_partner = lv_partner_no
ev_partner_guid = lv_partner_guid.
Old fields XSEXF, XSEXM and XSEXU from table BUT000 will continue to be (double)
maintained with gender values when chosen gender value is Female, Male, or Unknown. When
the chosen gender is Non-binary or Not specified, old XSEXU will be set. This is done for
compatibility and is in-line with the behavior of BAPI structure fields SEX (for old gender values)
and GENDER (for all gender values). With this approach the solution is compatible for such
applications that have not yet adapted and can continue to support only the old values
(Female/Male/Unknown). For business partner creation, below is the mapping of XSEX* fields
and GENDER field when persisted in BUT000 table. With this approach, even the READ modules
like ‘BUP_BP_DATA_SELECT_ALL’ that return data in the structure type of BUT000, would be
able to return data in both XSEX* fields and GENDER field.
Female 1 X
Male 2 X
Unknown X
Non-binary 3 X
Not specified 9 X