cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_PO_CHANGE and SERVICES

Former Member
0 Kudos

Hello,

I'm using BAPI_PO_CHANGE to modify a PO. In particular, i want to modify the services. So, i filled the fields in table POSERVICES. When I execute the bapi BAPI_PO_CHANGE, the return table hasn't error messages, but the service in the purchase order isn't modified. I applied the sap notes related to BAPI_PO_CHANGE.

Any ideas?

Thank you.

(I changed only SHORT_TEXT to try, the others fields are the same of the original PO)

POITEM-PO_ITEM = '30'.

POITEMX-PO_ITEM = '30'.

POITEM-SHORT_TEXT = 'Angelo'.

POITEMX-SHORT_TEXT = 'X'.

APPEND POITEM. APPEND POITEMX.

POSERVICES-PCKG_NO = '231'.

POSERVICES-LINE_NO = '06'.

POSERVICES-EXT_LINE = '20'.

POSERVICES-QUANTITY = '10'.

POSERVICES-SHORT_TEXT = 'HELLO'.

POSERVICES-GR_PRICE = '10000'.

POSERVICES-BASE_UOM = 'UR'.

POSERVICES-UOM_ISO = 'PCE'.

POSERVICES-MATL_GROUP = '43BF'.

APPEND POSERVICES.

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

PURCHASEORDER = 'C000000001'

TABLES

RETURN = RETURN2

POITEM = POITEM

POITEMX = POITEMX

POACCOUNT = POACCOUNT

POACCOUNTX = POACCOUNTX

POSERVICES = POSERVICES

POSRVACCESSVALUES = POSRVACCESSVALUES

POSERVICESTEXT = POSERVICESTEXT

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

Message was edited by: Angelo Gattuso

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

hi,

i have a problem in creating PO using BAPI_PO_CREATE1. Actually how can we realte POSERVICES , LIMITS etc. to the POITEMS. I found only Package number is the common field . but when we are using me21 , package number will be created automatically linked with PO in ESLH table. But in BAPI_PO_CREATE1 how can we give packeage number manually.

0 Kudos

Hi Vijayanand

You can choose any temporary number. Usually you start with PCKG_NO = 1 and SUBPCKG_NO = 2. The system will replace these numbers automatically by 'real' package numbers.

Note 420332 gives an example for BAPI_PO_CREATE. The concept for BAPI_PO_CREATE1 is the same.

Kind regards and good luck!

Astrid

Former Member
0 Kudos

I solved it!

I had to set the package number in the item!

POITEM-PO_ITEM = '30'. POITEMX-PO_ITEM = '30'.

POITEM-PCKG_NO = '231'. POITEMX-PCKG_NO = 'X'.

APPEND POITEM. APPEND POITEMX.

Thank you very much.

Former Member
0 Kudos

Hi i am working on bapi_po_chane to change the service number.Even if i am getting the success message i am not able to see the changes in me22n.can you please help me with the code you did to change the service line number.

Former Member
0 Kudos

Hi i am working on bapi_po_chane to change the service number.Even if i am getting the success message i am not able to see the changes in me22n.can you please help me with the code you did to change the service line number.

Former Member
0 Kudos

Thank you for reply.

Yes, I read it, but I found a sap note that say:

You can also change services using BAPI_PO_CHANGE. Up to now, it was only possible to add complete service or limit items.

Using the new BAPI_PO_CHANGE, you can now make changes to services and with limits.

Because in the production mode the interfaces are filled entirely from available documents by report, SAP always assumes that the services or limits to be changed are sent in full to the BAPI interfaces with all the data belonging to them, even if not all the data is changed. If required entry fields are missing, the system displays an error message, other data not filled is possibly initialized. (It is not necessary to assign the complete item.)

- NOTE 561507 -

"What BAPI_PO_CHANGE can now do:

1. Changes to an already existing item:

For an existing item, you can

a) Add, change or delete services.

b) Add, change or delete limits (free limits and contract limits), provided that this does not cause the net value of the purchase order item to become "0".

1. Account assignment change for item category B and 😧 For an existing item, the account assignment can be changed.

a) Account assignment category U can be converted into another account assignment category allowed for the item categories, and vice versa.

b) An existing account assignment can be changed.

c) In case of services, a single account assignment can be converted into a multiple account assignment and vice versa - not with limits (with item category B), here multiple account assignment is not possible on-line either).

2. Making changes to more than one item.

3. Change outline layouts.

What the BAPI_PO_CHANGE cannot do:

Everything which is not possible on-line either."

Former Member
0 Kudos

Hi Angelo,

If this note (and all the others mentioned in this note) have been implemented correctly I guess there is no other option than to debug what is happening....

Good luck.

John.

Former Member
0 Kudos

Hi Angelo,

According to the documentation of the BAPI you can't change Services, you can only add services:

"Note

In this method, you can only create service items, you cannot change them."

I guess that also explains why there isn't any POSERVICESX table to indicate which fields have been changed....

Regards,

John.