Re-price a PO using BAPI_PO_CHANGE
Hi All,
I want to reprice a PO using FM BAPI_PO_CHANGE. Can anyone help me on this or provide a piece of code.
Thanks in advance.
Regards,
John
check the prgm
http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm
Similar Messages
-
How to change net Price by using BAPI_PO_change
Hi experts..
How i can change net price by using bapi_po_change.
What parameters i have to pass in this fm.
if possible please tell me , which table this FM will update.
Thanks.
I will award points for all help.See the below code and have tested and it works great..
REPORT ZTEST_PG_07 NO STANDARD PAGE HEADING
MESSAGE-ID z9_msg_prash.
Tables Declaration ****
TABLES: ekpo.
Variables Declaration ****
DATA: v_purchaseorder TYPE bapimepoheader-po_number.
DATA: v_ebelp TYPE ekpo-ebelp.
Constants Declaration ****
CONSTANTS: x VALUE 'X'.
Internal Tables Declaration ****
DATA: it_return TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.
DATA: it_poitem TYPE STANDARD TABLE OF bapimepoitem WITH HEADER LINE.
DATA: it_poitemx TYPE STANDARD TABLE OF bapimepoitemx WITH HEADER LINE.
DATA: wa_return TYPE bapiret2.
Selection Screen ****
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p_ebeln LIKE ekpo-ebeln OBLIGATORY.
PARAMETERS: p_ebelp LIKE ekpo-ebelp.
PARAMETERS: p_menge LIKE ekpo-menge.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN
AT SELECTION-SCREEN ON p_ebeln.
IF p_ebeln IS NOT INITIAL.
SELECT SINGLE ebeln INTO v_purchaseorder FROM ekpo
WHERE ebeln = p_ebeln.
IF sy-subrc <> 0.
MESSAGE e002.
ENDIF.
ELSE.
MESSAGE e005.
ENDIF.
AT SELECTION-SCREEN ON p_ebelp.
if p_ebeln is not initial.
IF p_ebelp IS NOT INITIAL.
SELECT SINGLE ebelp INTO v_ebelp FROM ekpo
WHERE ebeln = p_ebeln AND ebelp = p_ebelp.
IF sy-subrc <> 0.
MESSAGE e003.
ENDIF.
ELSE.
MESSAGE e006.
ENDIF.
endif.
START-OF-SELECTION
START-OF-SELECTION.
v_purchaseorder = p_ebeln.
it_poitem-po_item = p_ebelp.
it_poitem-quantity = p_menge.
it_poitem-net_price = '20.00'.
APPEND it_poitem.
it_poitemx-po_item = p_ebelp.
it_poitemx-po_itemx = x.
it_poitemx-quantity = x.
APPEND it_poitemx.
*&----Calling BAPI function module
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = v_purchaseorder
testrun = x
TABLES
return = it_return
poitem = it_poitem
poitemx = it_poitemx.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = space
IMPORTING
RETURN =
END-OF-SELECTION
END-OF-SELECTION.
LOOP AT it_return INTO wa_return.
WRITE:/ wa_return-message.
ENDLOOP.
Thanks
Seshu -
Update Schedule line Delivery date using Bapi_po_Change
Hi all,
I am using Bapi_po_change to Update the Schedule line Delivery date(EKET-EINDT) for the PO based on the Item and the Schedule line.
I am passing the PO number, Po header, Item structure, Schedule line Structure.
But the Date is not getting updated in the Eket table.
Please suggest.Hi Sukriti,
Thanks for the Response, yes i have used the Bapi Transaction Commit Also .
The point is I am able to Update the Statistical Delivery Date in the Same EKET table using BAPI_PO_Change .I have Checked all the Ways to update the EKET-EINDT(Delivery Date)but no Unable to do it. -
Using BAPI_PO_CHANGE to update PO with item actegory B
Hi Experts,
I have a requirement to update the PO with item category B which is created by referring PR having account assignment category N(.( So I have a PO with Acc assignment N now have to update the item category with B ). I am using BAPI_PO_CHANGE to update the item category with B .in me22n system will prompt the Limits ( overall limit , expected value) and Network details ( like GL acc and Network and activity code) so i am passing lt_poitem,lt_poitemx,lt_polimits,lt_poaccount,lt_poaccountx,lt_POSRVACCESSVALUES. System is issuing a message Buffer table is not up-to-date . Please let me know if any one updated the PO with item category B using BAPI_PO_CHANGE and please provide sample code for the same if possible. Thanks in advance.
Thanks
PraveeHi Experts,
I am passing the required structure as below .
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = v_po
TABLES
return = lt_return
poitem = lt_poitem
poitemx = lt_poitemx
polimits = lt_polimits
poaccount = lt_poaccount
poaccountx = lt_poaccountx
POSRVACCESSVALUES = lt_POSRVACCESSVALUES
POCONTRACTLIMITS = lt_POCONTRACTLIMITS
POSERVICES = lt_POSERVICES.
Now i am getting a message below messages from BAPI :
S 06 023 Indirect PO (ZSTA) 4506000481 changed
I ME 664 Change Item Category could not be effected
I ME 664 Change Item Category could not be effected
I can see that the PO is not got updated with any of values.Please help me to resolve this issue.
Thanks
PRavee. -
Payment Terms not saved using BAPI_PO_CHANGE
Hi,
We are using BAPI_PO_CHANGE to save changes to the PO.
When I use a Payment Term with 'Day Limit' (i. e Day Limit not zero) the Payment term field in the PO header is blank after commit. This doesnt happen for other payment terms.
Has anyone faced this issue?
Any suggestions will be appreciated.
Ramesh-Hi ramana ,
How r u populating the two table s?
POCOND
POCONDX of the bapi , can i know the code
here u have to populate all this
COND_TYPE
COND_VALUE
CURRENCY
COND_UNIT
COND_P_UNT
CHANGE_ID(I for insert a new condition ,U for Update , D for delete)
pls checjk thios and Pls ask if u have any thing. -
How to insert new service condition in PO using BAPI_PO_CHANGE?
Hi all,
I'm trying to insert a new condition under a service line in a PO. This can be seen in ME23N under the services tab of the PO item. Then click on conditions (the button with the dollar and yen symbol).
I tried using the internal table POCOND and POCONDX. But these tables update the conditions of the PO item itself and not the service conditions. In ME23N this is the conditions tab of the PO item.
build condition item table
wa_conditem-change_id = 'I'.
wa_conditem-itm_number = wa_items-po_item.
wa_conditem-cond_type = c_condtypz.
wa_conditem-cond_value = l_plndisamt.
wa_conditem-currency = l_poheader-currency.
APPEND wa_conditem TO it_conditem.
CLEAR wa_conditem.
build condition item change parameter table.
wa_conditemx-itm_number = wa_items-po_item.
wa_conditemx-itm_numberx = 'X'.
wa_conditemx-cond_type = 'X'.
wa_conditemx-cond_value = 'X'.
wa_conditemx-currency = 'X'.
wa_conditemx-change_id = 'X'.
APPEND wa_conditemx TO it_conditemx.
CLEAR wa_conditemx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = wa_ekpo_u-ebeln
TABLES
return = it_return
poitem = it_poitem
poitemx = it_poitemx
pocond = it_conditem
pocondx = it_conditemx
EXCEPTIONS
OTHERS = 1.
I tried using the internal tables POCONDHEADER and POCONDHEADERX but this doesn't seem to insert anything.
Can anyone guide me how to insert a new service condition?
thanks,
ShafiqFound a SAP note 499626 quoted below. So it seems that it's not possible to use BAPI_PO_CHANGE.
"Can I create or change conditions on the service level with BAPI_PO_CREATE1 or BAPI_PO_CHANGE?
Answer:
Such a function is currently not available."
Anybody know any FM to do this?
Edited by: shafiq shamsuddin on Mar 16, 2011 4:38 AM -
Problem in update PO's partner function using BAPI_PO_CHANGE
Hi All,
I have some problem when i try to update PO partner function using BAPI_PO_CHANGE.
If i update partner function where business partner number is vendor (eg. GS) , it run successfully. But when I try to update partner function where business partner number is personnel number (eg. CS, VW, etc) , it was failed. And BAPI return message is "Please enter a partner role".
Please advice.
ThanksHi,
are you executing BAPI_TRANSACTION_COMMIT after BAPI_PO_CHANGE?
Check this code for PO update..
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-net_price = '17.00'.
APPEND t_poitem.
t_poitemx-po_item = '00010'.
t_poitemx-net_price = 'X'.
t_poitemx-po_itemx = '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.
<b>Reward points</b>
Regards -
To change vendor no for condition types using BAPI_PO_CHANGE
Hii,
how to change vendor no for certain condition types using BAPI_PO_CHANGE.
Is it possible .
Any parameter is there.
Plz help urgent
Title edited by: Alvaro Tejada Galindo on Jun 12, 2008 5:23 PMHi,
It is possible.
wa_pocond-vendor_no = wa_konv-lifnr.
wa_pocondx-vendor_no = 'X'.
wa_pocond-condition_no = wa_konv-knumv.
wa_pocond-itm_number = wa_konv-kposn.
wa_pocond-cond_type = wa_konv-kschl.
wa_pocondx-condition_no = wa_konv-knumv.
wa_pocondx-itm_number = wa_konv-kposn.
wa_pocondx-cond_type = 'X'.
wa_pocondx-change_id = 'U'.
APPEND wa_pocondx TO it_pocondx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = wa_konv-ebeln
POHEADER =
POHEADERX =
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING =
NO_MESSAGE_REQ =
NO_AUTHORITY =
NO_PRICE_FROM_PO =
IMPORTING
EXPHEADER =
EXPPOEXPIMPHEADER =
TABLES
return = it_return
poitem = it_poitem
poitemx = it_poitemx
POADDRDELIVERY =
POSCHEDULE =
POSCHEDULEX =
POACCOUNT =
POACCOUNTPROFITSEGMENT =
POACCOUNTX =
POCONDHEADER =
POCONDHEADERX =
pocond = it_pocond
pocondx = it_pocondx
POLIMITS =
POCONTRACTLIMITS =
POSERVICES =
POSRVACCESSVALUES =
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
POPARTNER =
POCOMPONENTS =
POCOMPONENTSX =
POSHIPPING =
POSHIPPINGX =
POSHIPPINGEXP =
POHISTORY =
POHISTORY_TOTALS =
POCONFIRMATION =
COMMIT WORK AND WAIT. -
How to set price list to use in a Document
Hi all,
I have a simple question. I'm trying to insert a draft document into SAP B1 via DI API. I can't seem to find the correct property to set in order to change the price list to use for that draft.
Example: The price list in the Supplier BP is 'Price List 01' and I want to change it only for the current document to 'Price List 02'.
Can you guys help me?
Thanks.
Edited by: Pedro Magueija on Aug 28, 2009 6:11 PM
Edited by: Pedro Magueija on Aug 28, 2009 6:41 PMThat's too bad, since it is possible to do it in SAP B1.
OK, but since I can only change the price for the item, line by line is it possible to force a .UnitPrice = 0 and .PriceAfterVAT = 100.00?
The reason I ask is, the document I'm trying to insert get's it's prices from a source where only VAT included prices are present. So instead of the unit price, I want to set the price after VAT and have SAP B1 calculate the unit price.
I set the BP default price list to a list where no prices are defined, and it works. But has you can imagine, when doing a document in SAP B1 this will cause it to set the prices to 0 on the lines, and the users might get angry at it.
So if you guys have any ideas on how to go around this some other way, please do tell.
Thanks in advance. -
Import Product Price and Condition using LSMW IDoc method
Hi Friends,
I am working on the Product Import to CRM from flat file using LSMW IDoc method using the "CRMXIF_PRODUCT_MATERIAL_SAVE" message type.
I am able to import the entire product with its required details except the Price and its conditions.
Can anyone please let me know which structure or with message type to be used to import the Product Price and condition using the IDoc method.
Please pass on your valuable comments.
Thanking you,
NaveenHi Naveen.
I am doing the same thing but only the product gets created and the details like short text, unit etc. do not get populated. The idoc gets processed successfuly. Can you share the fields that are required to be mapped or are mandatory. -
HI,
I am trying to update the Subcontracting type of PO using 'BAPI_PO_CHANGE'. However i am able to update this field .
Can someone advice me how to do.
My code sample is :
wl_poitem-po_item = l_ebelp.
wl_poitemx-po_item = wl_poitem-po_item.
wl_poitemx-po_itemx = c_x.
*C--material procurement indicator need to update
* the type of procurement
wl_materialind-po_item = wl_poitem-po_item.
wl_materialindx-po_item = wl_poitem-po_item.
wl_materialindx-po_itemx = c_x.
wl_materialind-item_no = wl_poitem-po_item.
wl_materialindx-item_no = wl_poitem-po_item.
wl_materialindx-item_nox = c_x.
wl_materialind-mat_provision = 'S'.
wl_materialindx-mat_provision = c_x.
wl_materialind-sched_line = '0001'.
wl_materialindx-sched_line = '0001'.
wl_materialindx-sched_linex = c_x.
wl_materialind-entry_quantity = wl_poitem-quantity.
wl_materialindx-entry_quantity = c_x.
wl_materialind-plant = wl_poitem-plant.
wl_materialindx-plant = c_x.
wl_materialind-material = wl_poitem-material.
wl_materialindx-material = c_x.
wl_materialind-item_cat = 'L'.
wl_materialindx-item_cat = c_x.
wl_extensionin-structure = 'BAPI_TE_MEPOITEM'.
wl_extensioninx-structure = 'BAPI_TE_MEPOITEMX' .
wl_extensionin-valuepart1+222(1) = '1'.
wl_extensioninx-valuepart1+24(1) = c_x.
APPEND wl_poitem TO tl_poitem.
CLEAR wl_poitem.
APPEND wl_poitemx TO tl_poitemx.
CLEAR wl_poitemx.
APPEND wl_materialind TO tl_materialind.
CLEAR wl_materialind.
APPEND wl_materialindx TO tl_materialindx.
CLEAR wl_materialindx.
APPEND wl_extensionin TO tl_extensionin.
CLEAR wl_extensionin.
APPEND wl_extensioninx TO tl_extensioninx.
CLEAR wl_extensioninx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = l_ebeln
versions = wa_version
TABLES
return = tl_return
* poitem = tl_poitem
* poitemx = tl_poitemx
pocomponents = tl_materialind
pocomponentsx = tl_materialindx
extensionin = tl_extensionin
extensionout = tl_extensioninx.
READ TABLE tl_return WITH KEY type = 'E' TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .
ENDIF.In the above question i mean- I am UNABLE to update
-
URGENT: Updating FISTL field using BAPI_PO_CHANGE
HI Friends,
I am about to update the field FISTL and GEBER in EKKN .
I am using BAPI_PO_CHANGE to update those fields . I have tried passing the fields to the table
POITEM and POACCOUNT in BAPI.
i have also given the values to POITEMX and POACCOUNTX tables .
I have given the BAPI_COMMIT_TRANSACTION also . i have given wait time also . Even then the value is not updated in EKKN table .
What could be reason for value not getting updated .
Is the table to which i am passing in BAPI is ok?
Please help me in this issue , its urgent.
Reward is sureHi Gokul,
Try 'BAPI_PO_CREATE1' and see if you can achieve the result.
*& Report YDM_PO_CREATE *
REPORT ydm_po_create.
*-- Input File Declaration
TYPES: BEGIN OF ty_input_file,
column1 TYPE char50,
column2 TYPE char50,
column3 TYPE char50,
column4 TYPE char50,
column5 TYPE char50,
column6 TYPE char50,
column7 TYPE char50,
column8 TYPE char50,
column9 TYPE char50,
column10 TYPE char50,
column11 TYPE char50,
column12 TYPE char50,
column13 TYPE char50,
column14 TYPE char50,
column15 TYPE char50,
column16 TYPE char50,
column17 TYPE char50,
column18 TYPE char50,
END OF ty_input_file.
DATA: i_input_file TYPE STANDARD TABLE OF ty_input_file,
wa_input_file TYPE ty_input_file.
CONSTANTS: c_path TYPE char20 VALUE 'C:\',
c_mask TYPE char9 VALUE ',*.*,*.*.',
c_mode TYPE char1 VALUE 'O',
c_filetype TYPE char10 VALUE 'ASC',
c_x TYPE char01 VALUE 'X'.
PARAMETERS : p_fname LIKE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
*-- Browse Presentation Server
PERFORM f4_presentation_file.
START-OF-SELECTION..
*-- Read presentation server file
PERFORM f1003_upload_file.
IF NOT i_input_file[] IS INITIAL.
PERFORM split_data.
ENDIF.
*& Form f4_presentation_file
*& F4 Help for presentation server
FORM f4_presentation_file .
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_path = c_path
mask = c_mask
mode = c_mode
title = text-001
IMPORTING
filename = p_fname
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " f4_presentation_file
*& Form f1003_upload_file
*& Upload File
FORM f1003_upload_file .
DATA: lcl_filename TYPE string.
lcl_filename = p_fname.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lcl_filename
filetype = c_filetype
has_field_separator = c_x
TABLES
data_tab = i_input_file
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
ENDFORM. " f1003_upload_file
*& Form split_data
Collect data for creating Purchase Order
FORM split_data .
DATA: i_poitem TYPE STANDARD TABLE OF bapimepoitem,
i_poitemx TYPE STANDARD TABLE OF bapimepoitemx,
i_poitem_sch TYPE STANDARD TABLE OF bapimeposchedule,
i_poitem_schx TYPE STANDARD TABLE OF bapimeposchedulx,
i_acct_*** TYPE STANDARD TABLE OF bapimepoaccount,
i_acct_assx TYPE STANDARD TABLE OF bapimepoaccountx,
i_services TYPE STANDARD TABLE OF bapiesllc ,
i_srvacc TYPE STANDARD TABLE OF bapiesklc,
i_return TYPE STANDARD TABLE OF bapiret2,
wa_header TYPE bapimepoheader,
wa_headerx TYPE bapimepoheaderx,
wa_poitem TYPE bapimepoitem,
wa_poitemx TYPE bapimepoitemx,
wa_poitem_sch TYPE bapimeposchedule,
wa_poitem_schx TYPE bapimeposchedulx,
wa_acct_*** TYPE bapimepoaccount,
wa_acct_assx TYPE bapimepoaccountx,
wa_services TYPE bapiesllc,
wa_srvacc TYPE bapiesklc,
wa_return TYPE bapiret2,
ws_po TYPE bapimepoheader-po_number.
break gbpra8.
wa_services-pckg_no = 10.
wa_services-line_no = 1.
wa_services-outl_no = '0'.
wa_services-outl_ind = c_x.
wa_services-subpckg_no = 20.
APPEND wa_services TO i_services.
wa_srvacc-pckg_no = 10.
wa_srvacc-line_no = 1.
wa_srvacc-serno_line = 01.
wa_srvacc-serial_no = 01.
wa_srvacc-percentage = 100.
APPEND wa_srvacc TO i_srvacc.
LOOP AT i_input_file INTO wa_input_file.
IF wa_input_file-column2 EQ 'HD'.
wa_header-doc_type = wa_input_file-column3.
wa_header-creat_date = sy-datum.
wa_header-created_by = sy-uname.
wa_header-vendor = wa_input_file-column4.
PERFORM conversion_output USING wa_header-vendor
CHANGING wa_header-vendor.
wa_header-comp_code = 'DE03'.
wa_header-purch_org = 'DE03'.
wa_header-pur_group = 'DE1'.
wa_header-vper_start = wa_input_file-column9.
wa_header-vper_end = wa_input_file-column10.
wa_headerx-comp_code = c_x.
wa_headerx-doc_type = c_x.
wa_headerx-creat_date = c_x.
wa_headerx-created_by = c_x.
wa_headerx-vendor = c_x.
wa_headerx-purch_org = c_x.
wa_headerx-pur_group = c_x.
wa_headerx-vper_start = c_x.
wa_headerx-vper_end = c_x.
ENDIF.
IF wa_input_file-column2 EQ 'IT'.
wa_poitem-po_item = wa_input_file-column3.
wa_poitem-short_text = wa_input_file-column6.
wa_poitem-plant = wa_input_file-column8.
wa_poitem-quantity = '1'.
wa_poitem-tax_code = 'V0'.
wa_poitem-item_cat = 'D'.
wa_poitem-acctasscat = 'K'.
wa_poitem-matl_group = wa_input_file-column7.
wa_poitem-pckg_no = '10'.
APPEND wa_poitem TO i_poitem .
wa_poitemx-po_item = wa_input_file-column3.
wa_poitemx-po_itemx = c_x.
wa_poitemx-short_text = c_x.
wa_poitemx-plant = c_x.
wa_poitemx-quantity = c_x.
wa_poitemx-tax_code = c_x.
wa_poitemx-item_cat = c_x.
wa_poitemx-acctasscat = c_x.
wa_poitemx-matl_group = c_x.
wa_poitemx-pckg_no = c_x.
APPEND wa_poitemx TO i_poitemx.
wa_poitem_sch-po_item = wa_input_file-column3.
wa_poitem_sch-delivery_date = sy-datum.
APPEND wa_poitem_sch TO i_poitem_sch.
wa_poitem_schx-po_item = wa_input_file-column3.
wa_poitem_schx-po_itemx = c_x.
wa_poitem_schx-delivery_date = c_x.
APPEND wa_poitem_schx TO i_poitem_schx.
wa_acct_***-po_item = 10.
wa_acct_***-serial_no = 01.
wa_acct_***-gl_account = '0006360100'.
wa_acct_***-co_area = '1000'.
wa_acct_***-costcenter = 'KC010000'.
APPEND wa_acct_*** TO i_acct_***.
wa_acct_***-po_item = 10.
wa_acct_***-serial_no = 02.
wa_acct_***-gl_account = '0006360100'.
wa_acct_***-co_area = '1000'.
wa_acct_***-costcenter = 'KC010000'.
APPEND wa_acct_*** TO i_acct_***.
wa_acct_assx-po_item = 10.
wa_acct_assx-serial_no = 01.
wa_acct_assx-po_itemx = c_x.
wa_acct_assx-serial_nox = c_x.
wa_acct_assx-gl_account = c_x.
wa_acct_assx-co_area = c_x.
wa_acct_assx-costcenter = c_x.
APPEND wa_acct_assx TO i_acct_assx.
wa_acct_assx-po_item = 10.
wa_acct_assx-serial_no = 02.
wa_acct_assx-po_itemx = c_x.
wa_acct_assx-serial_nox = c_x.
wa_acct_assx-gl_account = c_x.
wa_acct_assx-co_area = c_x.
wa_acct_assx-costcenter = c_x.
APPEND wa_acct_assx TO i_acct_assx.
wa_services-pckg_no = 20.
wa_services-line_no = 2.
wa_services-service = wa_input_file-column9.
wa_services-quantity = '100'.
wa_services-gr_price = '100'.
wa_services-userf1_txt = wa_input_file-column13.
APPEND wa_services TO i_services.
wa_srvacc-pckg_no = 20.
wa_srvacc-line_no = 1.
wa_srvacc-serno_line = 02.
wa_srvacc-serial_no = 02.
wa_srvacc-percentage = 100.
APPEND wa_srvacc TO i_srvacc.
ENDIF.
ENDLOOP.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = wa_header
poheaderx = wa_headerx
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING =
NO_MESSAGE_REQ =
NO_AUTHORITY =
NO_PRICE_FROM_PO =
IMPORTING
exppurchaseorder = ws_po
EXPHEADER =
EXPPOEXPIMPHEADER =
TABLES
return = i_return
poitem = i_poitem
poitemx = i_poitemx
POADDRDELIVERY =
poschedule = i_poitem_sch
poschedulex = i_poitem_schx
poaccount = i_acct_***
POACCOUNTPROFITSEGMENT =
poaccountx = i_acct_assx
POCONDHEADER =
POCONDHEADERX =
POCOND =
POCONDX =
POLIMITS =
POCONTRACTLIMITS =
poservices = i_services
posrvaccessvalues = i_srvacc
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM =
ALLVERSIONS =
POPARTNER =
break gbpra8.
LOOP AT i_return INTO wa_return.
ENDLOOP.
ENDFORM. " split_data
*& Form conversion_output
Conversion exit input
FORM conversion_output USING p_ip
CHANGING p_op.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = p_ip
IMPORTING
output = p_op.
ENDFORM. " conversion_output
<b>Reward points if this helps.
Manish</b> -
Delete Service Line in a PO using BAPI_PO_CHANGE
Hi Experts,
I am able to create a new Service line using BAPI_PO_CHANGE in a Purchase Order. But not able to delete the existing service line. In the BAPI return log, it is showing 'PO Changed', still the service line exists.
Please refer the code below and suggest me the changes required to delete the Service line from PO.
Thanks in advance for your help.
DATA: i_tab TYPE STANDARD TABLE OF ty_tab,
w_tab TYPE ty_tab,
poitem TYPE STANDARD TABLE OF bapimepoitem WITH HEADER LINE,
poitemx TYPE STANDARD TABLE OF bapimepoitemx WITH HEADER LINE,
poservices TYPE STANDARD TABLE OF bapiesllc WITH HEADER LINE,
return TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE,
poaccount TYPE STANDARD TABLE OF bapimepoaccount WITH HEADER LINE,
poaccountx TYPE STANDARD TABLE OF bapimepoaccountx WITH HEADER LINE,
posrvaccessvalues TYPE STANDARD TABLE OF bapiesklc WITH HEADER LINE.
poitem-po_item = '10'.
poitem-pckg_no = '0000001329'.
poitem-item_cat = '0'.
APPEND poitem.
poitemx-po_item = '10'.
poitemx-po_itemx = 'X'.
poitemx-pckg_no = 'X'.
poitemx-item_cat = 'X'.
APPEND poitemx.
poservices-pckg_no = '0000001329'.
poservices-line_no = '0000000001'.
poservices-ext_line = '0000000010'.
poservices-service = '000000000005000010'.
poservices-subpckg_no = '0000000000'.
poservices-delete_ind = 'X'.
APPEND poservices.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = '7200000017'
TABLES
return = return[]
poitem = poitem[]
poitemx = poitemx[]
poservices = poservices[].
BREAK-POINT.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
Thanks & Regards,
RevanthIn method BAPI_PO_CHANGE, you can only create service items, you cannot change them.
FU BAPI_PO_CHANGE POSERVICES
Short Text
External Services: Service Lines
Description
This table contains the services and services specifications outline for the purchase order.
Field OUTL_IND is used to flag a line as an outline line. The service lines are assigned to the outline lines using the fields PCKG_NO (for the service line) and SUBPCKG_NO (for the outline line).
The outline hierarchy is mapped using the fields LINE_NO and HI_LINE_NO. Field HI_LINE_NO links to field LINE_NO of the hierarchically superior outline.
Note
In method BAPI_PO_CHANGE, you can only create service items, you cannot change them.
For more information on the individual parameter fields, see the data element documentation in the ABAP Dictionary.
Function Module
BAPI_PO_CHANGE -
Change EBAN-PREIS by using BAPI_PO_CHANGE?
Hi,
Can I use BAPI_PO_CHANGE to change EBAN-PREIS ?
How?Can you give me an esay example please? Cause I have never used a BAPI for updating a standard table!
Thanks a lot -
Error using Bapi_PO_Change for update custom fields
Dear Expert,
I have requirement for update custom field in table ekko. I used BAPI_PO_CHANGE with PO_number as a key. Then i put the value of custom field in segment TABLES - EXTENSIONIN.
But I get error : "ERROR TRANSFERING EXTENSIONIN DATA FOR ENHANCEMENT CI_EKKODB".
When I checked, I found the difference between data type the value for BAPI_PO_CHANGE (Usinf structure BAPIPAREX) and data type for custom field in table EKKO.
Data Type in BAPI_PO_CHANGE is CHAR (you can see in structure BAPIPAREX). And data type for the custom field is DECIMAL.
I found the note '1124803', but the correction note was not applicable for us because our released system is 500.
Is there any suggestion or solution for resolve our problem?
Really appreciate your help.
Thanks.Hi Laxmikanth Bethi ,
I tried with BAPI_PO_CHANGE in level header, and SAP was support the BAPI. And also i tried to appending the same fields in MEPOHEADR & MEPOHEADERX structures, but the problem is the type of my custom fields are DECIMAL, then the type MEPOHEADR & MEPOHEADERX structures are CHARACTER. So i got the error : "ERROR TRANSFERING EXTENSIONIN DATA FOR ENHANCEMENT CI_EKKODB".
Because the types are difference.
Have you any suggestion to solve this problem?
Really appreciate for your input.
Maybe you are looking for
-
The songs on my iphone do not match up to the songs I tried to sync through iTunes
The songs on my iphone 4 do not match up to the songs I tried to sync through iTunes. I manually sync my iPhone with my iTunes and on the music page it says it will sync 283 songs when only one playlist of 12 songs is selected to sync. How do I remov
-
I was sold Apple TV on the premise that I could play games on my ipad3 and see it on my tv. However, all I get is audio! What's the deal? I feel ripped off!!!
-
How to extract a page from an existing PDF to make a new document?
-
LV 7.0 DSC as non administrator user
Hi all, is it possible to run LV 7 DSC as a user not having administrator rights ("at least" power user)? If I try to start LV 7 DSC as a power user, LV 7 wants to install the "Microsoft SQL Server Desktop Engine", but can't because it's not priville
-
Much easier in ASP than Servlets - prove me wrong..please
Be the judge - is ASP better than servlets in this case? Here is the ASP/script segment that can take binary image data stored in a buffer and with one simple method - return that data to the browser - such that the image appears in the requesting br