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 creating Sales Order Through BAPI

Former Member
0 Likes
1,485

Hi Friends,

i am creating a RFC where i have to create sales order .

I am using bapi

BAPI_SALESORDER_CREATEFROMDAT2

for same and entering values to it.

I got the following return messages:

S V4 233 SALES_HEADER_IN has been processed successfully

S V4 233 SALES_ITEM_IN has been processed successfully

S V1 311 BDN Order 3112800903 has been saved

But when I go to transaction VA03 and enter the number i get the following error:

SD document 3112800903 is not in the database or has been archived

Can any one know how to resolve this error.I am also using BAPI_TRANSACTION_COMMIT with wait = 'X'.

Regards,

Santosh Alle

6 REPLIES 6
Read only

Former Member
0 Likes
1,124

when you call the FM BAPI_TRANSACTION_COMMIT just check the return code

Read only

former_member209217
Active Contributor
0 Likes
1,124

Hi,

Try to check the return message once.


SD document 3112800903 is not in the database or has been archived

You will get this message if the sales document is deleted from the database .The BAPI 'BAPI_SALESORDER_CHANGE' is used to delete salesorder.Check whether anyone has deleted it

Also, sometimes it may take few seconds to update the sales order in the database when using BAPI. Check the transaction after some time.

Regards,

Lakshman.

Edited by: Lakshman N on May 14, 2010 7:43 AM

Read only

0 Likes
1,124

HI Laxman,

As soon as the Sales Order is been generated I check in VA03. How can it be deleted.Its been arceived I guess..

Santosh

Read only

0 Likes
1,124

Santosh,

Have u coded for commit work after the bapi executed successfully

IF SY-SUBRC <> 0.
                CALL FUNCTION *'BAPI_TRANSACTION_COMMIT'*.
                MESSAGE 'Document Created TYPE 'I'.
                SET PF-STATUS 'ZBAPI1'.
              ELSE .
                MESSAGE 'Document contains Errors' TYPE 'E'.
  ENDIF.

Read only

0 Likes
1,124

Not sure whether its been deleted or archived.But check ,some program might be running behind this.

Regards,

Lakshman.

Edited by: Lakshman N on May 14, 2010 7:57 AM

Read only

0 Likes
1,124

found myself