‎2006 Nov 20 5:32 AM
Hello All,
My requirement is to create an ARIBA PO thru BAPI_PO_CREATE1. IN order to successfully process an ARIBA PO, i need to check the gl account and cost center used. If the first two letter of the cost center is equal to 'BS', then I need to issue out an error message. I have successfully done the checking of the cost center via user exit ZXMEWU10. But my problem is, how do I prevent the creation of PO if there is an error message? It seems that the function module does not recognized that there is an error encountered and PO is still created.
Please advice.
Thanks,
Jim
‎2006 Nov 20 5:36 AM
Check for RETURN in tables parameters.Internal table which gets filled when error occurs.
If not return[] is initial.
BAPI Commit.
Else.
Exit.
Endif.
-Mohan.
***Reward if useful.
‎2006 Nov 20 5:41 AM
Hi Jim ,
BAPI will take care of Validations which comes while creation of PO, In ur case make use the point where SAP will calls this User Exit.BAPI will return message thru RETURN tables And u have to call COmmit work based on the return tables
like tghis.
<b> return = l_return.--> this is BAPI table entry
if l_return[] is initial.
call function 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
.
endif.</b>regards
Prabhu
‎2006 Nov 20 5:47 AM
Hello,
I checked the return table w_bapireturn[] and the error that I raised is not included there. Please advice on how to proceed.
Thanks,
Jim
‎2006 Nov 20 5:51 AM
Hi Jim,
Just check for the Internal table , if it is not initial and has some values then there is some error with the parameters you passed into that Function Module.
The return parameter is getting filled by SAP system itself, we cannot pass the error message into that.
Regards,
Mohan
‎2006 Nov 20 5:53 AM
hi
good
go through this l ink, i hope this ll help you to solve your problem
http://help.sap.com/saphelp_srm30/helpdata/en/0a/baf73a93ad9179e10000000a114084/content.htm
thanks
mrutyun^
‎2006 Nov 20 5:57 AM
HI Jim
With the info you have provided, i guess the code in the user-exit is not enabled or reached while processing via BAPI.
Please place a break-point in user-exit and check to re-confirm on the same.
If itz not reached, i guess you have to either change to a different exit or do the same validation while using the BAPI.
Kind Regards
Eswar
‎2006 Nov 20 6:01 AM
Hi Mohan,
The return internal table not only contains the error messages, but also some status or warning messages encountered by the system. What i can;t figure out is that i raised an error message but it was not recognized by the system.
Thanks,
Jim
‎2006 Nov 20 6:32 AM
Hi Jim,
Here, I would suggest the same which I said earlier as follows,
If not return[] is initial.
BAPI Commit.
Else.
here you put your error message ****
Endif.
Regards,
Mohan.