<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic BAPI_PR_CHANGE : Add line items in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514873#M237080</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enrique Leon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Aug 2006 14:35:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-28T14:35:37Z</dc:date>
    <item>
      <title>BAPI_PR_CHANGE : Add line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514873#M237080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enrique Leon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2006 14:35:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514873#M237080</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-28T14:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CHANGE : Add line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514874#M237081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to use BAPI_REQUISITION_CREATE or BAPI_REQUISITION_CHANGE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2006 15:41:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514874#M237081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-28T15:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CHANGE : Add line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514875#M237082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;These bapis are more limited (can't maintain delivery address or even deletion indicator).  Also, you can't add line items through these BAPI's as specified in the documentation or SAP Notes.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It isn't clear thought if adding line items to existing reqs is available for BAPI_PR_CHANGE.  ThoughtS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Aug 2006 15:55:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514875#M237082</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-28T15:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CHANGE : Add line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514876#M237083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just so everyone knows, I had a hell of a time finding a thread that answered this question....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_PR_CHANGE can in fact append line items to already existing requisitions.  There are certain fields required and you must specify the req line number yourself.  A commit is also needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enrique Leon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 14:01:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514876#M237083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T14:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CHANGE : Add line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514877#M237084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Enrique, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attempted to use BAPI_PR_CHANGE to add line items, but even with all item update fields set and all basic data specified for the new item it does not insert the new item . In debug I can not see how it could perform this task. I use the BAPI commit function and also receive a success message back, but no new item is added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You seem to have this working however, so could you specify here which fields are required to allow new items to be added?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;James Grant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2006 10:01:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514877#M237084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-10T10:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CHANGE : Add line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514878#M237085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you post what code you are using? Or at least the x-structure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some key fields you must include are the PREQ_ITEM for the new line, it can not be blank.  So if you want to add a new line with ID of say, 00050, then it must be specified in the pritem,pritemx,praccount,praccountx, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, for serial # you might need to provide '01' in the account structure.  I can't be certain what this is for however.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, please note that we have encountered some issues with this BAPI, particularly:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Text can not be changed on an existing req line&lt;/P&gt;&lt;P&gt;2. Price can not be changed on an existing req line&lt;/P&gt;&lt;P&gt;3. Long text is inserted incorrectly if more than one 133 character line is provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps, good luck.  BTW, we ended up using a BDC for this.  Its a bit crazy, but functional.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2006 12:11:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514878#M237085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-10T12:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CHANGE : Add line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514879#M237086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply. I have decided to use BDC for this as well. I had already tried those things you mention with no luck and with other issues surrounding this function it is less risky to use a BDC for now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, James&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Oct 2006 13:10:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514879#M237086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-10T13:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CHANGE : Add line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514880#M237087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it's very easy to do this with this BAPI.&lt;/P&gt;&lt;P&gt;If you have experiences with BAPI_PO_CHANGE you have done this within some minutes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's some sample-coding. Maybe this will help you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 

 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        =
          .

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Mar 2010 09:14:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514880#M237087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-31T09:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CHANGE : Add line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514881#M237088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Torsten,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you added items using BAPI_PR_CHANGE in a 4.7 system? I can change items using BAPI_PR_CHANGE but I can't seem to add items to a PR. I have to use this BAPI as I need to change the delivery address and it's not available in BAPI_REQUISITION_CHANGE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I copied the code you specified, it did not work for me. The option I am faced with is coding a BDC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Derick Logan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 12:36:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514881#M237088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-23T12:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CHANGE : Add line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514882#M237089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Torsten,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I figured this out. The code for BAPI_PR_CHANGE is flawed in 4.7 and will not allow you to add items. I copied the BAPI and corrected the code and it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Derick Logan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Apr 2010 18:12:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514882#M237089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-23T18:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CHANGE : Add line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514883#M237090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Torsten,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want add a new line in PR document. So i am using your code to do the same. &lt;/P&gt;&lt;P&gt;But the BAPI is returning error mesasage 'Enter G/L Account'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then i passed the GL number to the table parameter  PRACCOUNT and 'X' for GL number  to the table parameter PRACCOUNTX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But after passing these two values, again i am getting the same error in return table of BAPI. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now there are no parameter in any of the table of this BAPI , where i can pass GL number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what could be the reason for this error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pankaj Giri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Aug 2010 07:49:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change-add-line-items/m-p/1514883#M237090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-26T07:49:31Z</dc:date>
    </item>
  </channel>
</rss>

