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: 

New to BAPI

Former Member
0 Kudos

Purpose: I am trying to create a new BAPI to generate a list of Flight Customers that will display both Customer ID and Customer Name using FlightCustomer Business Object type.

BAPI name: Z_BAPI_GET_CUSTOMER_LIST

Processing type: Remote-enable module

Can I define a reference type?

I am getting an error message of 'Reference Parameter are not allowed with RFC' when trying to define the following EXPORT parameters:

Parameter name: RETURN

Type spec: LIKE

Reference type: BAPIRET2

Pass type: no

Short text: Return parameter

Please advise. Thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Collins,

You can't pass parameter by reference in a BAPI.

BAPI is remote enabled, if we pass parameters by reference then it points to local memory address which has no meaning in the BAPI server, so you must pass parameters by value only. You can do it by checking the option Pass By Value in the EXPORT tab of BAPI.

Hope this is clear to you now.

regards,

Narinder Hartala

Message was edited by: Narinder Hartala

2 REPLIES 2

Former Member
0 Kudos

Hi Collins,

You can't pass parameter by reference in a BAPI.

BAPI is remote enabled, if we pass parameters by reference then it points to local memory address which has no meaning in the BAPI server, so you must pass parameters by value only. You can do it by checking the option Pass By Value in the EXPORT tab of BAPI.

Hope this is clear to you now.

regards,

Narinder Hartala

Message was edited by: Narinder Hartala

Former Member
0 Kudos

Hi Margie,

You can't use LIKE but you can use TYPE. So you use TYPE BAPIRET2 rather than LIKE BAPIRET2 (the result is the same its just semantics).

You might want to think about making your RETURN field a TABLES parameter so that you can return multiple messages if required. Refer to BAPI_SALESORDER_CREATEFROMDAT2 as an example of this.

Cheers,

Brad