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: 

I want to change the PO by using BAPI_PO_CHANGE

Former Member
0 Kudos

Hi all,

I want to change the PO by using BAPI_PO_CHANGE ,

i want change below fileds of Purchase order can anybody send me code how to do this

PO Number

PO Line item

WBS Element

Amount

quantity

netrpice

Thanks

Mythily

2 REPLIES 2

nirajgadre
Active Contributor
0 Kudos

Hi,

Go to function module documentation, here you find the sample code for how to change the header and item data using the

BAPI_PO_CHANGE.

Former Member
0 Kudos

Hi,

Check the documentation.

REPORT Z_MASS_REMOVE_FDI_DCI_BAPI.

*head

PARAMETERS: p_ebeln LIKE bapimepoheader-po_number OBLIGATORY.

*Item

PARAMETERS :p_ebelp LIKE bapimepoitem-po_item DEFAULT 1.

DATA: s_header TYPE bapimepoheader,

s_headerx TYPE bapimepoheaderx,

s_item TYPE bapimepoitem,

s_itemx TYPE bapimepoitemx,

i_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE,

i_extension TYPE bapiparex OCCURS 0 WITH HEADER LINE,

s_bapimepoheader TYPE bapimepoheader,

s_bapimepoheaderx TYPE bapimepoheaderx,

s_bapimepoitem TYPE bapimepoitem occurs 0 with header line,

s_bapimepoitemX TYPE bapimepoitemX occurs 0 with header line,

wa_message TYPE c LENGTH 100.

s_bapimepoheaderx-po_number = p_ebeln.

s_bapimepoheader-po_number = p_ebeln.

s_bapimepoitemx-PO_ITEM = p_ebelp.

s_bapimepoitem-PO_ITEM = p_ebelp.

s_bapimepoitemx-DELIV_COMPL = 'X'.

s_bapimepoitem-DELIV_COMPL = 'X'.

append s_bapimepoitem.

clear s_bapimepoitem.

append s_bapimepoitemx.

clear s_bapimepoitemx.

s_header-po_number = p_ebeln.

S_item-PO_ITEM = p_ebelp.

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

purchaseorder = p_ebeln

TABLES

return = i_return

poitem = s_bapimepoitem

poitemx = s_bapimepoitemx.

if i_return[] is initial.

commit work.

endif.

COMMIT WORK AND WAIT.

LOOP AT i_return.

MESSAGE ID i_return-id

TYPE i_return-type

NUMBER i_return-number WITH

i_return-message_v1

i_return-message_v2

i_return-message_v3

i_return-message_v4.

ENDLOOP.

--

Reddy