cancel
Showing results for 
Search instead for 
Did you mean: 

Webservice via Standard-BAPI and only one item using sopaUI ?

Former Member
0 Kudos

Hello,

I created my first webservice with BAPI_PO_CREATE1 and it works fine.

This service generate a new purchase order.

My problem is to understand, why I get a purchase order with only one position (item).

With soapUI many positions (items) possible, e.g. table POITEM

<Poitem>

<item>

<PoItem>00020</PoItem>

...

I checked the payload and all items are present in request and response.

With debugging on BAPI_PO_CREATE1 while running webservice only one position (items) in parameter poitem, poschedule, poaccount ...exist.

Now I have no idea what's wrong.

thanks in advance

Holger

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Holger,

(If you've used SAP PI to web service enable the BAPI, a slightly different approach to the one below can be used)

I'll offer some advice on how you can try & catch the error/problem...This is normally caused by not populating all the required values (input / importing parameters) the BAPI requires in the request. Your first port of call should be using TCode BAPI (in the backend where you enabled BAPI_PO_CREATE1 as a web service) to identify the proper usage of the BAPI along with all the mandatory input parameters & an example of how these values should be populated. It also sometimes provides som SAP notes for further information.

You also need to go through all the occurrences of the BAPI response (the BAPIRET2 recurring structure in the response). This normally details what went wrong with any of the line items.

In some cases, there would be additional configuration (done a functional person for some specific business rule/s) that PO line items need to adhere to & the additional line items that you are passing through might not be complying with this configuration, you should also pick that up in the BAPIRET2 response structure.

Regards, Trevor

Former Member
0 Kudos

Hi Trevor,

I know the neccessary tables, structures and so on to fill the import parameter.

Via SE37 it works fine, one purchase order with more than one line items will be create.

But using soapUI I confused, the return parameter like bapiret2 shows me:

but it's not correct because one purchase order with only one line items created, it seems to be a bug, I don't know.

regards

Holger

Former Member
0 Kudos

Hi Holger,

I can give some context from a technical perspective but you'll probably get a more accurate answer on what the exact parameters are that should be passed through probably from the Materials Management functional forum.

I recently web service enabled BAPI_SALESORDER_CREATEFROMDAT2. The Sales Order that was subsequently created then went on to automatically create a Purchase Requisition & then followed by the auto-creation of the Purchase Order.

What I realized (painfully) from this exercise is:

- Parameters that work with an SE37 test doesn't always work with the web service test. An example, the ORDER_PARTNERS --> item --> PARTN_ROLE node of the Bapi, the code tested & working in SE37 needed to be changed to the German translation of that code ('AG' in this case) before it worked (interestingly, this issue also created only a single line item Sales Order for me with a success message in BAPIRET2).

- The BAPIRET2 structure can be very deceptive with the messages returned, 'SUCCESS' is used very loosely.

Maybe do a search through SDN for a sample of PO create web service request & compare the values you have. You will also probably get better functional help from the MM forums, this forum is more geared for technical SOA / web service queries. In this case the web service communication is working.

Regards, Trevor

Former Member
0 Kudos

Hi Trevor,

yes, it was a painfull experience for me.

Now it works fine with one and more than one line items.

The solution was simpel, only </item> and <item> to identifiy the end of an item and what's the next item.

Exampel for table poaccount.

<Poaccount>

<item>

<PoItem>00020</PoItem>

<SerialNo>00</SerialNo>

<Quantity>5</Quantity>

<GlAccount>0000681000</GlAccount>

<Costcenter>0000001010</Costcenter>

<CoArea>0100</CoArea>

</item>

<item>

<PoItem>00010</PoItem>

<SerialNo>00</SerialNo>

<Quantity>25</Quantity>

<GlAccount>0000618000</GlAccount>

<Costcenter>0000001010</Costcenter>

<CoArea>0100</CoArea>

</item>

</Poaccount>

That's all.

thanks

Holger