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

Web Service from BAPI

Former Member
0 Likes
1,346

Hi

I have a custom developed BAPI, which accepts the purchase organization id (ORGID) as input and retrieves the purchase orders accordingly. It has an intermediary internal table (ITAB1) to temporarily hold records and another table (ITAB2) for the final output. these tables are declared under the 'Tables' tab in SE37.

I exposed the BAPI as a Web Service and generated the WSDL. I used this WSDL in an another non-SAP system to trigger the BAPI - the connection is established as well as the BAPI got triggered. But, it asks for 3 input parameters: ORGID, ITAB1 and ITAB2. In actual, it should ask only for ORGID.

Could anyone help me with this issue?

Regs

R@J

1 ACCEPTED SOLUTION
Read only

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes
1,281

Do not use TABLES parameters - just use IMPORT and EXPORT paramaters.

TABLES parameters need to be defined on the input out output side of the interface which makes the WSDL more complicated.

TABLES parameters are deprecated - you should have got a compiler warning telling you this.

Cheers

Graham Robbo

12 REPLIES 12
Read only

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes
1,282

Do not use TABLES parameters - just use IMPORT and EXPORT paramaters.

TABLES parameters need to be defined on the input out output side of the interface which makes the WSDL more complicated.

TABLES parameters are deprecated - you should have got a compiler warning telling you this.

Cheers

Graham Robbo

Read only

0 Likes
1,281

Hi Graham

ITAB1 and ITAB2 are defined as structures using the SE11 transaction in ECC6 system. And I tried doing the way that you suggested. Like - declaring the tables under the EXPORT tab.

When i do it, it gives me the following error:

ITAB1 is not an internal table - the "OCCURS n" specification is missing.

ITAB2 is not an internal table - the "OCCURS n" specification is missing.

How to deal with this error?

Rgds

R@J

Read only

0 Likes
1,281

You need to declare table types as the exporting parameters - not structures.

Cheers

Graham Robbo

Read only

0 Likes
1,281

Graham.. thx a lot for suggestion..

But, when i create a structure using SE11 Tcode, it shows only 3 type options - Data Element, Structure and Table Type.

Under table type option also, I could not find the type as "exporting parameters", as u said.

Could you plz help me telling where I can set this property of the object being created?

Rgds

R@J

Read only

0 Likes
1,281

You use SE11 to create a TABLE TYPE based upon the structure you have already created.

Then use the TABLE TYPE as the EXPORTING parameter.

Cheers

Graham Robbo

Read only

0 Likes
1,281

Hello,

You must have a structure that you have defined to specify the internal tables itab1 and itab2. When you create a table type enter that structure as your line type and then use the resultant table type in the exporting parameter in the BAPI. generate your WSDL file on that basis and use it in your third party application.

Hope this helps

Regards

Sachin

Read only

0 Likes
1,281

Hi Sachin

I have defined ZITAB1 and ZITAB2 as structures using the SE11 transaction in ECC6 system. In the EXPORT tab of SE37 (for BAPI), i declared ITAB1 of type ZITAB1 and ITAB2 of type ZITAB2.

It gives me the following error:

ITAB1 is not an internal table - the "OCCURS n" specification is missing.

ITAB2 is not an internal table - the "OCCURS n" specification is missing.

It seems they do not take up the structures as export parameters.

Rgds

R@J

Read only

0 Likes
1,281

Hi,

Goto transaction SE11 and define a table type say ZTAB_TYPE1 and define its line type as ZITAB1. Similarly define a table type ZTAB_TYPE2 with line type as ZITAB2. now in your BAPI in the exporting parameter define itab1 as type ZTAB_TYPE1 and ITAB2 as type ZTAB_TYPE2.

Regards,

Sachin

Read only

0 Likes
1,281

Oh Sachin... such a lovely answer.. This was what I wanted exactly. Thank you so much for your help.

Graham.. Thanks lot for your valuable suggestion too. It helped me to reach the answer so soon.

Rgds

R@J

Read only

Former Member
0 Likes
1,281

Hi Experts...;

While doing it, there was an information warning that doing this may affect the performance of the BAPI...

Does anyone have any word on it... plz...

Rgds

R@J

Read only

0 Likes
1,281

Hi Raj,

Moving the parameters under export parameter should not have cause any performance issues, not sure on where and when you got this message. Anyways, did you click on the long text, to see what the message was all about?

Regards,

Chen

Read only

Former Member
0 Likes
1,281

Query closed!