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: 

BAPI_CONTRACT_CREATE

Former Member
0 Kudos

Hello Gurus,

This is the requirement-----I have created a flat file.From this file data is passed to BAPI (bapi_contract_create). When i am passing the data it is not creating a contract .

Thanks,

Indra Karan.C

1 ACCEPTED SOLUTION

Clemenss
Active Contributor
0 Kudos

Hi indrakaran reddy,

analyse the errors returned. A BAPI will run through the same logic as the online transaction. That means if you get errors calling the function and you do noz get those errors in online transaction, then parameters are not the same.

The Order does not get created in case of any type E errors because they would take you back to a acreen in online mode.

Regards,

Clemens

7 REPLIES 7

Former Member
0 Kudos

First create data manually in transaction ,if it is creating the record then it would be problem at coding.

You need to use BAPI_TRANSACTION_COMMIT after BAPI_CONTRACT_CREATE FM

Reward points if helpful

Thanks

Seshu

0 Kudos

Hello Seshu,

In transaction ME31k the contract has been created. But when i am passing the same data to the BAPI (bapi_contract_create). It is showing some errors in the return parameter.

I have even used BAPI_TRANSACTION_COMMIT after the FM BAPI(bapi_contract_create).

Thanks,

Indra Karan.C

0 Kudos

I used BAPI_CONTRACT_CREATE FM and i had some errors ,eventhough it created the record.

contracts are being created despite being this error. You may also get "Vendor address not found" error as well...but contracts would be created!

I have searched in service.sap.com and nothing found .

if not then try to use alternative method .

Thanks

Seshu

0 Kudos

Hello Seshu,

Even for me record was created. But getting invalid document number # 2. I am trying to open the document number # 2 in transaction.It is said that it doesn't exist.I have even checked in the table ekko. But it doesnt exist. Can you give me a solution.

Thanks,

Indra Karan.C

Clemenss
Active Contributor
0 Kudos

Hi indrakaran reddy,

analyse the errors returned. A BAPI will run through the same logic as the online transaction. That means if you get errors calling the function and you do noz get those errors in online transaction, then parameters are not the same.

The Order does not get created in case of any type E errors because they would take you back to a acreen in online mode.

Regards,

Clemens

Former Member
0 Kudos

Hi IndraKaran,

Please let us know what data ur getting from file and where ur passing to the BAPI structures.

Generally, when creating contract using BAPI_CONTRACT_CREATE there will be many issues which may come across header, item, validity, conditions and condition scales.

So if any of the structures are filled with ur data and correcponding structures X could be any issue.

Please get us more information that we can analyse.

Thanks & Regards,

Goldie

gurunathkumar_dadamu
Active Contributor
0 Kudos

Hi Indrakaran reddy,

Check the below link your problem will solve

http://wiki.sdn.sap.com/wiki/display/Snippets/Create+Sales+Contract+Order+Using+BAPI_CONTRACT_CREATE...

Regards,

Gurunath