2006 Nov 21 4:22 AM
Hi,
Can some one help me in using the BAPI_PO_CHANGE.
I would like to change the Po text and the Vendor number for a list of EBELN.
Can some one help me with the parameters to be passed.
Possible, please provied code, if available.
Thank you,
Shekar.
Hi,
Can some one help me in using the BAPI_PO_CHANGE.
I would like to change the Po text and the Vendor number for a list of EBELN.
Can some one help me with the parameters to be passed.
Possible, please provied code, if available.
Thank you,
Shekar.
2006 Nov 21 5:08 AM
hi
good
go through these code i hope these ll help you to solve your probelm
method IF_EX_ME_PURCHDOC_POSTED~POSTED .
DATA: wa_ekpo like line of IM_EKPO,
lt_po_item type standard table of BAPIMEPOITEM,
lt_po_itemx type standard table of BAPIMEPOITEMX,
wa_po_item type BAPIMEPOITEM,
wa_po_itemx type BAPIMEPOITEMX,
lt_return type standard table of BAPIRET2.
*data: ls_ebeln type BAPIMEPOHEADER-PO_NUMBER.
check im_ekko-ebeln ne PO_NUMBER.
PO_NUMBER = im_ekko-ebeln.
LOOP AT IM_EKPO into wa_ekpo.
wa_po_item-PO_ITEM = wa_ekpo-ebelp.
EVERS to be derived
wa_po_item-SHIPPING = 'C'.
APPEND wa_po_item to lt_po_item .
wa_po_itemx-PO_ITEM = wa_ekpo-ebelp.
wa_po_itemx-SHIPPING = 'X'.
APPEND wa_po_itemx to lt_po_itemx.
ENDLOOP.
CALL FUNCTION 'BAPI_PO_CHANGE' IN BACKGROUND TASK
EXPORTING
purchaseorder = PO_NUMBER
POHEADER =
POHEADERX =
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING = 'X'
NO_MESSAGE_REQ = 'X'
NO_AUTHORITY = 'X'
NO_PRICE_FROM_PO = 'X'
IMPORTING
EXPHEADER =
EXPPOEXPIMPHEADER =
TABLES
RETURN = lt_return
POITEM = lt_po_item
POITEMX = lt_po_itemx
POADDRDELIVERY =
POSCHEDULE =
POSCHEDULEX =
POACCOUNT =
POACCOUNTPROFITSEGMENT =
POACCOUNTX =
POCONDHEADER =
POCONDHEADERX =
POCOND =
POCONDX =
POLIMITS =
POCONTRACTLIMITS =
POSERVICES =
POSRVACCESSVALUES =
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
POPARTNER =
.
endmethod.http://www.geocities.com/rmtiwari/main.html?http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/ABAP_nsFAQ.html
thanks
mrutyun^
2006 Nov 21 5:11 AM
Hi Sekhar,
Please find below a sample program to change the text on po.
DATA : t_item_po TYPE STANDARD TABLE OF bapimepoitem,
t_item_pox TYPE STANDARD TABLE OF bapimepoitemx,
t_packno TYPE STANDARD TABLE OF pack_tab,
t_esll TYPE STANDARD TABLE OF esll,
t_eslh TYPE STANDARD TABLE OF eslh,
t_bapiesllc TYPE STANDARD TABLE OF bapiesllc.
DATA : t_text TYPE STANDARD TABLE OF bapimepotext.
DATA : wa_text TYPE bapimepotext.
DATA : tl_return TYPE STANDARD TABLE OF bapiret2.
FIELD-SYMBOLS : <l_eslh> TYPE eslh,
<l_esll> TYPE esll.
TABLES : ekko,
ekpo.
PARAMETERS : p_ebeln TYPE ekko-ebeln,
p_ebelp TYPE ekpo-ebelp.
START-OF-SELECTION.
DATA: c_flag TYPE flag.
DATA: tl_po_item TYPE TABLE OF zmweb_bapi_po_change_request,
tl_potextheader TYPE TABLE OF bapimepotext.
DATA: wa_po_items_change TYPE bapimepoitem,
t_po_items_change TYPE STANDARD TABLE OF bapimepoitem,
t_po_itemx TYPE STANDARD TABLE OF bapimepoitemx,
wa_po_itemx TYPE bapimepoitemx,
t_po_item_deliv TYPE STANDARD TABLE OF bapimeposchedule.
SELECT SINGLE netpr idnlf INTO (wa_po_items_change-net_price ,
wa_po_items_change-vend_mat)
FROM ekpo
WHERE ebeln = p_ebeln
AND ebelp = p_ebelp.
* IF NOT wa_po_items_change-net_price IS INITIAL.
* wa_po_items_change-net_price = wa_po_items_change-net_price.
* wa_po_itemx-net_price = 'X'.
* ENDIF.
IF NOT wa_po_items_change-vend_mat IS INITIAL.
wa_po_items_change-vend_mat = wa_po_items_change-vend_mat.
wa_po_itemx-vend_mat = 'X'.
ENDIF.
wa_po_items_change-po_item = p_ebelp.
wa_po_itemx-po_item = p_ebelp.
INSERT wa_po_items_change INTO TABLE t_po_items_change.
INSERT wa_po_itemx INTO TABLE t_po_itemx.
CLEAR:
wa_po_items_change,
wa_po_itemx.
*Text
wa_text-po_number = p_ebeln.
wa_text-po_item = p_ebelp.
wa_text-text_id = 'F01'.
wa_text-text_form = '*'.
wa_text-text_line = 'TEXTvinod12345'.
APPEND wa_text TO t_text.
CLEAR wa_text.
* call the bapi
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = p_ebeln
TABLES
return = tl_return
poitem = t_po_items_change
poitemx = t_po_itemx
potextheader = t_text.
READ TABLE tl_return TRANSPORTING NO FIELDS
WITH KEY
type = 'E'.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
* IMPORTING
* RETURN =
.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
Regards,
Raghav
2006 Nov 21 5:14 AM
Please populate following as below:
PO Number for PURCHASEORDER
For Changing Vendor:
Populate Vendor of structure: POHEADER(BAPIMEPOHEADER), and update flag 'X' for vendor in structure: POHEADERX(BAPIMEPOHEADERX)
For PO Header Texts:
POTEXTHEADER(BAPIMEPOTEXTHEADER) with PO_NUMBER, Text ID & texts in TEXT_LINE.
For PO Item Texts:
POTEXTITEM(BAPIMEPOTEXT) with PO_NUMBER, PO_ITEM, Text ID & Texts in TEXT_LINE.
Kind Regards
Eswar
2006 Nov 21 5:20 PM
Hi,
Can some one help me with!!!!
What parameters to pass for changing the Vendor material number IDNFL in the BAPI_PO_CHANGE function module for changing IDNFL.
Thank you.
2006 Nov 21 5:30 PM
Hi,
In the parameter POITEM there is field called VEND_MAT which can be used to update the vendor material number..
Thanks,
Naren
2006 Nov 21 5:52 PM
Thanks for a quick reply.
But I want to know if we need to pass some other parameters apart from VEND_MAT and PO_ITEM.
Please check this code:
Loop at I_ITAB4.
Clear: t_bapi_mepoitem.
t_bapi_mepoitem-PO_ITEM = I_Itab4-EBELP.
t_bapi_mepoitem-VEND_MAT = '9999'.
t_bapi_mepoitemx-PO_ITEM = I_Itab4-EBELP.
t_bapi_mepoitemx-VEND_MAT = 'X'.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
PURCHASEORDER = t_bapi_mepoheader
TABLES
RETURN = t_bapireturn
POITEM = t_bapi_mepoitem
POITEMX = t_bapi_mepoitemx
Endloop.
COMMIT WORK.
2006 Nov 21 6:06 PM
Hi,
Yes..You have to pass the line item number..
Check this example.
PARAMETERS: p_ebeln LIKE ekko-ebeln.
DATA: t_poitem LIKE bapimepoitem OCCURS 0 WITH HEADER LINE.
DATA: t_poitemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE.
DATA: t_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
t_poitem-po_item = '00010'.
t_poitem-vend_mat = 'VEND MAT1'.
APPEND t_poitem.
t_poitemx-po_item = '00010'.
t_poitemx-net_price = 'X'.
t_poitemx-vend_mat = 'X'.
APPEND t_poitemx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = p_ebeln
TABLES
return = t_return
poitem = t_poitem
poitemx = t_poitemx.
COMMIT WORK.
Thanks,
Naren
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |