Application Development and Automation 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: 
Read only

Error while using BAPI_CUSTOMERCONTRACT_CHANGE

Former Member
0 Likes
999

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.

1 ACCEPTED SOLUTION
Read only

former_member491305
Active Contributor
0 Likes
718

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.

3 REPLIES 3
Read only

former_member491305
Active Contributor
0 Likes
719

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.

Read only

0 Likes
718

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.

Read only

0 Likes
718

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