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

Error while creating own BAPI

Former Member
0 Likes
793

Hey,

trying this step-by-step guide with own names

http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf

Got two errors:

1. In SWO1 while trying to add api methods he said:

BAPI &1: The name of the function module &2 does not begin with 'BAPI'

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

Searching in forum, I found that my structures have to begin with ZBAPI. But

why the tutorial can do this? In tutorial the structure is named ZVEND. Why they

can do this?

2. The second error is telling me, that I have no return parameter. Thats not true.

In my export tab of my function module, I have included a Parameter BAPIRET2 TYPE BAPIRET2.

Trying to insert a table like this:

RETURN TYPE BAPIRETURN

He is telling me that "TABLES parameters are obsolete"

In every tutorial they are using like, but I am not able to use LIKE, only TYPE is this something they changed in the SAP version > 4.7 ???

Does every BAPI needs a return structure or table?

If anyone have some good documents about how to create an own bapi let me know.

But please no short description or 1000 links like this:

thanks

chris

thx

chris

3 REPLIES 3
Read only

former_member787646
Contributor
0 Likes
569

Hi,

Here are the answers for your queries. (Version 4.7)

1. The function module name should start with "ZBAPI" the

one we are creating our own.

All the structures we refer for parameters in function moudle

should also start with "ZBAPI"

(eg., Import Params: VBELN LIKE ZVBAK-VBELN).

2. There must be a return parameter in Export List in the

function module like the one below. Its a BAPI standard

return variable.

Export Params:RETURN LIKE ZBAPIRETURN.

In BAPI Function modules we pass parameters as "pass

by value". That's why Tables are not used as they are

passed by reference.

Hope it helps you

Murthy.

Read only

former_member787646
Contributor
0 Likes
569

Hi,

There is a change in the following line..

Export Params:RETURN LIKE ZBAPIRETURN.

to

Export Params:RETURN LIKE BAPIRETURN.

Murthy.

Read only

0 Likes
569

>

> Export Params:RETURN LIKE BAPIRETURN.

Trying this, I got the error message:

LIKE as typingfor parameters is obsolete!

So I just be able to use TYPE or TYPE TO REF.

Or am I wrong?

thx

chris