BAPI_PO_CHANGE, changing condition value in the purchase order

Hi Friends,
I have a requirement,
a flat file is present in the application server that contains the information about PO,PO-ITEM,Condition type, movement type , condition value, plant, storage location .
And i m calling the bapi "BAPI_PO_CHANGE" and passing the po number to it.
the bapi returns the following tables, i_return, i_header,i_cond, i_item,i_itemx.
But the purpose of calling the BAPI is, to check, if the condition value in the specified PO is '0', then it has to replace with the value of condition type present in the flat file.
But when we check the tablei_return, its shows error type.
And the PO is not updated with the new  condition value.
Help me out in sorting this problem, by telling me
what value is to be passed to the respective BAPI and what should i do to solve the issue?
and after that i m using a BAPI " BAPI_GOODSMOVEMENT_CREATE".
and it is for the purpose of creating the GR(Goods Receipt),
when i go through the i_return table of the bapi, it si returning a message that "BAPI_201  Unable to create goods movement".
Help me in proving the input to those bapi's and how can i get the expected output?
And let me know, what the bapi's ,"BAPI_COMMIIT" and " BAPI_ROLLBACK" , will be doing?
Edited by: kumar t on Aug 9, 2008 1:02 PM

HI
[Check the Link|http://abap.wikiprog.com/wiki/BAPI_PO_CHANGE]
[Commit|http://abap.wikiprog.com/wiki/BAPI_TRANSACTION_COMMIT]
[Roll Back|http://abap.wikiprog.com/wiki/BAPI_TRANSACTION_ROLLBACK]
Regards
Pavan

Similar Messages

  • Profit Center Value in the Purchase Order Pricing

    Dear Friends
    I am stuck at a process design step and I need your help to proceed further.
    We have created a new Condition type in MM Purchasing to display the charges incurred towards the inward freights.
    These freight costs vary depending on the Profit center. ( The Profit Center is already included in the Communication Structure KOMP) So We have Profit center field included as one of the field in the Table and in access sequence.
    The Profit center is visible in the item data of the Purchase order in the Account Assignment Tab Page  Under Item Details section.
    But this value is stored in EKKN & not in EKKO or EKPO
    I have created condition records  also.
    Now when I create  a  PO the value is not picked from the condition records. When i looked at Pricing analysis the value for Profit center is Blank.
    So Kindly advice me how can i get the value of the Profit center in the condition records.
    Thanks & Regards
    Srinivas

    Hi,
    We have  a similar scenario with the order type and we created a new field as ZZBSART in the field catalogue.
    included the ZZBSART in to the communciation structure KOMG so that it will be available in the KOMK structure.
    After that, some coding have to be written in the user exit J_117_USEREXIT_FILL_KOMK_KOMP.
    Sample coding for Vendor region
    Select single regio into XKOMK - regio
       Where LIFNR = XKOMK LIFNR
    Try with this and let me know if you have any issues.
    Regards,
    RitiG

  • Which table stores the condition values of a purchase order line item?

    Hi,
    Please let me know the table that stores the condition values of purchase order line items(when we click on conditions tab after selecting an item then we can see the condition types and there is a corresponding condition value for that condition type.
    My requirement is to get the actual price for a purchase order line item(it can be seen in the last line and it is calculated after considering all the condition types) and display this value in a custom report.
    Thanks,
    Ravindra

    Hi Ravindra
    You can find the conditions data for PO in TAble KONV.
    KONV-KSCH is the condition type
    KONV-KWERT is  the cond value
    KONV-KNUMH is the condition doc no. which is there in EKKO field KNUMH.
    So u have to make a link between KONV-KNUMH and EKKO-KNUMH.
    Thanks
    Vijeta

  • BAPI_PO_CHANGE - Change Condition Value

    Hi,
    I want to change the Condition value for a particular Condition type using BAPI_PO_CHANGE.
    I am populating values for following
    Import parameters
    PURCHASEORDER
    POHEADER (Fields PO_NUMBER)
    POHEADERX (Fields PO_PO_NUMBER = X)
    Tables
    POITEM (Fields PO_ITEM, PLANT, STGE_LOC
    POITEMX (Field PO_ITEM, PO_ITEMX = X, PLANT = X, STGE_LOC= X)
    POCOND (Fields COND_TYPE, COND_VALUE, CURRENCY)
    POCONDX (Fields COND_TYPE = X, COND_VALUE = X, CURRENCY = X)
    But PO condition value is not getting changed...
    Regards,
    Balaji Viswanath.

    Hi,
    I got the answer from Naren's earlier post... Given the answer below...
    Hi,
    I believe you can use this BAPI to PO conditions..
    Check this code..
    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.
    DATA: t_cond LIKE bapimepocond OCCURS 0 WITH HEADER LINE.
    DATA: t_condx LIKE bapimepocondx 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.
    t_cond-itm_number = '00010'.
    t_cond-cond_type = 'P000'.
    t_cond-cond_value = '17.00'.
    t_cond-currency = 'USD'.
    t_cond-change_id = 'U'.
    APPEND t_cond.
    t_condx-itm_number = '00010'.
    t_condx-itm_numberx = 'X'.
    t_condx-cond_type = 'X'.
    t_condx-cond_value = 'X'.
    t_condx-currency = 'X'.
    t_cond-change_id = 'X'.
    APPEND t_condx.
    CALL FUNCTION 'BAPI_PO_CHANGE'
    EXPORTING
    purchaseorder = p_ebeln
    TABLES
    return = t_return
    poitem = t_poitem
    poitemx = t_poitemx
    pocond = t_cond
    pocondx = t_condx.
    COMMIT WORK.
    The above code works fine for me...
    Thanks,
    Naren

  • Printing Tax values in the Purchase order

    Hi MM Gurus,
        In the print out of Purchase order, I am getting the Total net value excluding tax
    while the requirement is PO should have the value including the tax. Tax setting is
    maintained and I am getting all the tax values properly in the P.O. but in print out
    tax amount is not coming. How to resolve this? Any configuration required in the
    IMG or is it an ABAP work? Kindly let me know as early as possible.
    Regards
    Yoga

    Hi Yoga,
    It is not clear whether you are using the standard SAP layout for PO printing or you have prepared your own layout. It is also not clear whether you want the %age of tax is to be printed or the value of tax.
    I assume you have prepared your own layout using smartforms.
    You have to get in touch with your ABAPer to modify the smartform for tax %age/amount.
    You can get the table tables using FV13.
    I hope you know how to get those details.
    -Nandu More

  • Retrieve the Purchase Order Condition Records Table

    Hallo!
    I have found this code right here:
    http://www.sap-basis-abap.com/sapab025.htm
    It is very useful particular for purposes which I need. Please can somebody
    try to fix the error to get it working. There is an internal table missing.
    Regards
    Ilhan
    Retrieve the Purchase Order Condition Records Table
    select * from ekko.
           select * from konv where knumv = ekko-knumv
               "Get all the condition records for the purchase order
           endselect.
    endselect.
    * Get the info record conditions record
    * First declare the record structure for the key
    data: begin of int_konp,
                 txt1(5),
                 lifnr(5),
                 matnr(18),
                 txt2(4),
                 txt3(1),
            end of int_konp.
    clear: konh, konp, int_konp.
    * data for the record key konh-vakey
    int_konp-txt1    = '00000'.
    int_konp-lifnr    = ekko-lifnr+5(5).
    int_konp-matnr = ekpo-matnr(18).
    int_konp-txt2    = 'ALL'.
    int_konp-werks = ekpo-werks.
    int_konp-txt3    = '0'.
    select * from konh where      kschl = 'PB00'            "Conditions (Header)
                                         and datab => p_datum.       "valid from date
          if konh-vakey = int_konp.                                  "Conditions (Item)
                 select single * from konp where knumh = konh-knumh.
                 continue.
          endif.
    endselect.

    Hi flora
    Just get through the sequence .
    see the table fields ...
    1. From EKKO table take an entry which is having pricing conditions.
    Now in the fields list check out for field EKKO-KNUMV(document condition number).
    2.Take this condition number and now goto table KONV.
    Give the document condition number in the field  KONV-KNUMV and execute .
    This will lead to a list of document condition numbers and some other fields .
    3.Now check for field KONV-KNUMH ,KONV-KAWRT(quantity) and note the value KONV-KWERT  .
    (Remember this is at header level).
    This is ur condition record number.
    **comments
    Now from document condition number we got the condition record number (KNUMH).
    4. now since u want the item level tax procedure go to table KONP and give the condition record number and execute .
    This will give u a list of details .
    Now concentrate on KONV-KAWRT (scale quantity) KONP-KBETR(rate) as this table will store “Pricing  per UNIT “ so product of these two will give u the total pricing tax, for a particular condition type say PR00  .
    For that particular condition item .
    Check the pricing procedure .
    See t-code VK13 and check the pricing procedure .
    From me23 check the same PO num select the item and check the pricing conditions applicable .
    Select a particular pricing and goto condition->analysis->analysis pricing  ,
    Better take help of a SD functional consultant in the process.
    regards,
    vijay.

  • Account Asssignment in the Purchase order SAP ECC 6.0

    Hi
    I am trying to create Purchase order with Account assignment category "Q"  wherein system displays a GL account (4011100) which is mapped in the OBYC in the transaction GBB and general modification VBR. Further when I enter WBS element, it changes  GL account to  2301100 which is mapped in the transaction BSX. You are requested to kindly let me know what is logic behind GL account change, Is there any setting of WBS element with transaction BSX ?
    Can I change vendor code in the purchase order mofification ME22N before PO release.
    regards
    Sanjay

    Hi,
    For Projects the PRs and POs are the commitements.
    So while creating the PRs and POs the system always looks at the balance sheet account which is mapped in BSX.
    During the actual posting/ Goods issue to project the system will credit this balance sheet account and debit the P/L account from VBR.
    So syetm bahaviour is very much correct.
    Hope its clear,
    Reward point if useful.
    Thanks..

  • Account Assignment in the Purchase order

    Hi
    I am trying to create Purchase order with Account assignment category "Q"  wherein system displays a GL account (4011100) which is mapped in the OBYC in the transaction GBB and general modification VBR. Further when I enter WBS element, it changes  GL account to  2301100 which is mapped in the transaction BSX. You are requested to kindly let me know what is logic behind GL account change, Is there any setting of WBS element with transaction BSX ?
    Can I change vendor code in the purchase order modification ME22N before PO release.
    regards
    Sanjay

    Hi
    If you are using the account assignment category Q, then the account to which it should get posted is the Inventory account
    So the The g/l is getting changed once you give the WBS elemnt.
    After the receipt of stock thsi will get moved into Special Stock with Project.
    Can I change vendor code in the purchase order modification ME22N before PO release.
    Once the PO is craeted Vendor cannot be changed.
    Cancel the PO & create a new one.
    Thanks & Regards
    Kishore

  • Change condition in already invoiced Sales Order

    Dear all,
    Could you please help me with following questions?
    Is it possible to add/change condition types on the sales order (header and item level) for which invoice has been created already?
    I mean is it possible to add some surcharge condition to already invoiced order and than as result debit memo?
    And one more question : Are there some time restrictions when debit/credit memo can be created? (I believe not, but I would like to have this confirmed, as I am not SD expert.)
    Thanks in advance for all replies,
    Cheers,
    Milan

    Hi,
    Here are the answers to your question
    > Is it possible to add/change condition types on the sales order (header and item level) for which invoice has been created already?
    I mean is it possible to add some surcharge condition to already invoiced order and than as result debit memo?
    The answer is No. You cannot add or change the condition once it is invoiced.
    > And one more question : Are there some time restrictions when debit/credit memo can be created? (I believe not, but I would like to have this confirmed, as I am not SD expert.)
    The answer is No again. There is no time restriction and you can create debit or credit memo immediately when the invoice is released to accounting.
    Hope this helps
    Thanks
    Mukund S

  • Change the Purchase Order : Item - Conditions value

    Hi,
    How to change the Purchase Order : Item - Conditions value.
    In my PO, Item conditions shows the SKTO - Cash Discount value is 0. I want to change the Discount value 10.
    How can i change it??

    Hi,
    Goto the Transaction code MN05 and give the CONDITION TYPE SKTO and change the value
    MN05 is the Transaction code for Purchase order  condition types.
    Please check and revert back if you need more details.
    regards,
    santosh

  • Changing the Condition type Text in the Purchase Order

    Hi SAP,
    Hi,
    We have a requirement where by we need to change the Description of the condition type text in the Purchase order.
    The condition type is a entered at item level.
    Normally this description comes from the Condition type Definiton i.e., T685T-VTEXT.
    can any one of you suggest a User exit or a method where by we can change this text at PO.
    Has any one of you came across such situation before. if so please provide me with your inputs.
    Thanks
    Best Regards
    ShitalD
    Edited by: Shital Deshpande on Feb 21, 2010 1:07 PM

    Hi,
    I think it is a config setting..Please check with your functioal consultant regarding the same.. I won't suggest to change the standard SAP table T685T but you can keep it as last option .
    From SPRO you can follow the below path
    Sales and Distribution->Basic Functions -> Pricing > Pricing Control -> Define condition types.
    Regards,
    Nagaraj

  • User Exit / BAdI to update the pricing conditions of the Purchase Order

    Hello SAPients,
    This is my requirement:
    "Copy the Pricing Conditions from the Shipment Cost Document (VI01 / VI02) to the automatically generated Purchase Order".
    I'm using the enhancement V54U0002 (Function Module EXIT_SAPLV54U_002) to EXPORT  the values of the Pricing Conditions to memory and I have used the enhancement MM06E005 ( FM EXIT_SAPMM06E_006, 007, 012, 013, 014, 016, and 017) to IMPORT the values from memory and store them in TKOMV. But, when the PO is generated the values don't stay, they are always changed with the standard PBXX pricing conditions.
    My question is: Does anyone know the User Exit / BAdI that I can use to change the Pricing Conditions of the Purchase Order?
    <<removed_by_moderator>>
    Thanks!
    Edited by: Vijay Babu Dudla on Jan 14, 2009 11:08 PM

    >
    kartik tarla wrote:
    > check this badi
    > ME_PROCESS_PO_CUST
    >
    > and the following user exit
    > Goto-> include RV61AFZA then search for
    > USEREXIT_PRICING_RULE see if its helpful to u.
    Hello Kartik / SAPients,
    I tried with ME_PROCESS_PO_CUST but didn't work. The system doesn't execute that code. Any other idea would be greatly appreciated.
    Thanks.

  • Change of Sales Order  automatically changes the purchase order

    Hi 
       I am working on a scenario where a  as soon as a sales order is created it will also create a purchase order on plant which will supply the item to the plant on which sales order is created.This works fine.
    Now when I change sales order( order qty ,requested delivery date, new item added) . On saving the sales order it should change the purchase order which has already been created by updating the schdule lines in the purchase order with new values from the sales order. It is all in same SAP instance.
    Here are possible ways I can think of:-
    1 Change of SO will create a SO IDOC . The SO IDOC should supply required values to the PO Idoc . The PO IDOC should get posted to SAP to change the existing PO.  Client does not have XI so we cant use XI for conversion.
    2 Changing a SO will trigger workflow.The Workflow executes ABAP program which takes data from SO and calls BAPI to change the purchase order and sends notification that PO has changed.   Which BAPI?
    Any thoughts are welcome. We are on 4.7 and we dont have XI. So please do not suggest XI based solution.
    Prashanta

    Prashanta,
    For your 2nd part of question, you can use 'BAPI_PO_CHANGE' to change the PO.
    Thanks

  • Excise rate and value is not getting defaulted from the purchase order

    Hi all,
    While capturing excise invoice , the excise rate and value is not getting defaulted from the purchase order and in Excise Item Tab BED,AED,ECS is Zero at both header as well as item level for only one material in STO process and if we are doing same process taking other material all things are coming perfectly and We are maintaining condition with respect to vendor,plant and material combination.Any input related to this will be helpfull and rewarded.
    Regards
    Vishal

    Hi,
    Follow STO Process for this;
    1.Create a vendor for the company code of receiving plant, using account group: 0007 using T-Code XK01.
    2. Assign this vendor to Delivering plant
    Go to XK02 >Purchasing view>Extras>Add. Purchasing data>Plant
    3. Create internal customer with the sales area of the vendor. Go To XD01
    4. In pricing procedure determination relevant to STO, assign document Pricing Procedure and customer pricing procedure appropriate for STO to get the pricing in the invoice.
    5. Maintain condition records for the relevant pricing condition.
    6. Some more setting for STO: Go to MM> Purchasing > Purchase Order > Set up STO > define shipping data for plants > Go to Receiving plant >assign customer here & Supplying SA (for billing) to Receiving plant here
    7. Go to MM > Purchasing > Purchase Order > Set up STO > define shipping data for plants > Go to Supplying plant and assign the sales area of receiving plant.
    8. Go to MM > Purchasing > Purchase Order > Set up STO > assign delivery Type & Checking rule
    Assign the delivery type to document type. In this case, Delivery type NLCC is assigned to Document type NB
    9. Go to MM> Purchasing > Purchase Order > Set up STO > Assign document Type, One step Procedure, Under delivery tolerance
    Assign the document type NB to supplying plant and receiving plant
    10. After all settings, Create the STO using T-Code: ME21N and maintain pricing conditions of freight and Save.
    11. In supplying plant Maintain condition record in sales using VK11 the same will flow in receiving plant when referring the OBD no during MIGO.
    10. Create Delivery: VL10G
    12. Picking, PGI: VL02N
    13. Billing: VF01
    Save the document and its done
    14. J1IIN - Outgoing Excise Invoice
    15. MIGO - Goods Receipt against outbound Delivery
    16. J1IEX - Capture & Post Excise Invoice
    Rgs

  • Add Z conditions in the Purchase Order

    Hi Gurus,
    We have created a Z condition in the RM0000 pricing procedure and we have addded a requirement and Formula for the same.
    If the requirement matches, then Formula is executed for assigning value in this condition. Now, when I try to create Purchase Orders using transaction ME59n, it works fine. Condition is added in the purchase orders that match the requirement.
    Now, when I try to create the purchase order through a background job, condition is not getting added in it. I debugged the background job, and requirement is satisfied for the Purchase Order.
    Can anyone help me in this issue.
    Thanks in Advance,
    Amit Rai

    I have scheduled a job using transaction SM36, that runs the program RM06BB30 (transaction ME59n) in the background.
    Regards,
    Amit

Maybe you are looking for