Application Development 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: 

bapi po change problem

Former Member
0 Kudos

Hi,

I would like to ask if bapi_po_change can delete the PO? I mean the whole PO and not just the PO line.

I tried to mark X at poheader and poheaderx delete_ind, even i tried delete_ind in poitem and poitemx but the return message is po 45xxxxxxxx has been changed. I still able to see the PO in me23 and even can edit.

What has gone wrong?

thanks

rgds

8 REPLIES 8

kesavadas_thekkillath
Active Contributor
0 Kudos

Hello , You can only set the deletion indicator through this function module.

So that the po gets marked with deletion flag.

check the value of deletion flag in EKKO and EKPO

Edited by: ksd on Dec 10, 2009 7:12 PM

0 Kudos

Hi,

i tested in se37 for this bapi_po_change.

when i checked ekko, deletion flag not checked.

Kindly advise me what else i need to enter.

i enter at poheader and poheaderx and mark X at deletion flag. i also provide po number at poheader and poheaderx.

TYPE S

ID 06

NUMBER 023

MESSAGE Standard PO 4500020005 changed

LOG_NO

LOG_MSG_NO 000000

MESSAGE_V1 Standard PO

MESSAGE_V2 4500020005

MESSAGE_V3

MESSAGE_V4

PARAMETER POHEADER

ROW 1

FIELD

SYSTEM XSS

0 Kudos

what about commit work after bapi?

0 Kudos

hi,

i tested in se37. also i tested in my program. both also cannot set to delete.

need advice.

thanks

0 Kudos

Hello

Working code:


xpoitem-po_item = xekpo-ebelp.  " set PO position here
xpoitem-delete_ind = 'X '.
append xpoitem.
xpoitemx-po_item = xekpo-ebelp. " set PO position here
xpoitemx-delete_ind = 'X'.
append xpoitemx.
endloop.

CALL FUNCTION 'BAPI_PO_CHANGE'
     EXPORTING
              purchaseorder    = p_ebeln "set PO number here
     TABLES
              return           = xreturn
              poitem           = xpoitem
              poitemx          = xpoitemx.
if sy-subrc = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING WAIT = 'X'.
endif.

0 Kudos

hi,

i tested with the same thing before also.

i got the message 'Standard PO 45xxxxxxxx changed' but when check in me23 or table ekko deletion ind field, it is still empty.

infact i would like the whole PO to delete and not just the item line.

any advice?

thanks

0 Kudos

Hello

Check table EKPO.

PO possible delete only set delete indicator on each position. Not in header.

kesavadas_thekkillath
Active Contributor
0 Kudos

Just look at this thread

You will come to know what is the difference between ekko and ekpo deletion indicator

And you cannot delete the PO details from the table.

What you can do is set indicator for the items.