2006 Aug 03 11:45 AM
Hello Friends,
While using BAPI_SALESORDER_CREATEFROMDAT2, I can create the BAPi successfully, but get the following error when I go to VA02 to edit the Order :
SD document 722000 is not in the database or has been archived
Message no. V1302
Diagnosis
This message is issued if no document header (VBAK) can be found
(discrepancies in R/3) for a sales requirement single record.
System Response
In the initial sales order supply, the following error message appears
'Document xxxxxx not available' V1 302.
Procedure
If an error occurs in initial data supply in APO, discrepancies have
occurred between the requirements and sales documents in R/3. This
discrepance can be corrected in R/3 using report SDRQCR21.
I can succesfully create an Order in VA01.
Any ideas why this is happening?
2006 Aug 03 11:53 AM
have you used the function module BAPI_TRANSACTION_COMIT
after that BAPI Call ?? if not, add this.
if sy-subrc = 0.
data : L_WAIT TYPE BAPITA-WAIT VALUE 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = L_WAIT.
endif.
regards
srikanth
Hello Friends,
While using BAPI_SALESORDER_CREATEFROMDAT2, I can create the BAPi successfully, but get the following error when I go to VA02 to edit the Order :
SD document 722000 is not in the database or has been archived
Message no. V1302
Diagnosis
This message is issued if no document header (VBAK) can be found
(discrepancies in R/3) for a sales requirement single record.
System Response
In the initial sales order supply, the following error message appears
'Document xxxxxx not available' V1 302.
Procedure
If an error occurs in initial data supply in APO, discrepancies have
occurred between the requirements and sales documents in R/3. This
discrepance can be corrected in R/3 using report SDRQCR21.
I can succesfully create an Order in VA01.
Any ideas why this is happening?
2006 Aug 03 11:50 AM
Hello,
Please check the following things..
1. Check whether inside the BAPI you are doing a
BAPI_TRANSACTION_COMIIT
2. Check the update termination logs on transactions SM21 and SM13.
3. If it is a update termination error please check whether there is a repition in the number ranges of the slaes document you are trying to generate.
Hope this will help.
Thanks,
Krishnakumar
2006 Aug 03 11:53 AM
2006 Aug 03 11:53 AM
have you used the function module BAPI_TRANSACTION_COMIT
after that BAPI Call ?? if not, add this.
if sy-subrc = 0.
data : L_WAIT TYPE BAPITA-WAIT VALUE 'X'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = L_WAIT.
endif.
regards
srikanth
2006 Aug 03 11:56 AM
Hi,
You need to commit after the BAPI is called. For testing this there is no need to create the ABAp program.
go to se37 press SHIFT+F8, it will allow you to call test sequence.
give here ur bapi to create sales order first and then call BAPI_TRANSACTION_COMMIT.
you can test both bapis one after other. and there will be entry in VBAK now.
Reward if useful.
Regds,
Agasti.
2006 Aug 03 11:57 AM
Hi
Call the FM 'BAPI_TRANSACTION_COMMIT' or use the COMMIT WORK statement after calling the Sales order BAPI
Regards
Beena
2006 Aug 03 12:29 PM
Thanks a lot for all your inputs.
What i fail to understand is why the BAPI was creating an order all these days, and why do I have to explicitly COMMIT WORK today?
In include LV45AU43, line 1861,
if not with_commit is initial.
commit work.
endif.
with_commit is initial when FM SD_SALES_DOCU_MAINTAIN is called. How can I set this flag when calling BAPI_SALESORDER_CREATEFROMDAT2 itself?
2006 Aug 03 12:37 PM
read the below documentation( i copied from the function module documentation).
Functionality
This method executes a COMMIT WORK command. It is required for transactions developed externally to the R/3 System that change data in the R/3 System via BAPI calls.
When you call BAPIs in your program that change data in the R/3 System, afterwards you must call this method to write the changes to the database.
regards
srikanth
2006 Aug 03 2:13 PM
Hi Srikanth,
So this means that if I run the BAPi from SE37, it should create an order in the database?