‎2007 Jul 20 7:29 PM
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
‎2007 Jul 20 7:33 PM
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
‎2007 Jul 20 7:33 PM
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
‎2007 Jul 20 7:45 PM
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.
‎2007 Jul 20 8:18 PM
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
‎2007 Jul 20 7:57 PM
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