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

Does BAPI call the validations defined for standard transactions ?

Former Member
0 Likes
2,221

Hi Experts,

Can anyone tell me if BAPI handles the validations defined for standard transactions ? I have a standard transaction KB15N. Validation defined for a field works fine when run thorugh the transaction. But if same data is updated using BAPI , validations are not getting called and wrong data is updated in the system.

Could you please confirm if BAPI handles validations ? If yes, how to take care of it ?

Best Regards,

V joshi

1 ACCEPTED SOLUTION
Read only

ThomasZloch
Active Contributor
0 Likes
1,273

In general, BAPI's should call the same validations like the standard transactions, e.g. BAPI_ACC_DOCUMENT_POST runs through the same validations like posting via FB01.

BAPI's are designed to be called from outside the SAP system as well, so it would be pretty bad if such a loophole would exist.

Check your prerequisites of the validation, maybe you check for a transaction code which is different if called from the BAPI.

Also try tracing the execution of that BAPI (SE30 or better SAT, if available) and see which routines are being called.

Thomas

5 REPLIES 5
Read only

ThomasZloch
Active Contributor
0 Likes
1,274

In general, BAPI's should call the same validations like the standard transactions, e.g. BAPI_ACC_DOCUMENT_POST runs through the same validations like posting via FB01.

BAPI's are designed to be called from outside the SAP system as well, so it would be pretty bad if such a loophole would exist.

Check your prerequisites of the validation, maybe you check for a transaction code which is different if called from the BAPI.

Also try tracing the execution of that BAPI (SE30 or better SAT, if available) and see which routines are being called.

Thomas

Read only

0 Likes
1,273

Hi Thomas,

Thanks for your quick reply.

I have following condition in the prerequsite of validation

Prerequsite : Transaction code = 'KB15N'

check : Sr cost element > '90000000' AND Sr cost element < '9ZZZZZZZ'

I am using BAPI 'BAPI_ACC_MANUAL_ALLOC_POST' for posting.

Do i need to modify the pre-requisite condition ? Kindly guide.

Regards,

V Joshi

Read only

0 Likes
1,273

You have to find out the correct prerequisites yourself. Obviously SY-TCODE is not KB15N when called via BAPI.

Assuming it works the same as the FI validations: activate the expert trace inside the validation maintenance (must be in display mode), then processing will stop right there and you can find out the current values of the SY-fields (and other field values passed to the validation) in your debugger window.

Thomas

Read only

Former Member
0 Likes
1,273

Hi,

Validations of fields depends upon user.

BAPI's will validate some of the fields. For example, if the type of the field is 'date' and you are sending a string, it 'll throw a error message and if the plant or some master data didnt present in the system, it throws the error message.

But in the case of fields which uses conversion exits, you 've to handle those in the report itself.

If this doesnt meet your requirement , provide more information about what BAPI are you using and data passed.

Read only

madhu_vadlamani
Active Contributor
0 Likes
1,273

Hi ,

As our Thomas told it will validate same like how it is done in GUI.

Regards,

Madhu.

Edited by: madhurao123 on Feb 22, 2011 6:19 AM