11-10-2017 11:20 AM
Hi Experts,
I have one requirement where i have to add multiple plants to a contract using its PURCHASINGDOCUMENT number. I am trying to use bapi BAPI_CONTRACT_CHANGE but it only adds first plant from the table IT_ITEM_COND_VALIDITY however there are 3 plants in the table.
Table data :-
Item No Serial No Plant Valid_from Valid_to
00010 0190847564 1111 20170101 20181101
00010 0190847564 1512 20170101 20181101
00010 0190847564 1113 20170101 20181101
00020 0190847565 1111 20170101 20181101
00020 0190847565 1512 20170101 20181101
00020 0190847565 1113 20170101 20181101
Note: I am trying to add two line items
Function call :-
CALL FUNCTION 'BAPI_CONTRACT_CHANGE'
EXPORTING
PURCHASINGDOCUMENT = PO_NUMBER
TABLES
ITEM_COND_VALIDITY = IT_ITEM_COND_VALIDITY
ITEM_COND_VALIDITYX = IT_ITEM_COND_VALIDITYX
ITEM_CONDITION = IT_ITEM_CONDITION
ITEM_CONDITIONX = IT_ITEM_CONDITIONX
RETURN = IT_RETURN .
this adds only first plant that is 1113 after execution the plant codes in table changes to 1113
Please suggest.
11-10-2017 7:09 PM
I don't have the system to completely help you out. Are there any other fields in IT_ITEM_COND_VALIDITY? I look at your data, and think that if you gave that to me and told me to process them one at a time - I'd update each one over and over again. They have the exact same data except for plant. Is there another key in the IT_ITEM_COND_VALIDITY that is missing? It might even be a sequential key - just something to make each line different.
Anyway - this is a comment and not an answer, because these are just some thoughts - not really an answer.
Michelle
11-10-2017 7:16 PM
Another thought - isn't the line item associated with only one plant?
11-13-2017 10:22 AM
Thanks Michelle,
I took the serial number unique and now the program is working fine.
Once again thank you........