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

Function parameter has no return parameter

Former Member
0 Likes
1,166

Hi all,

I am creating a BAPI and connecting it using a Java servlet to display vendor details on accepting vender number.

I followed following steps:

1) defined a simple structure called ZBAPIVEND

2) wrote a function module: ZBAPIVENDFUN

3) adding API method: ZBAPI_VEND (error)

while adding an API it gives me following errors:

Error one:

"BAPI ZBAPIVENDFUN: the ref. structure LFA1 of parameter does not begin with BAPI"

---now I am pulling LIFTNR from LFA1 table, if cant remane LFA1 to BAPILFA1 in the function module coz BAPILFA1 does not exist. how do i solve this error?

Error 2:

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

---infact i have used return parameter as BAPIRET2. still it gives me these errors.

Please help.

My code:

FUNCTION ZBAPIVENDFUN.

*"----


""Local interface:

*" IMPORTING

*" VALUE(LIFNR) LIKE LFA1-LIFNR

*" EXPORTING

*" VALUE(EXPORT) LIKE BAPIRET2 STRUCTURE BAPIRET2

*" TABLES

*" ITAB STRUCTURE ZBAPIVEND OPTIONAL

*"----


SELECT LIFNR NAME1 ORT01 ORT02 PFACH TELF1 TELFX FROM LFA1 INTO TABLE

ITAB WHERE LIFNR = LIFNR.

ENDFUNCTION.

Apurv

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
991

Hi Apurv,

Check this link it gives you step by step procedure.

http://www.sapgenie.com/abap/bapi/example.htm

http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html?track=NL-141&ad=489...

While creating a BAPI API thats a mandatory thing to have the parameters start from BAPI.

Hope this helps

Cheers

VJ

5 REPLIES 5
Read only

Former Member
0 Likes
992

Hi Apurv,

Check this link it gives you step by step procedure.

http://www.sapgenie.com/abap/bapi/example.htm

http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html?track=NL-141&ad=489...

While creating a BAPI API thats a mandatory thing to have the parameters start from BAPI.

Hope this helps

Cheers

VJ

Read only

0 Likes
991

Hi VJ,

I am using the following slides to create it:

http://www.sapgenie.com/sapgenie/docs/BAPI%20JCO.pdf

Please go thro them quickly and let me know if they are correct. Coz the LFA1 table i have to access it as it is. Do i have to create one more table called ZBAPILAF1 and copy all the data from LAF1.

Thanks,

Apurv.

Read only

0 Likes
991

Hey VJ,

Thanks for the helpful answers. I have solved the problem. Using BAPIRETURN instead of BAPIRET2 solved it.

Thanks,

Apurv

Have assigned you points

Read only

0 Likes
991

Hi Apurv,

95% of the cases you will have a BAPIXXXXX structure in your system. You can reuse them. I have created many BAPIS and in many cases i have found a reuasable structure in the Data dictionary.

Check se12 you should find one which closely matches your requirement. If you dont find one then you will have to create a new one.

Cheers

Vj

Read only

0 Likes
991

Hi Apurv,

Check any of the existing BAPI related to vendor you will get all the associated structures with them.

BAPI_VENDOR_CHANGEPASSWORD

BAPI_VENDOR_CHECKPASSWORD

BAPI_VENDOR_CREATE

BAPI_VENDOR_CREATEPASSWORD

BAPI_VENDOR_DELETE

BAPI_VENDOR_DELETEPASSWORD

BAPI_VENDOR_DISPLAY

BAPI_VENDOR_EDIT

BAPI_VENDOR_EXISTENCECHECK

BAPI_VENDOR_FIND

BAPI_VENDOR_GETDETAIL

BAPI_VENDOR_GETINTNUMBER

BAPI_VENDOR_GETPASSWORD

BAPI_VENDOR_INITPASSWORD

Hope this helps

Cheers

VJ