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

Error messages from BAPI

Former Member
0 Likes
834

Hi All,I am using BAPI,BAPI_PO_CREATE1 to create PO and if there are any errors i am capturing them on a ALV Report.If there are 5 Error messages in bapiret2 then my repot is showing the message 5 times with all the data like preq number,preq item number,i want to see empty in the report for preq number and preq item and only 4 error message should be there int he next 4 lines.

Please help me

Thanks

Shakeer

4 REPLIES 4
Read only

Former Member
0 Likes
690

Hi Shakeer,

It will come depends on your coding, use control break statements to achieve that.

Thanks & Regards,

Faheem.

Read only

0 Likes
690

Hi.I have already used AT NEW,but it is not working.i am looping for an internal table and then giving structure for BAPI .afer looing i am giving as at new..but it is not working ..is there any thing we have to give?

Read only

0 Likes
690

In debugging check bapiret2 table and see the error messages, if 5 different messages then there is a problem in your code.

Read only

Former Member
0 Likes
690

Hi Shakeer,

Be sure that when you use the AT NEW statement that all the fields in the internal table are the same which are before the field you want to group by (PREQ).

Since you are using the BAPIRET2 type, different errors for the same PREQ will show the PREQ no. for all the items. Only if the errors are of the same type for the same PREQ no. once.

Now I would imagine that there can only be 1 error per PREQ/ITEM and therefore I do not see really how this could work. Only maybe in case you also want to show the warnings /Info message.

Also in your example, I would imagine that the PREQ no. would be different for the 5 errors and therefore you will not be able to group them anyway.

Of course it is possible that I misunderstood what you are trying to accomplish.

Kind regards,

Robert