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

Creating sales contract on different clients using BAPI

Former Member
0 Likes
347

Hello,

The server has two client "400" and "801".

I am able to create a "Sales Contract " from BAPI in same client,

I have a situation  in which BAPI for "Sales Contract" is executed on client 400 and "Sales Contract" needs to be created in Client '801' 

Regards,

Sarthak

Hello,

The server has two client "400" and "801".

I am able to create a "Sales Contract " from BAPI in same client,

I have a situation  in which BAPI for "Sales Contract" is executed on client 400 and "Sales Contract" needs to be created in Client '801' 

Regards,

Sarthak

1 REPLY 1
Read only

basarozgur_kahraman
Contributor
0 Likes
311

Hi Sarthak,

You can define Client 801(ex:CLNT801) in Abap Connections of SM59,

and call BAPI for this destination in client 400.

CALL FUNCTION 'BAPI_SALES_CONTARCT_?????' DESTINATION 'CLNT801'.

if sy-subrc = 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' DESTINATION 'CLNT801'.

else.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK' DESTINATION 'CLNT801'.

endif.