cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help in editing an existing Contract

former_member184390
Participant
0 Kudos

Hi,

I am trying to edit an existing contract in R/3. I am using the FM 'BAPICUSTOMERCONTRACT_CHANGE' but not able to achieve the desired result.

Actually, there is a contract existing with number say 1234, having 4 Items with Item numbers say 100,101,102,103. Now i am trying to update the item details of 100.

Initial values present for item 100 :- Material - H51-YY001, Quantity = 2

Now i am trying to update the Material to H49-XX014 and quantity to 5

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

Can some one tell me how to achieve this.

All helpful answers will b rewarded.

Regards,

Udaya

Accepted Solutions (1)

Accepted Solutions (1)

former_member184390
Participant
0 Kudos

Hi,

I missed out to specify the error message.

Err: Material : H51-EE001 is not defined for sales org.xxxx distr.chan.10,language EN

Which table should i refer and how to solve this.

Regards,

Udaya

Former Member
0 Kudos

Hi,

Code you have written for bapi function module is correct.

You can check material extended for sales org & dist.channel in MVKE table.

If you have not found this entry in the table then you have extend this material in the Material master data .

Thanks,

shyla

Former Member
0 Kudos

Hi Udaya,

You need to refer MVKE(Sales Data for Material) table to know for the sales organization and distribution channel.

If your material is aviable in the particular sales organization and distribution channgel, You will find a entry in this table; otherwise You need to create a material in this Sales organization and distribution channel (or) extend the material to this Sales organization and distribution channel.

Just create this material and re-run your BAPI.

Thanks,

Vinay

Answers (0)