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.
cancel
Showing results for 
Search instead for 
Did you mean: 

bapi

Former Member
0 Kudos

Hi

This is lalitha i have got an error while creating "BAPI"

error" BAPI &1: BAPI function module& 2 has no return parameter

and another error " not to creat methods.

while entering T-code swo1 - after selecting methods in object type -> utilities - API METHODS-> Add modules.

How to solve

with regards

1 REPLY 1

uwe_schieferstein
Active Contributor
0 Kudos

Hello Lalitha

I can address one of your questions.

Since you are creating a BAPI which is a special kind of RFC-enabled function module the BAPI must have a RETURN parameter (either a structure or a table type, e.g. <b>BAPIRET2 </b>or <b>BAPIRETTAB</b>) in order to return messages to the caller of the BAPI.

Why is such a RETURN parameter <i>mandatory</i>?

BAPIs are usually used for <b>external </b>access, thus they are called via RFC. If the BAPI would throw any exceptions this would cause the RFC connection to break down. As a consequence the caller has no idea what has happened.

Instead, BAPIs <b>collect </b>all messages (in the RETURN parameter) and stop processing as soon as they encounter any AEX message (Abort, Error, Dump).

Regards

Uwe