This blog post is part of Business Partner blog series. See the previous 2 blogs related to BP-handling topics:

1. How to synchronize KNVK for other relationship types than ‘Contact Person’

2. How to create a BP Role with Company and Sales/ Purchasing view

 

Standard view of BP search result

When you find a Business Partner using BP-based transaction you are getting a simple view which shows you basic partner data:

Business%20Partner%20basic%20search%20result

Business Partner basic search result

 

It lacks of customer, vendor, full address information and any other that you may want to see.

You can of course open the BP selected and check one by one such information or build a custom report (as there are no complex business partners reports in standard SAP).

However, you can also enahnce the standard view without any modification and include any additional information you want.

Add new field to BP search result

The display of search result is based on structure BUS_RESULT_TC:

Standard%20fields%20available%20in%20search%20result

Standard fields available in search result

Proceed with following to enhance the list:

1. Append structure to BUS_RESULT_TC

New%20append%20creation

New append creation

Add new fields – I suggest to keep the same field names as in SAP standard – in such way during upgrade you can easily identify if SAP has included the same field as you. In such case you could eliminate your enhancement – the same data would be already provided by SAP Standard.

 

In the append add fields that are of your interest – in the example street, customer, vendor, BP Type and country are added:

Additional%20fields%20in%20display

Additional fields to display

Activate the append and proceed to data filling.

 

2. Implement filling of new field

 

The fields in ALV are populated in class CL_BUPA_DIALOG_SEARCHER in methods GET_TABLE_LINES and GET_HEADER_INFORMATION.

Both use the method READ_DESCRIPTION and READ_EXT_DESCRIPTION where all data for a line being processed is available – they are defined as local class of the global class.

Create implicit enhancement at the end of these 2 methods:

Enhancement%20at%20the%20end%20of%20READ_DESCRIPTION

Enhancement at the end of READ_DESCRIPTION

Add code to populate your new fields (hint: here is just a simple example – you can put it into a separate class):

*----------------------------------------------------------------------*
*  SAP Blog: How to populate additional fields in BP Result            *
*----------------------------------------------------------------------*
      SELECT SINGLE but000~bpkind, adrc~COUNTRY, adrc~street FROM adrc
      JOIN but020 ON but020~addrnumber = adrc~addrnumber
      JOIN but000 ON but020~partner = but000~partner
      WHERE but000~partner_guid = @iv_partner_guid
      AND adrc~nation = @space
      INTO CORRESPONDING FIELDS OF @es_tabline.

      SELECT SINGLE customer INTO @es_tabline-kunnr FROM cvi_cust_link WHERE partner_guid = @iv_partner_guid.
      IF sy-subrc <> 0.
        CLEAR es_tabline-kunnr.
      ENDIF.
      SELECT SINGLE vendor INTO @es_tabline-lifnr FROM cvi_vend_link WHERE partner_guid = @iv_partner_guid.
      IF sy-subrc <> 0.
        CLEAR es_tabline-lifnr.
      ENDIF.

You may wonder why you have to clear the es_tabline-lifnr and kunnr fields, when selection is empty – the reason for that is that SAP copies the value from previous search.

 

3.Refresh ALV buffen

 

To see new fields ALV buffer needs to be refreshed using report BALVBUFDEL.

 

See the result in BP search

After doing all abovementioned steps just go to BP transaction and open the search option and search for some business partners. The new fields are automatically displayed:

New%20fields%20in%20BP%20search%20result

New fields in BP search result

 

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x