12-04-2007 6:25 PM
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
12-04-2007 8:09 PM
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