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

bapi return

Former Member
0 Likes
832

i am using a bapi in a loop . For every iteration of the loop 2 messages are returned . one is 'I' and the other is 'E' . I am passing two tables to the bapi. I am not sure of how to pass the input to the bapi but is it possible to get two messages for one bapi call or am i not passing appropriate data to the bapi

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
724

Sure, you can have alot more than two messages coming back from the BAPI, in this case, the transaction probably hit the type I message first, and continue processing and then hit the TYPE E. You will get all of the messages from the transaction during processing of the BAPI. All information, warnings, success, and error message.

Regards,

Rich Heilman

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
725

Sure, you can have alot more than two messages coming back from the BAPI, in this case, the transaction probably hit the type I message first, and continue processing and then hit the TYPE E. You will get all of the messages from the transaction during processing of the BAPI. All information, warnings, success, and error message.

Regards,

Rich Heilman

Read only

0 Likes
724

thanks for your prompt reply . I am getting an 'E' type first and then an 'I' type . I have to call a FM if there is no error returned from bapi how do i do that ? I appreciate your help.

Read only

0 Likes
724

hi,

the return table from the bapi has type of error in it..

data : it_return like BAPIRET2.

after the bapi call it_return will have all the messages.

then say

read table it_return with key type eq 'E'.

if sy-subrc eq 0..

your logic.

endif

thanks

Mahesh

Read only

former_member404244
Active Contributor
0 Likes
724

Hi,

u will get the messages in the return structure of the BAPI .as u r calling another FM basing on the return parameter of the bapi.Try like this.

IF I_BAPIRETURN IS INITIAL..

CALL FM <FMNAME>.

ENDIF.

As ur getting TYPE 'E' in the bapi,so please check the data ur passing and check why u r getting the error message..Now make the bapi return to be messages free and then call ur FM.

Regards,

Nagaraj