cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with BDT Enhancement for custom fields in BUT000 in BP Tcode

Ehtram
Discoverer
0 Likes
1,399

The requirement is to add two new custom fields in BP Transaction in a new tab. We have followed BDT approach, and all the customizations are done accordingly as per below blog:-

SAP S/4HANA Business Partner - Field Enhancement - SAP Community

The custom tab along with fields are now visible and are editable in Change/Create mode as well.

However, when we are trying to change the value in these two custom fields during change/create process in BP Tcode, the data is not getting saved at both the BP screen level and the table level (BUT000).

Step 1:

Open a BP in BP Tcode and check Additional Data tab.

Ehtram_0-1747737623928.jpeg 

Fields are blank currently.

2- Go to Change mode and enter some values:

Ehtram_1-1747737653612.png 

3- After pressing save, these values are not getting saved in BUT000 table:

Ehtram_2-1747737690141.png

My PAI Code:

FUNCTION zmdg_bup01_pai.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"----------------------------------------------------------------------
*
DATA: false TYPE boole-boole VALUE ' ',

lt_but000 TYPE TABLE OF but000,

table_name_but000 TYPE fsbp_table_name VALUE 'BUT000'.

 

FIELD-SYMBOLS: <but000> LIKE LINE OF lt_but000.

 

CHECK cvi_bdt_adapter=>is_direct_input_active( ) = false.

* step 1: update xo memory from technical screen structure

cvi_bdt_adapter=>get_current_bp_data(

EXPORTING

i_table_name = table_name_but000

IMPORTING

e_data_table = lt_but000[]

).

 

IF lt_but000[] IS INITIAL.

IF gs_but000 IS NOT INITIAL.

gs_but000-partner = cvi_bdt_adapter=>get_current_bp( ).

APPEND gs_but000 TO lt_but000.

ENDIF.

ELSE.

READ TABLE lt_but000 ASSIGNING <but000> INDEX 1.

<but000>-zownership = gs_but000-zownership.
<but000>-zclass = gs_but000-zclass.

ENDIF.

 

cvi_bdt_adapter=>data_pai(

i_table_name = table_name_but000

i_data_new = lt_but000[]

i_validate = false

).

* step 2: check fields

CHECK cvi_bdt_adapter=>get_activity( ) <> cvi_bdt_adapter=>activity_display.

ENDFUNCTION.



Ehtram_2-1747737244367.jpeg

Ehtram_1-1747737244366.jpeg

Ehtram_0-1747737244365.jpeg

Accepted Solutions (0)

Answers (1)

Answers (1)

Ehtram
Discoverer
0 Likes

This is resolved by using FM BUP_BUPA_BUT000_COLLECT in the above code instead of PAI.