2006 Apr 24 12:41 AM
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
2006 Apr 24 12:52 AM
Hi Apurv,
Check this link it gives you step by step procedure.
http://www.sapgenie.com/abap/bapi/example.htm
While creating a BAPI API thats a mandatory thing to have the parameters start from BAPI.
Hope this helps
Cheers
VJ
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
2006 Apr 24 12:52 AM
Hi Apurv,
Check this link it gives you step by step procedure.
http://www.sapgenie.com/abap/bapi/example.htm
While creating a BAPI API thats a mandatory thing to have the parameters start from BAPI.
Hope this helps
Cheers
VJ
2006 Apr 24 1:02 AM
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.
2006 Apr 24 1:10 AM
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
2006 Apr 24 1:10 AM
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
2006 Apr 24 1:14 AM
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
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |