0% found this document useful (0 votes)
58 views10 pages

Cookbook GenderDomainChanges

This document outlines the necessary code adaptations for customers using the Business Partner Gender Domain Fixed Values in S/4HANA, focusing on the introduction of new gender values such as Nonbinary and Not specified. It provides guidance on how to transition from fixed gender values to new value tables, detailing changes in ABAP data dictionaries, external interfaces, and APIs. Recommended actions are included for custom code adjustments to ensure compatibility with the updated gender information in Business Partner master data.

Uploaded by

kavirajan PRABHU
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views10 pages

Cookbook GenderDomainChanges

This document outlines the necessary code adaptations for customers using the Business Partner Gender Domain Fixed Values in S/4HANA, focusing on the introduction of new gender values such as Nonbinary and Not specified. It provides guidance on how to transition from fixed gender values to new value tables, detailing changes in ABAP data dictionaries, external interfaces, and APIs. Recommended actions are included for custom code adjustments to ensure compatibility with the updated gender information in Business Partner master data.

Uploaded by

kavirajan PRABHU
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Cookbook

Required Code Adoptions


for Customers using
Business Partner Gender
Domain Fixed Values in
S/4HANA

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

© Copyright SAP SE 2020 Public Page 2 of 10


Required Code Adoptions for Customers using Business Partner Gender Domain Fixed Values in S/4HANA

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.

© Copyright SAP SE 2020 Public Page 3 of 10


Required Code Adoptions for Customers using Business Partner Gender Domain Fixed Values in S/4HANA

2 Business Process Related Information


All business processes which involve maintenance of Business Partner Master Data and in that
specifically the Gender information for the Business Partner are affected. This includes primarily
Business Partner maintenance via

• 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.

3 How to determine Relevancy


As Business Partner is one of the most fundamental business objects in S/4HANA and as there would
invariably be Business Partner of type Person in any organization, this simplification item is applicable
in most customer cases.

ABAP domains listed below have been changed to support additional gender codes.

Domain Fixed Values Removed Replacement Value Table


BU_SEXID Female, Male and Unknown TB995
AD_SEX Female, Male and Unknown TSAD15
SEXKZ Female and Male TSAD15

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 Overview of SAP Changes


4.1 ABAP Data Dictionary
Database Tables • BUT000-GENDER (New field for GENDER) introduced
(BUT000, LFA1, • Fields XSEXF, XSEXM, XSEXU will continue to be maintained
KNA1, KNVK) for compatibility
New Value Tables • TSAD15
• TB995
Domain Changes • AD_SEX domain based on value table TSAD15
(PARGE, SEXKZ, • BU_SEXID domain based on value table TB995
BU_SEXID, AD_SEX) • SEXKZ domain updated to be based on TSAD15
• PARGE data element based on AD_SEX which in turn refer to
value table TSAD15
Maintenance Views • V_TSAD3 updated (2 new columns: Proposed Gender,
Excluded Gender)

4.2 External Interfaces


OData • New field ‘GenderCode’ added to A_BUSINESSPARTNER
API_BUSINESS_PARTNE • New BP records return the gender value in the New
R Gender Field.
• Continue to return values in existing Gender Boolean
fields( IsMale,IsFemale and IsUnknown) for compatibility.

© Copyright SAP SE 2020 Public Page 4 of 10


Required Code Adoptions for Customers using Business Partner Gender Domain Fixed Values in S/4HANA

• Target systems have to adopt their code to read from this


new field
SOAP • New “GenderTypeCode” field in SOAP service
BusinessPartnerSUITEBul • The new field “GenderTypeCode” in the SOAP Service will
kReplicateRequest_Out be used to return all the 5 gender values in SOAP
BusinessPartnerSUITEBul • The existing “GenderCode” field will be used to return only
kReplicateRequest_In Male,Female and Unknown values in SOAP service
IDocs: • New field “GENDER” in the IDoc segment E1LFA1M with
CREMAS field type SEXKZ
• Update the LFA1-SEXKZ field domain to support the new
gender values.
• Introduce a new field “GENDER” in the IDoc segment
E1KNVKM with field type PARGE for vendor contact
person
• Existing SEXKZ will continue to return only Male/Female in
the IDoc outbound.
• New GENDER field will be used to return all the gender
values
IDocs: • Use the existing field in KNVK-PARGE and new GENDER
DEBMAS field in IDoc DEBMAS
• Introduce a new field “GENDER” in the IDoc segment
E1KNVKM with field type PARGE
• Update the KNVK-PARGE field domain to support the new
gender values

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

© Copyright SAP SE 2020 Public Page 5 of 10


Required Code Adoptions for Customers using Business Partner Gender Domain Fixed Values in S/4HANA

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.

CALL METHOD cl_bupa_gender_util=>get_all_genders


EXPORTING
iv_langu = sy-langu
IMPORTING
et_tb995t = lt_tb995t.

IF sy-subrc = 0.

LOOP AT lt_tb995t INTO ls_tb995t.


ls_gender_values-key = ls_tb995t-gender.
ls_gender_values-text = ls_tb995t-gtext.
APPEND ls_gender_values TO lt_gender_values.
ENDLOOP.
SORT lt_gender_values BY key.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'


EXPORTING
retfield = lc_gender
value_org = 'S'
TABLES
value_tab = lt_gender_values
EXCEPTIONS
parameter_error = 1
no_values_found = 2
others = 3.
ENDIF.

© Copyright SAP SE 2020 Public Page 6 of 10


Required Code Adoptions for Customers using Business Partner Gender Domain Fixed Values in S/4HANA

5.2 Conditional processing based on Gender Codes


If there is a conditional processing logic based on gender codes male and female, this will have
to be changed to accommodate new gender codes Nonbinary, Not specified.
• Sample Current Implementation for Reading Gender Values
DATA: ls_DataPerson type BAPIBUS1006_CENTRAL_PERSON.
….
* Calls API function to get Details of a Business Partner.
CALL FUNCTION 'BUPA_CENTRAL_GET_DETAIL'
EXPORTING
IV_PARTNER = lv_partner
IMPORTING
ES_DATA = ls_Central
ES_DATA_PERSON = ls_DataPerson
ES_DATA_ORGAN = ls_DataOrg
ES_DATA_GROUP = ls_DataGroup
TABLES
ET_RETURN = lt_results.
IF ls_DataPerson-sex = ‘1’.

ELSEIF ls_DataPerson-sex = ‘2’.

ENDIF.

• Recommendation for Reading Gender Values


DATA: ls_DataPerson type BAPIBUS1006_CENTRAL_PERSON.
….
* Calls API function to get Details of a Business Partner.
CALL FUNCTION 'BUPA_CENTRAL_GET_DETAIL'
EXPORTING
IV_PARTNER = lv_partner
IMPORTING
ES_DATA = ls_Central
ES_DATA_PERSON = ls_DataPerson
ES_DATA_ORGAN = ls_DataOrg
ES_DATA_GROUP = ls_DataGroup
TABLES
ET_RETURN = lt_results.
IF ls_DataPerson-gender = ‘1’.

ELSEIF ls_DataPerson-gender = ‘2’.

ELSEIF ls_DataPerson-gender = ‘3’. "Gender Nonbinary

ELSEIF ls_DataPerson-gender = ‘9’. "Gender Not specified

ENDIF.

5.3 Deriving Supported Gender Codes from domain BU_SEXID


For possible gender values, the fixed values maintained under domain BU_SEXID cannot be
used anymore. Updated list of supported gender values would be available in the table TB995
and corresponding text table TB995T.
A utility class CL_BUPA_GENDER_UTIL is be available to read these tables with possible
operations as listed below.

© Copyright SAP SE 2020 Public Page 7 of 10


Required Code Adoptions for Customers using Business Partner Gender Domain Fixed Values in S/4HANA

• 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.

5.4 Deriving Supported Gender Codes from domain AD_SEX


For possible gender values, the fixed values maintained under domain AD_SEX cannot be used
anymore. Updated list of supported gender values would be available in the table TSAD15 and
corresponding text table TSAD15T.
A utility class CL_ADDR_GENDER_UTIL is be available to read these tables with possible
operations as listed below.
• 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
TSAD15 & TSAD15T 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.
• DERIVE_GENDER_FROM_TITLE – this method will propose a gender code against the
title supplied by reading customizing table TSAD3
• CHECK_CONSISTENCY_GENDER_TITLE – this method will check the consistency
between of a give gender and title combination by reading customizing table TSAD3
• CHECK_EXCL_GENDER_AND_DERIVE – this method will check if the supplied gender
is excluded gender for the supplied gender and if true, provide a proposed gender reading
customizing table TSAD3
• Interface IF_ADDR_GENDER_UTIL provides constants with gender code value for each
of supported genders.

5.5 Custom code referring to standard APIs


Custom applications reading or maintaining Gender information for BPs using BAPIs will have to
adopt to read/write to new GENDER field in the BAPIBUS1006_CENTRAL_PERSON. Usage can
be determined based on whether applications are currently consuming field SEX
in BAPIBUS1006_CENTRAL_PERSON. Refer Section 4. Overview of SAP Changes for full list
of the APIs affected.
Refer example below. In this case, gender value has been passed in the new field
ls_bp_data_person-gender in place of old field ls_bp_data_person-sex. If custom
applications read old gender fields (XSEX*) from table BUT000, such applications shall be
adopted to use new gender field BUT000-GENDER.

• Sample Current Implementation for Maintenance of Gender Values


DATA: ls_bp_data_person TYPE bapibus1006_central_person.

ls_bp_data-partnertype = '0001'.
ls_bp_data_person-sex = '1'.

© Copyright SAP SE 2020 Public Page 8 of 10


Required Code Adoptions for Customers using Business Partner Gender Domain Fixed Values in S/4HANA


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.

• Recommendation for Maintenance of Gender Values


DATA: ls_bp_data_person TYPE bapibus1006_central_person.

ls_bp_data-partnertype = '0001'.
ls_bp_data_person-gender = '1'.

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.

5.6 Support for existing gender fields


If applications read old gender fields (XSEX*) from table BUT000, such applications shall be
adopted to use new gender field BUT000-GENDER. All applications will eventually have to switch
over to BUT000-GENDER if they have to support new gender values.
• Sample current implementation for reading old gender fields from BUT000
FIELD-SYMBOLS:
<ls_but000> TYPE but000.

* Perform operations based on Gender
IF <ls_but000>-XSEXF = abap_true. “Female

ENDIF.
IF <ls_but000>-XSEXM = abap_true. “Male

ENDIF.
• Recommendation for reading new gender field from BUT000
FIELD-SYMBOLS:
<ls_but000> TYPE but000.

* Perform operations based on Gender
IF <ls_but000>-GENDER = '1'.“Female

ENDIF.
IF <ls_but000>-GENDER = '2'.“Male

ENDIF.

© Copyright SAP SE 2020 Public Page 9 of 10


Required Code Adoptions for Customers using Business Partner Gender Domain Fixed Values in S/4HANA

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.

Possible Gender BUT000- BUT000- BUT000- BUT000-


Value GENDER XSEXF XSEXM XSEXU

Female 1 X

Male 2 X

Unknown X

Non-binary 3 X

Not specified 9 X

© Copyright SAP SE 2020 Public Page 10 of 10

You might also like