Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Field Validation

Former Member
0 Likes
727

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 ?

4 REPLIES 4
Read only

Former Member
0 Likes
665

either write ABAP code to validate fields before calling BAPI, or capture err messages returned by BAPI.

Read only

Former Member
0 Likes
665

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

Read only

Former Member
0 Likes
665

Hi

it would be better to validate fields by writing abap code on at selection screen for validation instead of capturing err msgs.

Thanks!!

Read only

Former Member
0 Likes
665

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