Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Bapi return

Former Member
0 Kudos

Hi all,

I'd like to ask the difference between export types BAPIRETURN, BAPIRET1, BAPIRET2 in the BAPI if I want to return a return code to a VB program.

Which type should I use?



Former Member
0 Kudos

These were used in the RFC to handle the exceptions. suppose i am having 3 tables in my FM(RFC) if any one of the tables is empty or all the tables were empty then error message is populated thru the itab_message(bapiret2 or bapiret1 or bapireturn).

Regarding the return code i think these structures were not used.

Former Member
0 Kudos

Hi Macy,

As such all these are the return types used in BAPi's to give out the messages.

It depends on the BAPi you are using.

There might be a Return table of type BAPIRETURN as well an export structure of type BAPIRET2/BAPIRET1 OR vice-versa.

It only depends on you what kind of messages are you looking for (detailed or too the point)

The Export Structure will have too the point result i.e. BAPI successful or failed, whereas the RETURN TABLES parameter will give you all the details (i.e. why the BAPI Failed...)

BAPIRET2 & BAPIRET1 provides you with some additional data about the success or failure message generated.

Hope it helps...


pls. reward appropriate points

0 Kudos


Actually I just want my BAPI to return an integer to indicate success or failure.

e.g. return like BAPIRETURN

in the BAPI, I set return-code = 4 if it fails.

But the vb .net connector says the type BAPIRETURN has not defined.

I wonder what's wrong are there.

0 Kudos


you need to declare it first as type bapireturn and set the returncode as 4.



Former Member
0 Kudos

All the mentioned are the structures which are used to get the return values/msgs from the BAPI.

Only the structure is going to difer.u can make use of anything..again it depends on the BAPI which u are going to use



Message was edited by: Eswar Kanakanti