‎2010 Feb 08 12:10 PM
Hi Friends,
I requirement is to change partner no. at headerlevel in a contract. I have used BAPI_CUSTOMERCONTRACT_CHANGE.
I have passed all the required parameters and showing success message as (ex., Fixed Bid Contract 2056 has been saved) in
debugging,after execution it is giving an error as 'update was terminated' (in ST22 this was the error
SAPSQL_ARRAY_INSERT_DUPREC) . I am just updating the existing contract.
Please help me to resolve my issue.........
Thanks in advance,
Jayasree.
‎2010 Feb 08 12:23 PM
Hi,
For changing the parner details,you need to fill the table partnerchanges with the update flg as "U' and you dont need to fill the table partners.
\
check out the following sample for filling up partnerchnages table.
LOOP AT partnerchanges.
CALL FUNCTION 'CONVERSION_EXIT_PARVW_INPUT'
EXPORTING
input = partnerchanges-partn_role
IMPORTING
output = partnerchanges-partn_role.
partnerchanges-updateflag = 'U'.
MODIFY partnerchanges TRANSPORTING updateflag.
ENDIF.
ENDLOOP.
CALL FUNCTION 'BAPI_CUSTOMERCONTRACT_CHANGE'
EXPORTING
salesdocument = salesdocument
contract_header_in = contract_header_in
contract_header_inx = contract_header_inx
logic_switch = logic_switch
TABLES
return = return
contract_item_in = contract_item_in
contract_item_inx = contract_item_inx
partnerchanges = partnerchanges
conditions_in = conditions_in
conditions_inx = conditions_inx
contract_text = contract_text.
Thanks,
Vigneswaran.
‎2010 Feb 08 12:23 PM
Hi,
For changing the parner details,you need to fill the table partnerchanges with the update flg as "U' and you dont need to fill the table partners.
\
check out the following sample for filling up partnerchnages table.
LOOP AT partnerchanges.
CALL FUNCTION 'CONVERSION_EXIT_PARVW_INPUT'
EXPORTING
input = partnerchanges-partn_role
IMPORTING
output = partnerchanges-partn_role.
partnerchanges-updateflag = 'U'.
MODIFY partnerchanges TRANSPORTING updateflag.
ENDIF.
ENDLOOP.
CALL FUNCTION 'BAPI_CUSTOMERCONTRACT_CHANGE'
EXPORTING
salesdocument = salesdocument
contract_header_in = contract_header_in
contract_header_inx = contract_header_inx
logic_switch = logic_switch
TABLES
return = return
contract_item_in = contract_item_in
contract_item_inx = contract_item_inx
partnerchanges = partnerchanges
conditions_in = conditions_in
conditions_inx = conditions_inx
contract_text = contract_text.
Thanks,
Vigneswaran.
‎2010 Feb 08 12:35 PM
Hi Vigneswaran,
what is the use of FM CONVERSION_EXIT_PARVW_INPUT here??
do we need to pass the parameters P_NUMB_OLD and P_NUMB_NEW in partnerchnages table??
Regards,
Jayasree.
‎2010 Feb 08 1:11 PM
Yes,You need to pass New partner number(P_NUMB_NEW) mandatory.But not necessary to populate old partner number (P_NUMB_OLD).
the function module is used to convert the external role into intenal partner role.
Eg: "BP" will hav to be passed as "RE" to the BAPI.
Thanks,
Vigneswaran S