05-13-2010 7:56 AM
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
05-13-2010 8:11 AM
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.
05-13-2010 8:18 AM
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