Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Changing customer fields in VBKD by standard BAPI

Former Member
0 Kudos

Hi everybody,

how can I change customer fields in table VBKD by using BAPI BAPI_CUSTOMERCONTRACT_CHANGE.

4 REPLIES 4

varma_narayana
Active Contributor
0 Kudos

Hi..

This is the Sample code. Change it as per ur need.

d_VBELN = '50000172'.

contract_header_inx-updateflag = 'U'.

CLEAR contract_items_in.

contract_items_in-itm_number = '100'.

contract_items_in-material = 'H51-YY019'.

contract_items_in-target_qty = '2'.

APPEND contract_items_in.

contract_items_inx-updateflag = 'U'.

contract_items_inx-itm_number = '100'.

contract_items_inx-material = 'X'.

contract_items_inx-target_qty = 'X'.

APPEND contract_items_inx.

CALL FUNCTION 'BAPI_CUSTOMERCONTRACT_CHANGE'

EXPORTING

SALESDOCUMENT = D_VBELN

contract_header_in = contract_header_in

contract_header_inx = contract_header_inx

TABLES

return = return

contract_item_in = contract_items_in

contract_item_inx = contract_items_inx.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

<b>Reward if Helpful.</b>

0 Kudos

I´m afraid that does not answer my question... sorry if it wasn´t clear.

The code you posted will change standard VBKD-fields, so far so good.

What I need to change are customer fields added to VBKD with an append.

0 Kudos

No ideas anyone?

0 Kudos

How to update VBKD customer fields:

- Extend structure VBKDKOM as VBKD was extended.

- Extend structure VBKDKOMX

- Extend structure BAPE_VBAK with VBKD customer fields

- Extend structure BAPE_VBAKX

- In bapi, use the table parameter extension_in with your VBKD customer fields filled in bape_vbak.