2009 Dec 14 4:54 AM
Hi,
In my program I have 2 bapi.
BAPI_PO_CREATE and BAPI_GOODSMVT_CREATE.
When test run in selection screen is flagged, my program will execute TRANSACTION_ABORT to reverse the PO.
May I know how to do test run for BAPI_GOODSMVT_CREATE? There is a TESTRUN parameter in BAPI_GOODSMVT_CREATE but how to do test run for both BAPI_PO_CREATE and BAPI_GOODSMVT_CREATE one after another together? I need to do test run for both BAPI. If not, there may have error in GR but PO already been created.
Appreciate the advice.
Thanks
Rgds
2009 Dec 14 5:14 AM
Hi,
I think it is difficult. Even if you use BAPI_PO_CREATE1 with the test option, you will need PO number and line item number to create the GR. And as far I know, you will not get the PO number unless you do commit work.
And once you commit, you will not be able to rollback the PO if you encounter an error in your GR creation.
Hi,
In my program I have 2 bapi.
BAPI_PO_CREATE and BAPI_GOODSMVT_CREATE.
When test run in selection screen is flagged, my program will execute TRANSACTION_ABORT to reverse the PO.
May I know how to do test run for BAPI_GOODSMVT_CREATE? There is a TESTRUN parameter in BAPI_GOODSMVT_CREATE but how to do test run for both BAPI_PO_CREATE and BAPI_GOODSMVT_CREATE one after another together? I need to do test run for both BAPI. If not, there may have error in GR but PO already been created.
Appreciate the advice.
Thanks
Rgds
2009 Dec 14 5:05 AM
se37 u can use the following menu path way :
function module > test> test sequence
2009 Dec 14 5:08 AM
hi,
in every/almost BAPI's, having testrun parametr. U have to pass X to the testrun .thats all..then bapi returns exceptions into RETURN internal Tables. then check the internal table for errors. testrun or exceute bapi both r same. but in testrun,this will not update anything....i mean further program....
thnks
Yerukala Setty
2009 Dec 14 5:10 AM
Hi,
unfortunately, not all BAPIs have the test run option. BAPI_PO_CREATE does not have it but BAPI_PO_CREATE1 has it. Have you tried to use BAPI_PO_CREATE1 instead of BAPI_PO_CREATE?
Cheers
2009 Dec 14 5:10 AM
You need to use BAPI_PO_CREATE1 instead of BAPI_PO_CREATE . BAPI_PO_CREATE1 have test run option
a®
2009 Dec 14 5:14 AM
Hi,
I think it is difficult. Even if you use BAPI_PO_CREATE1 with the test option, you will need PO number and line item number to create the GR. And as far I know, you will not get the PO number unless you do commit work.
And once you commit, you will not be able to rollback the PO if you encounter an error in your GR creation.
2009 Dec 14 6:05 AM
Hi Abhijit,
What you said is right. If PO not committed, the PO not able to use in BAPI_GOODSMVT_CREATE.
I do not know why sap design so.
Is there any way that I can overcome this?
Thanks alot for all have replied. point given.
Need advice further.
thanks
rgds
2009 Dec 14 6:13 AM
you need to follow this seq as I said before:
BAPI_PO_CREATE1
bapi_transaction_commit
BAPI_GOODSMVT_CREATE
bapi_transaction_commit
2009 Dec 14 6:23 AM
Hi,
1. There is no way you can overcome this.
2. SAP designed it in this way because a GR can be created in reference to a PO and a person who creates a PO should not ethically GR it. Just to help check the frauds.
2009 Dec 14 11:50 AM
Hi J@Y,
I tested using bapi_po_create1 with test run, the bapi cannot return the PO number though no error. This has stopped me from doing the test run of BAPI_GOODSMVT_CREATE as it returns error Enter Purchase Order.
What abhijit said is correct. only actual run can pass in po number to BAPI_GOODSMVT_CREATE.
seems like this is sap problem.
anyone has such problem?
rgds
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |