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

BAPI_CONTRACT_CREATEFROMDATA help needed

Former Member
0 Likes
988

Hi all,

A program I have created is required to create multiple contracts during a typical run. In our QA system this works perfectly. However, in our production system, it is able to create the first contract but every contract after that gets an abort message:

"New object number is temporary"

Is there a configuration change that needs to be made from QA to Production? If so, what do I need to do to fix this?

For example, if I have ten contracts numbered 1 through 10 and we process them, number 1 will be created. However, contracts 2 through 10 will be aborted with the same abort message. Again, this works perfectly in QA but not in Production.

Thanks in advance.

8 REPLIES 8
Read only

Former Member
0 Likes
851

Hi John

As per the error message, with my analysis i guess it is related to STATUS management. Please check if everything is ok on the same.

Am not sure but if possible please try by giving a wait for one or 2 secs after the COMMIT WORK for each document posted as another alternative.

Kind Regards

Eswar

Read only

0 Likes
851

Eswar,

Thank you for your help. Can you please clarify what you mean regarding STATUS management? What do you mean by this? How can I see if everything is ok? Unfortunately I am unfamiliar with this.

Thanks!

Read only

0 Likes
851

Dear John

Please check if any status profile is assigned to the order type you are using. You can check the same from table TVAK, field STSMA.

I guess the status profile is associated and using internal number range for the order type.

In this case before the order is actually saved the object number is temporarily generated. To check the same, try creating an order online and before actualling saving the document. Use menupath: Goto->Header->Status.

Click on the pushbutton "Object Status". Here you will find the object number filled with a temporary generated number which will be later replaced by the actual number with the combination of 'VB' and Order number.

Note that for header the status profile is assigned to Order Type and for items it will assigned to Item Categories. In your case it might be either at Header Level or at Item Level or both.

Also please check in the user-exits if there are any manipulations for the same.

Hope the above info can give you some ways to explore on the same.

Kind Regards

Eswar

Read only

0 Likes
851

TVAK-STSMA is blank on our systems -- DEV, QA and PRD. I am still looking into this issue but if anyone has any more suggestions, it would be greatly appreciated.

Thanks in advance.

Read only

0 Likes
851

Adding a couple of second wait in between processing of records didn't fix our problem. I attempted to debug and this is what we get:

When we process multiple records, the first one always goes through. The second record gets an Abort, and everything after that is also aborted.

If we were to print out all the records and their error messages it would look like this:

1. Success

2. Error determining posting period (info structure S008, variant MF, RC 3)

3. New object number is temporary

4. New object number is temporary

5. New object number is temporary ... and so on.

PLEASE, any ideas or suggestions would be greatly appreciated! Many thanks in advance. Points will be awarded.

Read only

Former Member
0 Likes
851

This problem is still occurring. Can anyone please clarify Eswars' feedback?

Thanks!

Read only

0 Likes
851

Hi

Which is the numeber and class of the message?

Max

Read only

Former Member
0 Likes
851

Hello,

See the BAPI return structure and see the message no,class. Normally return structure will be information what exactly wrong.

********Poorna******