‎2010 Sep 14 10:37 AM
We are using a BAPI for creating Invoice Documents.
It requires Validation Rules tobe provided for BAPI Fields.
Could you please advise do we need to Use BADI or Do we need to create Events for providing Validations.
How can Validation rules be provided for the BAPI Fields ?
‎2010 Sep 14 11:14 AM
either write ABAP code to validate fields before calling BAPI, or capture err messages returned by BAPI.
‎2010 Sep 15 7:19 AM
Hi,
You can write abap code in AT-SELECTION-SCREEN event for validating the fieldsbefore calling BAPI for invoice creation or capture error messages from BAPI into some internal table for error logging if you wish to proceed executing BAPI without validating intially.
Regards,
Vanitha P
‎2010 Sep 15 8:06 AM
Hi
it would be better to validate fields by writing abap code on at selection screen for validation instead of capturing err msgs.
Thanks!!
‎2010 Sep 15 8:11 AM
Hi,
This depends on how you are calling the BAPI if you are calling through some Z program you can validate in your program before passing values or catch error message after.
If your problem is you have written some validation in a BADI or EXITS in the t-code but that does not executes while creating Invoice document through BAPI then in that case instead of using BAPI use BDC.
Regards
Bikas