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

BAPI ERROR...

Former Member
0 Likes
374

Dear All,

I am trying to create bapi in swo1 , I am getting error given below when am giving function module name in Utilities->API .

Data type: ZBAPI_BUKRS cannot be used for methods.

Here zbapi_bukrs is data element which is given in import parameter of function module and one more thing when am giving standard data element name bukrs then also same error is coming.

Thanks,

rsandhosh

Moderator message: please use more descriptive subject lines for your posts.

Edited by: Thomas Zloch on Jan 6, 2011 2:39 PM

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
333

Every parameter of a BAPI must belong to a <namespace>BAPI<name> structure, so don't use a TYPE ZBAPIelement but refer to a ZBAPIstructure-fieldname element. Create ZBAPI structure for structure (parameter and table) and another structure for single parameter definition.

Check [Actions in the ABAP Dictionary |http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/43/b46c3953c111d395fa00a0c94260a5/frameset.htm] in [BAPI Programming Guide (CA-BFA)|http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm]

Look at SAP standard BAPI to get a better idea.

*"  IMPORTING
*"     VALUE(PARAMETER1) LIKE  ZBAPISTRUCTURE1-FIELD1
*"     VALUE(STRUCTURE1) LIKE  ZBAPISTRUCTURE2

Raymond

1 REPLY 1
Read only

RaymondGiuseppi
Active Contributor
0 Likes
334

Every parameter of a BAPI must belong to a <namespace>BAPI<name> structure, so don't use a TYPE ZBAPIelement but refer to a ZBAPIstructure-fieldname element. Create ZBAPI structure for structure (parameter and table) and another structure for single parameter definition.

Check [Actions in the ABAP Dictionary |http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/43/b46c3953c111d395fa00a0c94260a5/frameset.htm] in [BAPI Programming Guide (CA-BFA)|http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm]

Look at SAP standard BAPI to get a better idea.

*"  IMPORTING
*"     VALUE(PARAMETER1) LIKE  ZBAPISTRUCTURE1-FIELD1
*"     VALUE(STRUCTURE1) LIKE  ZBAPISTRUCTURE2

Raymond