BAPI_PO_CHANGE add line

Hello
I have read all possible topics regarding my problem but still i did manage to add a line in my PO.
I want to copy the existing purchase order lines and add new lines with another purchase requisition.
I appended the po lines to the table POITEM and added de po item number in the POITEMX table but still i just get the error message : item XXX does not exist
It is refering to the item number that i gave for the items to be added.Which is the indicator telling the bapi to add the lines?
thank you

Well,i have managed to create PO lines with this BAPI_PO_CHANGE fm,bellow is the code:
we have to set the X mark for the mandatory fields that need to be inserted,just like the ones that you have to provide in ME22N when adding a line.This X marks are enterred only for the lines to be added,so,for the existing ones i have not added any X in the X tables.
In the tables LT_POITEM,  LT_POSCHEDULE and LT_POACCOUNT i have all the lines that are already existing in the PO and additional i have added new entries with all the fields that are bellow filled with custom  po item number.
            LT_POITEMX-PO_ITEM = LV_ITM.
            LT_POITEMX-PO_ITEMX = 'X'.
            LT_POITEMX-ACCTASSCAT = 'X'.
            LT_POITEMX-SHORT_TEXT = 'X'.
            LT_POITEMX-QUANTITY = 'X'.
            LT_POITEMX-PO_UNIT_ISO = 'X'.
            LT_POITEMX-PLANT = 'X'.
            LT_POITEMX-NET_PRICE = 'X'.
            LT_POITEMX-PRICE_UNIT = 'X'.
            LT_POITEMX-MATL_GROUP = 'X'.
            LT_POITEMX-ORDERPR_UN = 'X'.
            LT_POITEMX-PREQ_NO = 'X'.
            LT_POITEMX-PREQ_ITEM = 'X'.
            LT_POITEMX-PREQ_NAME = 'X'.
            APPEND LT_POITEMX.
            LS_POACCOUNTX-PO_ITEM = LV_ITM.
            LS_POACCOUNTX-PO_ITEMX = 'X'.
            LS_POACCOUNTX-GL_ACCOUNT = 'X'.
            LS_POACCOUNTX-NETWORK = 'X'.
            LS_POACCOUNTX-ACTIVITY = 'X'.
            APPEND LS_POACCOUNTX TO LT_POACCOUNTX.
            LS_POSCHEDULEX-PO_ITEM = LV_ITM.
            LS_POSCHEDULEX-DELIVERY_DATE = 'X'.
            APPEND LS_POSCHEDULEX TO LT_POSCHEDULEX.
CALL FUNCTION 'BAPI_PO_CHANGE'
        EXPORTING
          PURCHASEORDER                = LS_RSDB-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                        = LT_RETURN
         POITEM                        = LT_POITEM
         POITEMX                       = LT_POITEMX
        POADDRDELIVERY               =
         POSCHEDULE                    = LT_POSCHEDULE
         POSCHEDULEX                   = LT_POSCHEDULEX
         POACCOUNT                     = LT_POACCOUNT
        POACCOUNTPROFITSEGMENT       =
         POACCOUNTX                    = LT_POACCOUNTX

Similar Messages

  • BAPI_PR_CHANGE : Add line items

    I've read some contradicting posts regarding bapi: BAPI_PR_CHANGE. I was under the impression you could add line items to a requisition using this BAPI? Can it be said for certain it can not be done? The documentation is rather lacking.
    Thanks!
    Enrique Leon

    it's very easy to do this with this BAPI.
    If you have experiences with BAPI_PO_CHANGE you have done this within some minutes.
    Here's some sample-coding. Maybe this will help you:
    LOOP AT it_change_pr INTO wa_change_pr.
        ADD 10 TO lv_pr_counter.
        wa_pritem-preq_item      = lv_pr_counter.                "Item Number of Purchase Requisition
        wa_pritem-material       = wa_change_pr-orig_matnr.  "Materialnumber
        wa_pritem-plant          = lv_plant.                 "Plant
        wa_pritem-pur_group      = lv_pur_group.             "Purchasing Group
        wa_pritem-store_loc      = lv_store_loc.             "Storage Location
        wa_pritem-quantity       = wa_change_pr-menge.       "Purchase Requisition Quantity
        wa_pritem-unit           = wa_change_pr-meins.       "Purchase Requisition Unit of Measure
        wa_pritem-del_datcat_ext = lv_del_datcat.            "Date type (day, week, month, interval)
        wa_pritem-deliv_date     = lv_deliv_date.            "Item Delivery Date
        wa_pritem-fixed_vend     = wa_change_pr-lifnr.       "Fixed Vendor
        CLEAR: temp_matnr.
        CONCATENATE '0000000000' wa_change_pr-matnr INTO temp_matnr.
        SELECT SINGLE * FROM mbew
          WHERE matnr = temp_matnr
          AND   bwkey = wa_change_pr-werks.
        IF sy-subrc = 0.
          wa_pritem-preq_price   = mbew-stprs.                "Price in purchase requisition
          wa_pritem-price_unit   = mbew-peinh.                "Price Unit
        ENDIF.
        wa_pritem-purch_org  = lv_purch_org.                "Purchasing Organization
    **    wa_pritem-po_unit    = wa_change_pr-meins.        "Purchase Order Unit of Measure
        wa_pritem-vend_mat   = wa_change_pr-matnr.          "Material number used by vendor
        wa_pritemx-preq_item      = lv_pr_counter.
        wa_pritemx-preq_itemx     = 'X'.
        wa_pritemx-material       = 'X'.
        wa_pritemx-plant          = 'X'.
        wa_pritemx-store_loc      = 'X'.
        wa_pritemx-pur_group      = 'X'.
        wa_pritemx-quantity       = 'X'.
        wa_pritemx-unit           = 'X'.
        wa_pritemx-del_datcat_ext = 'X'.
        wa_pritemx-deliv_date     = 'X'.
        wa_pritemx-fixed_vend     = 'X'.
        wa_pritemx-preq_price     = 'X'.
        wa_pritemx-price_unit     = 'X'.
        wa_pritemx-purch_org      = 'X'.
        wa_pritemx-vend_mat       = 'X'.
        APPEND wa_pritemx TO it_pritemx.
        APPEND wa_pritem TO it_pritem.
      ENDLOOP.
      CALL FUNCTION 'BAPI_PR_CHANGE'
        EXPORTING
          number                      = lv_banfn
    *   PRHEADER                    =
    *   PRHEADERX                   =
    *   TESTRUN                     =
    * IMPORTING
    *   PRHEADEREXP                 =
    TABLES
         return                      = it_change_return
         pritem                      = it_pritem
         pritemx                     = it_pritemx
    *   PRITEMEXP                   =
    *   PRITEMSOURCE                =
    *   PRACCOUNT                   =
    *   PRACCOUNTPROITSEGMENT       =
    *   PRACCOUNTX                  =
    *   PRADDRDELIVERY              =
    *   PRITEMTEXT                  =
    *   PRHEADERTEXT                =
    *   EXTENSIONIN                 =
    *   EXTENSIONOUT                =
    *   PRVERSION                   =
    *   PRVERSIONX                  =
    *   ALLVERSIONS                 =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    * EXPORTING
    *   WAIT          =
    * IMPORTING
    *   RETURN        =

  • Urjent-how to add line items in tcode-FBL3N

    Hi Experts,
      How to add line items customer, customer name,  vendor and vendor name in FBL3N.
    Thanks in advance.
    mahe
    Moderator message - Please do not use words like "urjent". Please ask a specific question. Please search the forum. This question has been asked and answered before. Post locked
    Edited by: Rob Burbank on Apr 29, 2009 11:27 AM
    Edited by: Rob Burbank on Apr 29, 2009 11:28 AM

    Hi,
    Check the BTE's:
    00001020     POST DOCUMENT:       Prior to final checks             SAMPLE_INTERFACE_00001020
    00001025     POST DOCUMENT:       Final checks completed       SAMPLE_INTERFACE_00001025
    00001030     POST DOCUMENT:       Posting of standard data     SAMPLE_INTERFACE_00001030
    00001050     POST DOCUMENT:       Accounting interface           SAMPLE_INTERFACE_00001050
    Thanks & Regards,
    Harish

  • EXIT to change / add line items during STO PO creation in T.Code ME21N

    Hi
    Can somebody suggest me a EXIT or a BADI  to change / add line items during STO PO creation in T.Code ME21N.
    The requirement is as below.
    When the user enters a material no ( which has a BOM created in CS01), and presses enter or saves the PO, i need to get the sub components of the BOM and populate them as the next line items.
    This is because the user needs to create the delivery with reference to the PO. In the delivery, the BOM material needs to be populated with all the sub components of the BOM.
    I tried to do it using EXIT_SAPMM06E_013 in which i am able to change / add the line items in the XEKPO and YEKPO internal tables. The entries are available in the internal table when the EXIT is executed.
    But when the PO is posted internally, the item is not changed/added.
    Thanks in advance.
    Guna.

    Hi,
    Try BADI "ME_PROCESS_PO_CUST".
    cheers,

  • RWIN to automatically add line items in FI document

    Hi all!
    I wish to know if is possible to automatically add line items in a FI document via RWIN and how.
    My final goal is the following:
    A user try to create an FI document with FB01 transaction.
    He/She insert the appropriate line items manually.
    He/She press the "Simulation" button
    In simulation screen there are user's line items, PLUS some more that are necessary in some circumstances.
    Is it possible to achieve this scenario?

    Hi Marinos,
    i think it's  possible via table <b>TRWPR</b> and an
    appropriate function module but it's hold for a modification by SAP.
    other possible solutions:
    - user exit ?
    - interface ( e.g. Intranet-appl. / excel)
      and posting via RFBIBL00 / BAPI
    regards Andreas

  • Automatically add line-items to Sales order

    Hello,
    Our client needs us to add line items to sales orders. The requirement is such that, when the users enter a material on a line item, they wish to see few more materials automatically added as new line items -- item category to be maintained as "Free" items. This appears similar to automatically getting BOM-sub-items for materials which have BOMs maintained. The client is not willing to maintain BOMs for materials in question. They instead have asked us to maintain sub-item materials in a Z-table and then fetch those to populate the subsequent line-items on the sales order.
    So far, we have tried to fiddle around with the XVBAK and XVBAP internal tables in sales exit (MV45AFZZ) and also tried to use BAPI within the same exit. Both methods do not work.
    Could you please guide us ? Thank you.
    Regards,

    Hi,
    I think you can try with product proposal(Item Proposal). T.Code:VA51.
    Using this one can create list of items to be proposed at the time sales order processing.
    Item proposal contains list of items with or without default quantities those were frequently ordered by the customer. You can create any no of items in an Item proposal.Like wise you can create any no.of item proposals.
    But,You can assign only one item proposal per customer in sales tab of the CMR.So that when ever you are creating order for that customer you can access those materials which are listed in an Item proposal completely or selectively,with or without default quantities.
    The items which are proposed from an Item proposal are always changeable.
    Item proposal makes sales order processing simple and fast.
    Only the thing here is it will not automatically explode like in case of BOM.You have to manually select those items from an item proposal.
    Regards,
    Revan
    Edited by: REVAN on Dec 23, 2008 10:55 AM

  • Automatically add line-items to sales orders

    Hello,
    Our client needs us to add line items to sales orders. The requirement is such that, when the users enter a material on a line item, they wish to see few more materials automatically added as new line items -- item category to be maintained as "Free" items. This appears similar to automatically getting BOM-sub-items for materials which have BOMs maintained. The client is not willing to maintain BOMs for materials in question. They instead have asked us to maintain sub-item materials in a Z-table and then fetch those to populate the subsequent line-items on the sales order.
    So far, we have tried to fiddle around with the XVBAK and XVBAP internal tables in sales exit (MV45AFZZ) and also tried to use BAPI within the same exit. Both methods do not work.
    Could you please guide us ? Thank you.
    Regards,

    Ist method:
    Maintain one Ztable with the fields of Material and sub materials.
    write BDC to create order,before entering the material  number check if material is existed in Ztable or not.
    If it exist take that material and added as a another line item.
    if not exist create like normal line item.
    2 nd method:
    Ask your MM functional consultant to maintain supression of materials concept.

  • How to add line series dynamically to a line chart in flex?

    hi..i need to add line series dynamically to a line chart..depending on an array..the application is this..i have an array which stores the details of the users connected to an fmi server..the chart should display the bandwidth of each client..so the users should be added and removed from the chart dynamically...

    Hi
    1.I am giving you solution for dynamically adding values to the dropdown
    public void addValue( )  //Method Name in Component controller
        //@@begin addValue()
              IWDNodeInfo nodeinfo = wdContext.nodeNodeTestData().getNodeInfo();// Node should be map to the view's Node
              IWDAttributeInfo att = nodeinfo.getAttribute("VechileTypes");// Attribute by which dropdown in bound//
              IModifiableSimpleValueSet svSet = att.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
              svSet.put(wdContext.currentNodeTestDataElement().getInpAtt(),wdContext.currentNodeTestDataElement().getInpAtt());
        //@@end
    2.   wdThis.wdGetLangCompController().addValue(); // call this method in the point where u want to add values to the dropdown.

  • Is there a way to add line numbers in the margin?

    Is there a way to automatically add line numbers in the margin of a document?

    Hi Brian,
    If you go with Peter's suggestion, there are some details that since I've got a minute here, I'll mention...
    Set your Line Spacing for the document text to "Exactly" before you begin adjusting your table, otherwise you will have registration problems.
    Your Table will have to be a Floating object. Otherwise you won't be able to slide it into the margin. And, speaking of the margin, stay out of the gray area with the numbers if you want to print them. The gray border around your document is the area that the printer driver says is non-printable.
    In the Table Inspector, set Columns to 1 and Rows to 20 or whatever you prefer for your document. Set the number of Header Rows to 0.
    To apply the numbering, use the Fill feature: Type 1 in the first cell, type 2 in the second cell. Select both cells. Grab the Fill Handle in the lower right corner of the selection and drag it down to add a series of numbers to the rest of the column. (Easier than typing.)
    Decide how you want to justify the numbering. The Text Inspector has both vertical and horizontal justification controls for this. Just select the entire table and make the settings.
    Set the cell height to match the text line spacing. You can get close with the table row height, and maybe closer with a minor line spacing adjustment. Don't expect perfection, but you can get pretty close.
    You probably don't want the cell borders to show, so with the entire table selected, go to the Graphic Inspector and set Stroke to None.
    Lastly, cause the table to appear on every page by doing: Format > Advanced > Move Object to Section Master.
    Regards,
    Jerry

  • I somehow managed to add lines on my master slide and can't get rid of them.  I now have a useless rectangle on the left half of many of my slides.  How do I remove this?

    I somehow managed to add lines on my master slide and can't get rid of them.  I now have a useless rectangle on the left half of many of my slides.  How do I remove this?

    Select the master slide,
    copy any objects you want to keep,
    Select all, (command A), and press delete key.
    Paste back the items to retain (Command V)

  • UDO type Document, Add lines

    Hi All,
    I have a problem with a User Defined Object of type Document/Document Lines.
    I have a custom form for the UDO. I can add new Documents with one or more Document Lines. These are stored in the database as expected, both Father table and Child table is updated. I can also update existing entries through the UDO, but I can NOT add new Document Lines to an existing Document.
    I can add the lines in the matrix of the form, but they are not written to the Child table when I press Update. There is no error messages or anything, the new lines are just not written.
    Any suggestions?
    Best regards
    Jesper Carstensen

    When you add a line to the matrix did you increase the size of the datasource as well?
    A sample of code to add line:
    dbMOR1.InsertRecord dbMOR1.Size
    dbMOR1.Offset = dbMOR1.Size - 1
    m_oMatrix.AddRow 1
    (dbMOR1 is the satasource of the child table that is bound to the matrix columns).

  • Project Server 2007: use cannot add lines to or recall timesheet

    I have a certain user that, for some reason, cannot use the Add Lines or Recall Timesheet function in Project Server 2007 SP3. The weird thing is, it works on another laptop, so it must be something related to the user's machine - but I'm baffled as to what
    the exact cause may be.
    There's no error what so ever - no Error On Page as is pretty common with these behaviors.
    Here's what I've tried so far:
    - Internet Explorer 8 version is supported
    - Deleted ActiveX controls, but these don't seem to be a prerequisite for Timesheets
    - IE Compatibility mode on/off
    I have no idea what else to check, and I want to make sure I've tackled everything before escalating this to SysOps for a browser/OS reinstall.

    Hi DMachiels,
    Have you tried to refresh your IE session deleting the cache (CTRL F5)?
    Also ensure that the PWA URL is include in the IE trusted sites (intranet and internet).
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • How to add line item to sales order item table?

    Kindly help me the with the below requirement .
    Add line item to sales order(va01) dynamically on click of button. The button is also custom created push button.
    In the above requirement I have added the pushbutton to va01 tcode. But when I click on that button I need to add line item to sales order item table.
    I tried a lot but I am not successful. If possible can u please help on this.
    Regards,
    Rachel

    Hi!
    It's quite easy even in the standard SAP to add a line item for a customer order, I don't think it worth to develop a new button for this.
    However if you wanted to add a line automatically, the you can do the following in the program MV45AFZZ, FORM USEREXIT_SAVE_DOCUMENT.
    You can use similar code, but with some modifications.
    DATA: lv_posnr.
    LOOP AT xvbap.
    MOVE xvbap-posnr TO lv_posnr.   "get the last posnr
    ENDLOOP.
    ADD 10 TO lv_posnr.
    MOVE 'XYZ' TO xvbap-matnr.   "enter your material number here
    MOVE lv_posnr TO xvbap-posnr.
    * fill additinal field data in XVBAP if necessary
    MOVE 'I' TO xvbap-updkz.                  "Insert line
    APPEND xvbap.
    Regards
    Tamá

  • PO PLD Add line text....

    Respected All,
    In Purchase order PLD  in item description  i want to add line Text in same table of item description how i can do this.
    Regards
    Mangesh

    Hi
    Please kindly check the following tips to see if this can be helpful to some extend:
    1) Enlarge repetitive area to 40 for example and tick box u201CHeight Adjustmentu201D
    2) Create a calculation field on the very left side in the new row of the repetitive area => Line  No.
    Create appropriate boarders as well
    3) Create a data field for the text :
    Tables:Purchase Order-rows
    Column:text
    Note: On the u201CFormatu201D tab in the parameter u201CLine Breaku201D Choose u201CDivide into rowsu201D
    4) Create a text field and call up the tab u201CVariableu201D and select variable 157 and write u201CTypeu201D in the text field.  In the u201CGeneralu201D  tab un-tick the u201Cvisibleu201D tick box
    5) Create another text field and give the value u201CTu201D and un-tick as well the u201Cvisibleu201D tick box on the u201CGeneralu201D tab. In the u201CGeneralu201D  tab un-tick the u201Cvisibleu201D tick box
    6) Create a calculation field
    Type: Formula
    Field 1: the variable field from point 4)
    Operation: Not Equal
    Field 2: the text field created in step 5)
    Un-tick the u201Cvisibleu201D checkbox on the u201CGeneralu201D tab
    7) Link the u201CGeneral Rowu201D number field of the u201Ctext rowu201D to the calculation field from step 6)
    Locate the exclusive number of the calculation field either via the field index table or from the u201CGeneralu201D tab of the field properties of the calculation field.
    8)  Create a calculation field
    Type: Formula
    Field 1: the variable field from point 4)
    Operation: Equal
    Field 2: the text field created in step 5)
    Un-tick the u201Cvisibleu201D checkbox on the u201CGeneralu201D tab
    9) Link the u201CGeneral Rowu201D number field of the u201Citem rowu201D to the calculation field from step 8)
    Locate the exclusive number of the calculation field either via the field index table or from the u201CGeneralu201D tab of the field properties of the calculation field.
    10) Link each filed, except the u201CGeneral Row No.u201D field, of the item and the text line to itself.e.g. use the index to locate these.
    These fields should be: quantity /item no/price/total etc.
    And link as well the data field created in step 3) to itself.
    Best Regards
    Helen Sun
    SAP Business One Forums Team

  • System should not allow to add line items in delivery

    Hi,
    1) system should not allow to add line items in delivery( in reference to sales order or STO)
    2) sales order/STO should not be changed if delivery exists
    how to control the above
    Alec

    Hi Lakxmi,
           I found answer for 1st point from you are old answers.
          can you throw somelight on 2nd point.
    Thanks
    Anil

Maybe you are looking for

  • How can I debug a problem with the 3g data connection on my iPhone 4s?

    This question didn't get any answers in the "Using iPhone" forum. Thought I would re-ask here. Note, I had to reset the network again today 2 days after the last reset: I've been having intermittent problems with my 3g data connection on my iPhone 4s

  • What are the functions of tables in ods

    Hi, what are the functions of tables in ods. new data table change log table active data table. How 0recordmode work with these 3 tables. and how sid will work with ods? can anyone give detailed explanation. please do not give sap help links. Thanks,

  • UDF's are gone after installing SP1

    I loaded the Webtools 6 SP1 and now my UDF's are not there in SAP (BP, Warehouses, etc..) I do not see anything different on my Synch Manager, and I am getting errors..in webtools Invalid currency - must be ISO 2417 compliant? What is that? My theme

  • Oracle 8.0.6 to Oracle 10G Upgrade Query

    Hi, I have a customer that has Business Objects Release 5.1.x accessing an Oracle 8.0.6 database. They are planning to migrate the database to Oracle 10G Release 2.0 Will Business Objects Release 5.1.x reports run off their upgraded Oracle 10G Releas

  • Hi, I need help extracting a video in the best HD, got this not so great test:

    Hi everyone, I've recently purchesed the Premiere Elements 9, I use the Panasonic HDC HS700 which is a great camera... I tried like a million times to export a video with different HD settings but I can't find the ultimate to show the real quality of