Application Development 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: 

Create VA41 contract from ABAP code

former_member246786
Participant
0 Kudos

Hi,

I'm using batch input programs to create contract from the VA41 transaction.

Because there is some changes in specifications, it become difficult to continue this way ( using batch input). So my question is : is there FM or BAPIs I can use to create the same king of contract ?

If it exists, do you please have exemple of source code to show me the different internal tables that need to be filled ?

Regards,

MOrgan

4 REPLIES 4

Former Member
0 Kudos

Hi

U can try to use the BAPI_CONTRACT_CREATEFROMDATA or directly the fm SD_SALESDOCUMENT_CREATE (this fm is called by all BAPIs create sales document.

Max

Former Member
0 Kudos

Hi

use the BAPI's

BAPI_CONTRACT_CREATEFROMDATA

BAPI_CUSTOMERCONTRACT_CHANGE

reward if useful

regards,

Anji

former_member246786
Participant
0 Kudos

Thx,

I tried both SD_SALESDOCUMENT_CREATE and the bapi, each time,

I have the following error message :

please fill the sold to party or the ship-to party.

When I use the VA41 transaction, I fill in sold-to-party field and this correspond to a kunnr type.

So I tried by adding a line in SALES_PARTNER table with the kunnr value but It doesn't work.

Would you please tell wath fields I need to fill in to avoid this error message ?

0 Kudos

Ok I found exactly what the problem was : I used to fill in the partners table but it needs to specify partner role. That's all, thx all for help