Adding line items in BAPI_PO_CHANGE

Hi,
i am using BAPI_PO_CHANGE and i have already created po line item under one PO. Now i want to add more line items under the same document number. How can i do that using BAPI_PO_CHANGE.
Thanks

Hi
Populate the following strucuture in the BAPI
PURCHASEORDER = PO Number
Tables :
POITEM    = itab_item
POITEMX  = itab_itemx
where in the Itab_item fill in the item details and mark X in the corresponding fields in itab_itemx.
also call the BAPI_TRANSACTION_COMMIT  so that the data would be saved.

Similar Messages

  • Adding line item prior to ACC_DOCUMENT03 Posting

    Due to our legacy currency alignment on some systems being incongruent with our SAP ECC 6.0 environment, some upstream inbound IDocs will post with 2 decimals for HUF when 6.0 environment has 0 decimals for HUF.  The inbound documents are coming in as ACC_DOCUMENT03 IDocs.
    There will be rounding involved.  iN certain cases, the rounding will mean that the line items are no longer in balance.
    Rather than alter the value of the inbound line items, preference is to add line item prior to posting that contains the balance difference and posts to the "rounding difference" account.
    Has anyone expereinced this situation before? How was it resolved?
    Considered adding line item via "BAPI_ACC_DOCUMENT_POST" or, if possible, within "'BAPI_INCOMING_INVOICE_CREATE'".
    Has anyone faced this or a simlar issue before?  How was it resolved?  Was it resolved internally?

    Hello Weng,
    I also looked on SAP notes. 
    There is a note with much information about Tax Postings with accounting BAPIs and it's a consulting note.  The note number is 626235.
    Regards,
    Rae Ellen Woytowiez
    Edited by: Rae Ellen Woytowiez on Dec 21, 2010 10:11 PM

  • Adding a new schedule line for a line item using bapi_po_change

    hi experts,
    can i know how to add a new schedule line for a line item using<u> bapi_po_change</u>. what are the parameters that need to be filed. i filled poitem with total quantities and poschedule table with 2 different schedule lines and passing as the parameter.but then i get the error saying item 0000 doesnt exist

    Hi,
    Please check if you have properly populated the following fields in POSCHEDULE:
    PO_ITEM
    SCHED_LINE
    and the other fields required for your schedule line such as delivery date and quantity, etc.
    After that, make sure to properly populate fields in POSCHEDULEX:
    PO_ITEM -> same value as found in POSCHEDULE
    SCHED_LINE -> same value as found in POSCHEDULE
    All other values populated in POSCHEDULE should be ticked as 'X' in POSCHEDULEX.
    Kind Regards,
    Darwin
    Kind Regards,
    Darwin

  • Adding line items in to a PO and PR using a Bapi

    I need to change PO and PR and add several line items to each of them .
    Can addition of line items to Pr and PO be achieved via a Bapi .
    Please suggest.
    Many Thanks

    Hello Aditi,
    About Purchase requisition, unfortunately you cannot add new item with BAPI_REQUISITION_CHANGE,
    you have to create a your own bapi, but this is a long process to do (I think could take 2-3 days or more).
    About Purchase Order ( BAPI  BAPI_PO_CHANGE ) you just have to specify all the data for the          
    new line including the item number.  Be sure to put the new item number in the field PO_it in tables POITEM, POITEMX POSCHEDULE...
    Regards,
    Mauro

  • Error when adding line items in a Contract

    Hi All,
    Need your help regarding the following issue.
    The business user is trying to edit (to add more line items/materials) a contract with customized T.Code ZGME31K.
    Getting error "Enter rate USD / rate type M for 11/24/2009 in the system settings" MSG No. SG105.
    However, the Vendor, Material all are maintained in the same currency i.e. USD.
    So, not finding a scope of rectification in OB28.
    Please advice.
    Regards,
    Milan.

    Hi,
    I closed
    Re: SBWP attachment link not diverting to Contract/P.O
    as my problem got resolved.
    And I put it "unanswered" as no one gave me the correct answer.
    It came out as a result of several testing in Quality by our team. Anyway, thanks to everyone who contributed.
    Regards,
    Milan.

  • Module Pool Programming adding line items.

    Hi,
    I am Doing Module Pool Programming in which I Should add line items and if the user gives the save button the data wil be saved in  tables and SAP should generate one unique number.
    Please give me inputs how to generate unique number and add n number of line items
    correct inputs are rewarded
    Thanks
    Rasheed.

    Hi,
    You may use Number Generator for generating unique ids in the system.
    The keyword DEFAULT SERIAL  gets a number generator for positive integers and can only be specified for columns that have the data type INTEGER, SMALLINT, and FIXED without decimal places (SERIAL).
    The first value generated by the generator can be defined by specifying an unsigned integer (must be greater than 0). If this definition is missing, 1 is defined as the first value.
    If an INSERT statement inserts the value in this column, you get the current number generator value and not the value 0.
    Each table may not contain more than one column with the DEFAULT specification DEFAULT SERIAL.
    Regards,
    Renjith
    Edited by: Renjith Michael on Oct 23, 2008 11:34 AM

  • [CRM] Check the order after adding line items

    As an enhancement, I've created a piece of code that determines the default quantity for an item. On its own, it works as intended.
    When creating a new contract based on a template, the same default quantity coding is being executed, thereby - in most cases - adding the quantity of 1 for the items.
    Without that coding, a user would have to enter a quantity and press <enter> to confirm. At that moment a couple of checks are being performed on the items, which can result in errors.
    The problem is that when the default quantity is filled in for the user, there is no need to press <enter> and so those checks are skipped. Even though there should be an error (at least in the test case), we see nothing.
    The default quantity is being called from a CRM event (after creation of an item) and used the CRM_SCHEDLIN_I_MAINTAIN_OW function to change the quantity. After that, control is turned over to the system once again.
    Is there any way of forcing the same checks on the order without having to hit the <enter> key?

    As an enhancement, I've created a piece of code that determines the default quantity for an item. On its own, it works as intended.
    When creating a new contract based on a template, the same default quantity coding is being executed, thereby - in most cases - adding the quantity of 1 for the items.
    Without that coding, a user would have to enter a quantity and press <enter> to confirm. At that moment a couple of checks are being performed on the items, which can result in errors.
    The problem is that when the default quantity is filled in for the user, there is no need to press <enter> and so those checks are skipped. Even though there should be an error (at least in the test case), we see nothing.
    The default quantity is being called from a CRM event (after creation of an item) and used the CRM_SCHEDLIN_I_MAINTAIN_OW function to change the quantity. After that, control is turned over to the system once again.
    Is there any way of forcing the same checks on the order without having to hit the <enter> key?

  • Dynamic forms - adding line items

    Case: A form author has created a PO where the number of detail lines required on the form can be as few as 1 or as many as 20+. Instead of creating a fixed number of lines, a dynamic form is created so that user's may click on a 'Add Line' button to add additional lines to the form as needed.
    Is anyone willing provide me with an example of this that I could look at, dissect and see how this actually works, I'm a newbie to LifeCycle designer and I cannot figure out how to do this?

    See the Dynamic Purchase Order example in your LiveCycle installation folder.
    Carl Young
    http://www.pdfconference.com/

  • Adding new line item to Delivery

    When I try to post (Add) a delivery document based on a sales order that has a line item added that did not belong to the sales order I get the following error "[OACT] No matching records found (ODBC -2028)".  Looking in the DI API documentation I see that the Document_Lines object has a mandatory AccountCode property.  How do I go about getting the appropriate account code for the added line item?  The help documentation shows some sample code (included below), which doesn't make much sense to me. 
    Dim sStr As String
        Dim vRs As SAPbobsCOM.Recordset
        Dim vBOB As SAPbobsCOM.SBObob
        Dim vCH As SAPbobsCOM.ChartOfAccounts
        Set vCH = Vcmp.GetBusinessObject(oChartOfAccounts)
        Set vBOB = Vcmp.GetBusinessObject(BoBridge)
        Set vRs = Vcmp.GetBusinessObject(BoRecordset)
        Set vRs = vBOB.GetObjectKeyBySingleValue(oBusinessPartners, "CardName", "aaa", bqc_Equal)
        ' When working with segmentation use this function
        ' to find the account key in the ChartOfAccount object
        Set vRs = vBOB.GetObjectKeyBySingleValue(oChartOfAccounts, "FormatCode", "125100000100101", bqc_Equal)
        'The Recordset retrieves the value of the key (for example, sStr = _SYS00000000010).
        sStr = vRs.Fields.Item(0).Value
        'Use the sStr value to set the AccountCode
    Where does the FormatCode value of "125100000100101" come from?  Why the first call to GetObjectKeyBySingleValue?  It doesn't appear the results are being used?
    Any help would be greatly appreciated!
    Thanks,
    Jason Eiler
    BTW - I'm developing with/for SAP Business One version 2004 (or 6.7 of the DI API).

    Hi Jason,
    First of all:
    The displayed account code must be translated into the internally used code ("_SYS...") when using segmentation - when not using segemntation it is just internal code = displayed code.
    The code displayed is just a sample to give you a hint in case you are already familiar with the SAP Business One application.
    Therefore the sample code does not talk about where you got e.g. the value for FormatCode from ("FormatCode" is e.g. a field in table OACT where the account name with segments is (redundantly) stored without separators).
    The user should know on which account he/she wants to book a line on; maybe you might want to give some help to the user by displaying a dialog with suitable - or preselected accounts?
    In addition I am sure you know how to assign a string value to a string property - without explicitly writing it, right?
    HTH,
    Frank

  • Line item pricing based on total value of the order

    Hi,
    We need to charge as a separate line item (material) 'Insurance' as a % based on the total value of the order less one line item. Our orders are created on the web and posted via a BAPI.
    (a) depending on where the customer is located, we charge a certain added shipping cost.
    (b)  the customer has the choice to ask for insurance or not.
    The actual order may be 10 lines totaling $1,000 and due to location, the BAPI slaps on an added line item of $100. If the customer chose the insurance option, the BAPI needs to slap on another line item whose value would be, say 2% of the total order, i.e. 2% of 1000 (instead of on 1000+100). Of course, if the customer doesn't choose this option he is not charges this extra line and further if the customer is not in the particular region, the 100 charge may also not be there.
    The 2% can vary time to time so needs to be driven by a condition record based on %.
    How can we achieve this in the pricing procedure? The logic of how the BAPI will function is clear to us, we are stuck on the pricing procedure configuration.
    Glad to answer any further questions you may need for clarifications.
    Many thanks!

    Ideally insurance would be levied on end customer based on Inco Terms like CIF, DDU etc.,
    So you can have an access sequence for which you can make use of tables like 033 & 034 in V/07.  In VK11, for this combination, maintain the required insurance percent.
    In condition type V/06, for this condition type, maintain "C" for Manual entries, since you have indicated that customer has the choice.  Otherwise, this can be populated automatically in sale order.
    Similarly, for shipment cost also, you can have the Inco2 as one of the combination so that based on region, this condition type will be populated in sale order.  If you have shipment cost configured, then this can be achieved.
    In your pricing procedure, you have to assign the shipment cost condition type next to insurance and assign the From-To step accordingly.
    thanks
    G. Lakshmipathi

  • Add Line Item In Sales Order VA01

    HI All,
    I  have new requirement in creation of sales order . Here we have free promotion sales . Here if customer buy one material then he will get some other material as free .In standard sap we can give only one line item as free not more than that .
    Here our requirement is more than one line item . I suggested them maintain all the free materials in one Ztable when ever the original material  will come for  sales order then i have to fetch these materials from ztable  automatically and it should create sales order. I started doing this using user exit  FORM USEREXIT_MOVE_FIELD_TO_VBAP.
    These are the below links i checked in our sdn.
    Adding Line items to sales order on creation using User-Exit in VA01.
    Please give me some idea on this .
    Regards,
    Madhu.

    Hi Asik,
    Thanks for your reply.In my case i can not got for Bom  because the schemes will change for every ten days. I think Bom  creation will fill a lot of data but it wont solve my issue.
    Regards,
    Madhu.

  • Add new line item to free sales order

    HI All,
    I have new requirement in creation of sales order . Here we have free promotion sales . Here if customer buy one material then he will get some other material as free .In standard sap we can give only one line item as free not more than that .
    Here our requirement is more than one line item . I suggested them maintain all the free materials in one Ztable when ever the original material will come for sales order then i have to fetch these materials from ztable automatically and it should create sales order. I started doing this using user exit FORM USEREXIT_MOVE_FIELD_TO_VBAP.
    These are the below links i checked in our sdn. Adding Line items to sales order on creation using User-Exit in VA01.
    Please give me some idea on this .Please tell me if it is possible with configuration.
    Regards,
    Madhu.

    Hi,
    We also had a requirement where we needed to give some items free of charge in a standard sales order.We end up using the tann item categories for the item which are suppose to go free. Please note user will need to manually change the item category of the line items intended as free of charge.
    thanks

  • Insertion of extra line item in delivery creation

    Hi,
    I have a requirement like after the creation of delivery from sale order, if we insert new line item in sale order , created delivery should be overwrite with newly added line item in sale order.
    Im using RV_DELIVERY_CREATE for creation of delivery and BAPI_OUTB DELIVERYCHANGE for change of delivery. But for the above mentioned requirement is not getting by these Function Modules.
    Let me know which parameters should i pass for insertion .
    Code will be more sufficient.
    Thanks in Advance

    Try with this FM WS_DELIVERY_UPDATE where u can modify the created delivery

  • Is there any way to add PO no and  corresponding line item of PO in VL32N?

    Hello,
    The scenario is, we have created the IBD and deleted one of the line item and saved it.
    We went to VL32N and added the missing line item to IBD but PO number and corresponding item number of PO field of newly added line items are grayed out. We are not able to add PO number in VL32N screen.
    Is there any way to add PO number and corresponding line item of PO in VL32N screen of IBD? Our client does not want to create new IBD for same PO. He wants to add the line item in same IBD.
    Thanks,
    Milind
    Edited by: Csaba Szommer on Aug 27, 2011 4:52 PM

    Hello,
    This thread is pending since long time. No body has answered my question. Can any body suggest me?
    Thanks
    Milind

  • Using Bapi_salesorder_change adding a item, deleting a  item,Quanty change

    I need help on Bapi_salesorder_change.
    I have a table control in which there will be data of a particular sales document no, items, quantity, sales unit. When user changes the quantity, or adds a line item or deletes a line item and the press the save button bapi_salesorder_change should trigger and should change the order as the user changes.
    Can u help how to write code for this three conditions
    1> adding line item.
    2> deleting a line item.
    3> changing the quantity.
    using bapi_salesorder_change
    Can i use the same bapi for three conditions?
    Please help me in this as soon as possible.
    I thank them in advance

    Hello Geeks,
              i am using this bapi  for updating my item quantity no....
              but the bapi return msg say tat its not changing....
              i think i may did some mistake pls anyone can rectify it....
              i hv attached my code below......
    *For line item
    TYPES :BEGIN OF y_t_vbap,
            vbeln TYPE vbeln_va,  "sales Document
            posnr TYPE posnr_va,  "Item no of SD document
            matnr TYPE matnr,     "Material No
            zmeng TYPE dzmeng ,   "Target qty in Sales unit
            spart TYPE spart,     "division
            message TYPE BAPI_MSG,
           kwmeng type kwmeng,   "cummulative order qty
           END OF y_t_vbap.
    TYPES : y_t_itemin TYPE bapisditm,
            y_t_return TYPE bapiret2,
            y_t_headerx TYPE bapisdh1x.
    TYPES: BEGIN OF y_t_logdata,
           lno             TYPE         lineno,         "Lineno
           field           TYPE         fieldname,      "Field Name
           value           TYPE         lmon_fvalue,    "Field Value
           message         TYPE         bapi_msg,       "Messages
           END OF y_t_logdata.
                     Internal table declaration
    DATA: "y_i_vbak      TYPE   STANDARD TABLE OF y_t_vbak,
          y_i_vbap      TYPE   STANDARD TABLE OF y_t_vbap,
          y_i_headerx   TYPE   STANDARD TABLE OF bapisdh1x,
          y_i_itemin    TYPE   STANDARD TABLE OF bapisditm ,
          y_i_iteminx   TYPE   STANDARD TABLE OF bapisditmx,
          y_i_return    TYPE   STANDARD TABLE OF y_t_return,
          y_i_logdata   TYPE   STANDARD TABLE OF y_t_logdata,
          y_i_bapiret   TYPE   STANDARD TABLE OF bapiret2.
                     Table type declaration
    TYPES: y_tt_vbap    TYPE   STANDARD TABLE OF y_t_vbap ,
           y_tt_logdata TYPE   STANDARD TABLE OF y_t_logdata.
                     Work Area declaration.
    DATA:   y_wa_vbap     TYPE   y_t_vbap,
          y_wa_itemin   TYPE   bapisditm ,
          y_wa_iteminx  TYPE   bapisditmx,
          y_wa_headerx  TYPE   bapisdh1x,
          y_wa_return   TYPE   y_t_return,
          y_wa_logdata  TYPE   y_t_logdata,
          y_wa_event    TYPE   slis_alv_event,
          y_wa_event1   TYPE   slis_t_event,
          y_wa_bapiret  TYPE   bapiret2.
                     Variables declaration.
    DATA: y_i_event     TYPE   slis_t_event,
          y_v_success   TYPE   i           , "For Success
          y_v_error     TYPE   i           , "For Error
          y_v_sno       TYPE   char30      ,
          y_v_eno       TYPE   char30      ,
          y_v_msg       TYPE   char100     . "error msg
                     Constants declaration.
    constants : y_k_x type char1 value 'X',
                    y_k_u type char1 value 'U',
                   y_k_e type char1 value 'E'.
                  SELECTION SCREEN LAYOUT
    SELECTION-SCREEN:BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN: COMMENT 3(18) text-003.
    PARAMETERS   :    y_p_vbln TYPE vbak-vbeln OBLIGATORY.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN : END OF BLOCK b1.
                      START-OF-SELECTION.
    START-OF-SELECTION.
    WRITE: text-002.
                      END-OF-SELECTION.
    END-OF-SELECTION.
      SELECT  vbeln
              posnr
              matnr
              zmeng
              spart
              FROM vbap
                   INTO TABLE    y_i_vbap
                   WHERE vbeln = y_p_vbln.
      LOOP AT y_i_vbap INTO y_wa_vbap.
        y_wa_vbap-zmeng = 2 + y_wa_vbap-zmeng.
        MODIFY y_i_vbap FROM y_wa_vbap INDEX sy-tabix.
      ENDLOOP.
      PERFORM y_f_update USING y_i_vbap.
    *&      Form  y_f_update
           POPULATE BAPI DATA AND RUN BAPI
    FORM y_f_update USING  y_p_vbap TYPE y_tt_vbap.
      CLEAR: y_i_headerx, y_i_itemin, y_i_iteminx,
             y_i_return, y_i_bapiret.
      REFRESH: y_i_itemin, y_i_iteminx, y_i_return, y_i_bapiret.
      LOOP AT y_i_vbap INTO y_wa_vbap.
        MOVE y_wa_vbap-zmeng TO y_wa_itemin-target_qty.
        MOVE y_wa_vbap-posnr TO y_wa_itemin-itm_number.
        APPEND y_wa_itemin TO y_i_itemin.
      ENDLOOP.
    *Update the Bapi Itnernal tables
      y_wa_headerx-updateflag = y_k_u .
      APPEND y_wa_headerx TO y_i_headerx.
      LOOP AT y_i_vbap INTO y_wa_vbap.
        y_wa_iteminx-itm_number = y_wa_vbap-posnr.
        y_wa_iteminx-target_qty = y_k_x .
        y_wa_iteminx-updateflag = y_k_u .
        APPEND y_wa_iteminx TO y_i_iteminx .
      ENDLOOP .
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = y_wa_vbap-vbeln
          order_header_inx = y_wa_headerx
        TABLES
          return           = y_i_return
          order_item_in    = y_i_itemin
          order_item_inx   = y_i_iteminx.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      CLEAR y_i_vbap.
    IF y_i_return is not initial.
      LOOP AT y_i_return INTO y_wa_return where TYPE = y_k_e .
        MOVE y_wa_return-message TO y_wa_vbap-message .
        Append  y_wa_vbap to y_i_vbap.
        y_v_success = y_v_success + 1.
      ENDLOOP.
    ENDIF.
      y_wa_event-name = 'TOP_OF_PAGE'.
      y_wa_event-form = 'Y_FD_TOP_OF_LIST'.
      APPEND y_wa_event TO y_i_event.
      CLEAR y_wa_event.
      CALL FUNCTION 'ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program         = sy-repid
          i_tabtypename1             = 'Y_T_VBAP'
          it_events1                 = y_i_event[]
        TABLES
          t_outtab1                  = y_i_vbap[]
        EXCEPTIONS
          program_error              = 1
          maximum_of_appends_reached = 2
          OTHERS                     = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " y_f_vbap
    *&      Form  Y_FD_TOP_OF_LIST
    FORM y_fd_top_of_list.
      MOVE: y_v_success TO y_v_sno,
            y_v_error   TO y_v_eno.
      CONCATENATE text-002 y_v_sno '/' y_v_eno INTO y_v_msg SEPARATED BY
      space.
      CONDENSE y_v_msg.
      WRITE / y_v_msg .
      SKIP 1.
    ENDFORM.                    "Y_FD_TOP_OF_LIST

Maybe you are looking for

  • Difference between customizing request and workbench request?

    Hi , What is the difference between customizing request and workbench request? please reply.........

  • Calling a stored procedure with an XmlType parameter.

    I am attempting to execute a stored function via a named query. The stored procedure has a single parameter of Oracles 'xmltype', and also returns an xmltype. For example this dummy function function testXML(xml_in xmltype) return xmltype is begin re

  • Windows 7, problems with Photoshop CS2 upgrade install

    I just upgraded from XP to Windows 7 and I seem to have outsmarted myself.  Ever since version 5 I've bought the upgrade... well, now I no longer have the original version 5 disk and can no longer install and use either my CS or CS2 version.  While I

  • $1,400 Overpriced, huge price drop very soon?

    I've wanted a MacBook Pro for quite a while now. The only things that are holding me back are: MBPs need a much better video card and the price. I was looking at Dell (don't worry, my next computer will be a Mac) and the Inspiron 1720 with: Intel® Co

  • How to use PLSQL CLOB IN WORKFLOW

    Dear all, I have follwoing query with workflow. I have developed FYI WF. 1) In my WF mail, I am getting click here to respond. I want to hide this. Pl. let me know how to do that? 2) I have developed a workflow with Document type. I am calling a PL/S