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

PO creation using text file

Former Member
0 Likes
533

Hi All,

I have program which takes input text file and create PO in SAP. Program is using standard SAP BAPI to create PO.

This is working fine. But i have one program during errors.

If text file contains 50 line items and suppose line 12 is incorrect. Incorrect means PIR,source list etc not correct or material is invalid etc etc. Then program(bapi) throw error and PO creation stops and not continue with remaining lines. That is also normal process when create PO via ME21N.

User want to show errors for all invalid rows at the same. Basically they want PO VALIDATION step where they want to see errors of all line items. So that they can remove from text file. ANy idea how to do this?

Thanks,

Yogesh

1 REPLY 1
Read only

Former Member
0 Likes
394

Yogesh,

I don't understand your problem because I believe that BAPI (even ME21n) always throws all the errors for the input data in return table. So, if you have 2 problematic items in one purchase order, suppose 12 and 42, both containing invalid materials, BAPI will contain error message for both the records and not only 1 material as error.

Similarly, if you click MESSAGES button in ME21n, you will get all the errors for all the items in the list and not 1 only, do check.

I suppose the issue with your program must be the error handling of BAPI is not done well, and you are exiting the program showing only First return message or something like that. Do output all the error messages of the Return table and you should be able to see all the errors.

Even if your File contains data of multiple POs, you should be able to check all the POs with all the items in a single program run.

Let me know if you have any concerns or you need any help.

BR,

Diwakar