‎2010 Sep 23 7:00 AM
Hi,
I have a program where I am creating a sales order using call transaction.
And after the call transaction, i am using a select statement to select the newly created sales order for validation purpose.
Before using this select statement do i need to use the COMMIT STATEMENT. Please suggest.
Thanks and Regards,
Phani kumar
‎2010 Sep 23 7:54 AM
Hi,
After call transaction va01
use the following code instead of select statement to get the newly created sales order.
if sy-subrc = 0.
GET PARAMETER ID 'AUN' FIELD w_new_sales_order_no.
endif.
w_new_sales_order_no will give you the newly created sales order no.
Regards,
Usha.
‎2010 Sep 23 7:03 AM
Hello Phani,
As per my understanding, you should not be needing COMMIT WORK after a Call transaction.
However, u should make the system wait for 1-2 seconds before to select the data from DB. This is because sometimes, the DB updates and Lock release mechanism takes some time and in the meantime, your select will not return you any data.
Hope this helps.
Regards,
Himanshu
‎2010 Sep 23 7:04 AM
if you are using BDC recording,you dont need to use "commit Work".
‎2010 Sep 23 7:21 AM
Hi ,
Problem in ur case can be commit work is executed and immediately select will try to fetch the newly created data but that time cannot gurantee you that the newly created sales orders are present after commit work into table VBAK.
In call transaction the drawback is we cannot dont have a seesion log .
In Session method u can try this ..
Session log is generated after the processing
A code needs to be written fetching hte QID by passing session name
Now whether this session is processed (s) or error (E) or not at all run needs to be identified based on qstate of that field for that QID .
Use a while statement to check the status of the QID .
Table APQI
QID
QSTATE
If Qstate is S then it is processed => ur database is loaded with values .
So your program will sleep for some time till this qstate is processed and based on which u need to do a select for qstate S as success.
You can make a distinction of qstate from session log and checking the qstate of the three states for a start to proceed..
Br,
Vijay.
‎2010 Sep 23 7:36 AM
Hi,
If you are using CALL TRANSACTION method then you dont need to use COMMIT WORK statement.
regards,
sakshi
‎2014 Nov 06 9:40 AM
Hello Sakshi,
I have created a BDC a program for Transaction :OLI9BW where i need to pass commit explicitly in BDC param
Structure : CTU_PARAMS
Short Description : Parameter string for runtime of CALL TRANSACTION USING
If it's not required then why SAP has provided commit param in CTU_PARAMS
Thanks,
Anoop Singh Bhandari
‎2010 Sep 23 7:39 AM
Hi ,
Actually the system automatically executes the commit immediately before and after CALL TRANSACTION USING statement.
Regards,
‎2010 Sep 23 7:54 AM
Hi,
After call transaction va01
use the following code instead of select statement to get the newly created sales order.
if sy-subrc = 0.
GET PARAMETER ID 'AUN' FIELD w_new_sales_order_no.
endif.
w_new_sales_order_no will give you the newly created sales order no.
Regards,
Usha.
‎2010 Sep 23 8:10 AM
Hi Phani,
You can try WAIT UP TO (n) SECONDS command after your BDC if it works for you.
Even after this you are not getting the desired result you can try for the do loop with exit statement to make sure
that you are getting the details of the successfully created sales order
Do.
select single vbeln from vbak into lv_vbeln where vbeln = ( take the recently created sales order no)
IF ( sy-subrc = 0 ).
EXIT. " leave DO loop
ELSE.
WAIT UP TO 1 SECONDS.
ENDIF.
enddo.
But be careful with this it may become infinte loop so you can also give the maximum time limit for this do loop.
Is there any specific issue for making BDC for Sales order, you can use the BAPI_SALESORDER_CREATEFROMDAT2 or the FM SD_SALESDOCUMENT_CREATE for the Sales order creation.
Thanks,
Pawan
Edited by: PawanG on Sep 23, 2010 9:11 AM
‎2010 Sep 23 8:58 AM
>
> Before using this select statement do i need to use the COMMIT STATEMENT. Please suggest.
Hello Phani,
As already mentioned by other you don't need an explicit COMMIT WORK after the CALL TRANSACTION.
In your case you should set the BDC Update Mode to 'S' (synchronous update equivalent to COMMIT WORK AND WAIT). [http://help.sap.com/abapdocu_70/en/ABAPCALL_TRANSACTION_BDC_OPTIONS.htm#&ABAP_ADDITION_3@3@]
BR,
Suhas
‎2010 Sep 23 9:00 AM
to avoid this problem and further to avoid coding like:
WAIT UP TO X SECONDS.
you could use a dirty assign on SAPMV45A XVBAK and XVBAP.