<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change/m-p/7100425#M1508374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys i want to update the purchase requisition GL account field,&lt;/P&gt;&lt;P&gt;i'm using bapi_pr_change to do it but i'm havingo these errors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Sum of quantities &amp;gt;4.000&amp;lt; larger than total quantity&lt;/P&gt;&lt;P&gt;- With non-valuated GR, please also enter GR indicator&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think i'm missing one field to the bapi here is my code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; se obtiene la solicitud de pedido y la posicion
  SELECT c~banfn c~bnfpo c~wepos
         d~menge d~vproz d~erdat d~ps_psp_pnr d~ablad
         INTO CORRESPONDING FIELDS OF TABLE ti_eban
         FROM (  eban AS c
         INNER JOIN ebkn AS d ON  c~banfn   = d~banfn
                              AND c~bnfpo   = d~bnfpo ).

* por cada posicion se pasa a actualizar el campo gl_account
  LOOP AT ti_eban ASSIGNING &amp;lt;fs_eban&amp;gt;.
    BREAK-POINT.
    CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'
      EXPORTING
        input     = &amp;lt;fs_eban&amp;gt;-ps_psp_pnr
      IMPORTING
        output    = v_pspid
      EXCEPTIONS
        not_found = 1
        OTHERS    = 2.
    IF sy-subrc &amp;lt;&amp;gt; 0.

    ENDIF.
    v_item-PREQ_ITEM      = &amp;lt;fs_eban&amp;gt;-bnfpo.
    v_item-GR_IND         = &amp;lt;fs_eban&amp;gt;-wepos.
    v_itemx-GR_IND        = 'X'.
    v_account-preq_item   = &amp;lt;fs_eban&amp;gt;-bnfpo.
    v_account-quantity    = &amp;lt;fs_eban&amp;gt;-menge.
    v_account-distr_perc  = &amp;lt;fs_eban&amp;gt;-vproz.
    v_account-ref_date    = &amp;lt;fs_eban&amp;gt;-erdat.
    v_account-creat_date  = &amp;lt;fs_eban&amp;gt;-erdat.
    v_account-wbs_element =  v_pspid.
    v_accountx-preq_item  = &amp;lt;fs_eban&amp;gt;-bnfpo.
    v_accountx-quantity   = 'X'.
    v_accountx-unload_pt  = 'X'.
    v_accountx-distr_perc = 'X'.
    v_accountx-gl_account = 'X'.
    v_accountx-ref_date   = 'X'.
    v_accountx-creat_date = 'X'.
    v_accountx-wbs_element = 'X'.

    APPEND v_item to ti_item.
    APPEND v_itemx to ti_itemx.

    CLEAR  v_account-gl_account.
    APPEND v_account  TO ti_account.
    APPEND v_accountx TO ti_accountx.

    CALL FUNCTION 'BAPI_PR_CHANGE'
      EXPORTING
        number           = &amp;lt;fs_eban&amp;gt;-banfn
      TABLES
        return           = ti_return
        pritem           = ti_item
        pritemx          = ti_itemx
        praccount        = ti_account
        praccountx       = ti_accountx.

*   si la bapi se ha ejecutado ok se hace commit y sino rollback
    READ TABLE ti_return ASSIGNING &amp;lt;fs_ret&amp;gt; WITH KEY type = 'E'.
    IF sy-subrc EQ 0.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      v_eban-banfn = &amp;lt;fs_eban&amp;gt;-banfn.
      v_eban-bnfpo = &amp;lt;fs_eban&amp;gt;-bnfpo.
      APPEND v_eban TO ti_eban2.
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    ENDIF.
    CLEAR   v_account.
    REFRESH ti_account.
    CLEAR   v_accountx.
    REFRESH ti_accountx.
    CLEAR v_item.
    CLEAR v_itemx.
    REFRESH ti_item.
    REFRESH ti_itemx.
    REFRESH ti_return.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;amy idea?&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Jul 2010 10:12:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-07-13T10:12:15Z</dc:date>
    <item>
      <title>BAPI_PR_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change/m-p/7100425#M1508374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys i want to update the purchase requisition GL account field,&lt;/P&gt;&lt;P&gt;i'm using bapi_pr_change to do it but i'm havingo these errors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Sum of quantities &amp;gt;4.000&amp;lt; larger than total quantity&lt;/P&gt;&lt;P&gt;- With non-valuated GR, please also enter GR indicator&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think i'm missing one field to the bapi here is my code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; se obtiene la solicitud de pedido y la posicion
  SELECT c~banfn c~bnfpo c~wepos
         d~menge d~vproz d~erdat d~ps_psp_pnr d~ablad
         INTO CORRESPONDING FIELDS OF TABLE ti_eban
         FROM (  eban AS c
         INNER JOIN ebkn AS d ON  c~banfn   = d~banfn
                              AND c~bnfpo   = d~bnfpo ).

* por cada posicion se pasa a actualizar el campo gl_account
  LOOP AT ti_eban ASSIGNING &amp;lt;fs_eban&amp;gt;.
    BREAK-POINT.
    CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'
      EXPORTING
        input     = &amp;lt;fs_eban&amp;gt;-ps_psp_pnr
      IMPORTING
        output    = v_pspid
      EXCEPTIONS
        not_found = 1
        OTHERS    = 2.
    IF sy-subrc &amp;lt;&amp;gt; 0.

    ENDIF.
    v_item-PREQ_ITEM      = &amp;lt;fs_eban&amp;gt;-bnfpo.
    v_item-GR_IND         = &amp;lt;fs_eban&amp;gt;-wepos.
    v_itemx-GR_IND        = 'X'.
    v_account-preq_item   = &amp;lt;fs_eban&amp;gt;-bnfpo.
    v_account-quantity    = &amp;lt;fs_eban&amp;gt;-menge.
    v_account-distr_perc  = &amp;lt;fs_eban&amp;gt;-vproz.
    v_account-ref_date    = &amp;lt;fs_eban&amp;gt;-erdat.
    v_account-creat_date  = &amp;lt;fs_eban&amp;gt;-erdat.
    v_account-wbs_element =  v_pspid.
    v_accountx-preq_item  = &amp;lt;fs_eban&amp;gt;-bnfpo.
    v_accountx-quantity   = 'X'.
    v_accountx-unload_pt  = 'X'.
    v_accountx-distr_perc = 'X'.
    v_accountx-gl_account = 'X'.
    v_accountx-ref_date   = 'X'.
    v_accountx-creat_date = 'X'.
    v_accountx-wbs_element = 'X'.

    APPEND v_item to ti_item.
    APPEND v_itemx to ti_itemx.

    CLEAR  v_account-gl_account.
    APPEND v_account  TO ti_account.
    APPEND v_accountx TO ti_accountx.

    CALL FUNCTION 'BAPI_PR_CHANGE'
      EXPORTING
        number           = &amp;lt;fs_eban&amp;gt;-banfn
      TABLES
        return           = ti_return
        pritem           = ti_item
        pritemx          = ti_itemx
        praccount        = ti_account
        praccountx       = ti_accountx.

*   si la bapi se ha ejecutado ok se hace commit y sino rollback
    READ TABLE ti_return ASSIGNING &amp;lt;fs_ret&amp;gt; WITH KEY type = 'E'.
    IF sy-subrc EQ 0.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      v_eban-banfn = &amp;lt;fs_eban&amp;gt;-banfn.
      v_eban-bnfpo = &amp;lt;fs_eban&amp;gt;-bnfpo.
      APPEND v_eban TO ti_eban2.
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    ENDIF.
    CLEAR   v_account.
    REFRESH ti_account.
    CLEAR   v_accountx.
    REFRESH ti_accountx.
    CLEAR v_item.
    CLEAR v_itemx.
    REFRESH ti_item.
    REFRESH ti_itemx.
    REFRESH ti_return.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;amy idea?&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jul 2010 10:12:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change/m-p/7100425#M1508374</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-13T10:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change/m-p/7100426#M1508375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;on my own&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jul 2010 07:05:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change/m-p/7100426#M1508375</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-14T07:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CHANGE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change/m-p/7100427#M1508376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having the same problem details, please can you explain how we solve&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Oct 2010 08:06:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-change/m-p/7100427#M1508376</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-21T08:06:57Z</dc:date>
    </item>
  </channel>
</rss>

