<?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_CREATE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-create/m-p/5479601#M1254523</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Iam trying to create Purchase requisition with BAPI_PR_CREATE with Account assignment and Item category in &lt;STRONG&gt;ECC 6.0&lt;/STRONG&gt;. when i execute the bapi it throwing up message '&lt;STRONG&gt;MAINTAIN SERVICES OR LIMITS&lt;/STRONG&gt;' . when i check it in BAPI_PR_CREATE structure fields , services field is not there&lt;/P&gt;&lt;P&gt;could any body please let me know how to handle the scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;prasanna kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Apr 2009 15:10:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-15T15:10:07Z</dc:date>
    <item>
      <title>BAPI_PR_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-create/m-p/5479601#M1254523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            Iam trying to create Purchase requisition with BAPI_PR_CREATE with Account assignment and Item category in &lt;STRONG&gt;ECC 6.0&lt;/STRONG&gt;. when i execute the bapi it throwing up message '&lt;STRONG&gt;MAINTAIN SERVICES OR LIMITS&lt;/STRONG&gt;' . when i check it in BAPI_PR_CREATE structure fields , services field is not there&lt;/P&gt;&lt;P&gt;could any body please let me know how to handle the scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;P&gt;prasanna kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 15:10:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-create/m-p/5479601#M1254523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T15:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-create/m-p/5479602#M1254524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to debug your bapi from se37. Check where is the message populated.&lt;/P&gt;&lt;P&gt;You will definitely help yourself finding the reason of error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lalit Mohan Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 17:25:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-create/m-p/5479602#M1254524</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T17:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-create/m-p/5479603#M1254525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_macro_name="Code"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;DATA : T_REQUISITION_ITEMS LIKE BAPIEBANC OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;T_RETURN LIKE BAPIRETURN OCCURS 0 WITH HEADER LINE .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA : E_NUMBER LIKE BAPIEBANC-PREQ_NO.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-DOC_TYPE &amp;amp;H3D 'NB'.&lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-DEL_DATCAT &amp;amp;H3D '1'.&lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-DELIV_DATE &amp;amp;H3D '20020626'.&lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-PLANT &amp;amp;H3D 'P1'.&lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-STORE_LOC &amp;amp;H3D '01'.&lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-PUR_GROUP &amp;amp;H3D 'P01'.&lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-MAT_GRP &amp;amp;H3D '01'.&lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-PREQ_ITEM &amp;amp;H3D 1.&lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-MATERIAL &amp;amp;H3D '1MAT1'.&lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-QUANTITY &amp;amp;H3D 10.&lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-PREQ_NAME &amp;amp;H3D '123456'.&lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-PURCH_ORG &amp;amp;H3D '1000'.&lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-ACCTASSCAT &amp;amp;H3D 'U' .&lt;/P&gt;&lt;P&gt;T_REQUISITION_ITEMS-VEND_MAT &amp;amp;H3D 'G'.&lt;/P&gt;&lt;P&gt;APPEND T_REQUISITION_ITEMS.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_REQUISITION_CREATE'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SKIP_ITEMS_WITH_ERROR &amp;amp;H3D&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;NUMBER &amp;amp;H3D E_NUMBER&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;REQUISITION_ITEMS &amp;amp;H3D T_REQUISITION_ITEMS&lt;/P&gt;&lt;P&gt;REQUISITION_ACCOUNT_ASSIGNMENT &amp;amp;H3D T_REQ_ACCOUNT_ASSIGNMENT&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;REQUISITION_ITEM_TEXT &amp;amp;H3D&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;REQUISITION_LIMITS &amp;amp;H3D&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;REQUISITION_CONTRACT_LIMITS &amp;amp;H3D&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;REQUISITION_SERVICES &amp;amp;H3D&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;REQUISITION_SRV_ACCASS_VALUES &amp;amp;H3D&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;RETURN &amp;amp;H3D T_RETURN&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;REQUISITION_SERVICES_TEXT &amp;amp;H3D&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXTENSIONIN &amp;amp;H3D&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;REQUISITION_ADDRDELIVERY &amp;amp;H3D&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;IF NOT E_NUMBER IS INITIAL .&lt;/P&gt;&lt;P&gt;WRITE:/ 'REQ NO:' , E_NUMBER , 'CREATED'.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;LOOP AT T_RETURN.&lt;/P&gt;&lt;P&gt;WRITE T_RETURN-MESSAGE.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Krishna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 17:30:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-create/m-p/5479603#M1254525</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T17:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PR_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-create/m-p/5479604#M1254526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prasana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the sample code and correct the msiing..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM bapi_pr_create   USING    pwa_purreq_ib TYPE zce2o_purreq_ib
                               pw_notes      TYPE string
                      CHANGING pw_pr_number  TYPE bapimereqheader-preq_no
                               pw_msg        TYPE sxdp_message"dar013009
                               pw_flag       TYPE char1.

  DATA : t_item        TYPE TABLE  OF bapimereqitemimp,
         t_itemx       TYPE TABLE OF bapimereqitemx,
         t_itext       TYPE TABLE OF bapimereqitemtext,
         t_itemsource  TYPE TABLE OF bapimereqsource,
         t_return      TYPE TABLE OF bapiret2,
         wa_return     TYPE bapiret2,                       "dar013009
         wa_itemsource TYPE bapimereqsource,
         wa_item       TYPE bapimereqitemimp,
         wa_itemx      TYPE bapimereqitemx,
         wa_header     TYPE bapimereqheader,
         wa_headerx    TYPE bapimereqheaderx,
         wa_itext      TYPE bapimereqitemtext.

  CLEAR : pw_flag.

* Assigns the item details
  wa_item-preq_item  = c_item_1.
  wa_item-pur_group  = pwa_purreq_ib-purch_group.
  wa_item-preq_name  = pwa_purreq_ib-requisitioner_n.
  wa_item-material   = pwa_purreq_ib-material_number.
  wa_item-plant      = pwa_purreq_ib-plant.
  wa_item-store_loc  = pwa_purreq_ib-storage_loc.
  wa_item-quantity   = pwa_purreq_ib-quantity.
  wa_item-unit       = pwa_purreq_ib-uom.
  wa_item-preq_date  = w_date.
  wa_item-fixed_vend = pwa_purreq_ib-vendor_number.
  wa_item-purch_org  = pwa_purreq_ib-purch_org.
  wa_item-agreement  = pwa_purreq_ib-agrmnt_no.
  wa_item-agmt_item  = pwa_purreq_ib-agrmnt_line_item.
  wa_item-deliv_date = pwa_purreq_ib-request_date + pwa_purreq_ib-lead_time_offset.

* If the part class is in foundry assign the ship to oa number to supplying vendor, else it is blank
  IF pwa_purreq_ib-part_class IN r_foundry.
    wa_item-supp_vendor = pwa_purreq_ib-shipto_oa_number.
  ENDIF.

*** DELETE: Removed per Ravi --------------------------- dar101708 ---v
** Assigns the account assignment for the generic part
*  IF pwa_purreq_ib-part_class = c_part_gen.
*    wa_item-acctasscat = c_knttp_7.                         "'7'.
*  ENDIF.
*** DELETE: Removed per Ravi --------------------------- dar101708 ---^

  APPEND wa_item TO t_item.

* Assigns the fields to be updated
  wa_itemx-preq_item   = c_item_1.
  wa_itemx-preq_itemx  = c_check.
  wa_itemx-pur_group   = c_check.
  wa_itemx-preq_name   = c_check.
  wa_itemx-material    = c_check.
  wa_itemx-plant       = c_check.
  wa_itemx-store_loc   = c_check.
  wa_itemx-quantity    = c_check.
  wa_itemx-unit        = c_check.
  wa_itemx-preq_date   = c_check.
  wa_itemx-fixed_vend  = c_check.
  wa_itemx-purch_org   = c_check.
  wa_itemx-agreement   = c_check.
  wa_itemx-agmt_item   = c_check.
  wa_itemx-deliv_date  = c_check.
  wa_itemx-acctasscat  = c_check.
  wa_itemx-supp_vendor = c_check.

  APPEND wa_itemx TO t_itemx.

* Assigns the header
  wa_header-pr_type    = c_bsart_mrp.
  wa_headerx-pr_type   = c_check.

* Assigns the item source
  wa_itemsource-preq_item = c_item_1.
  wa_itemsource-info_rec  = pwa_purreq_ib-pir_no.
  APPEND wa_itemsource TO t_itemsource.

* Assigns the notes if the notes is not blank
  IF pw_notes IS NOT INITIAL.
    wa_itext-text_id   = 'B01'.
    wa_itext-text_line = pw_notes.
    wa_itext-preq_item = c_item_1.
    APPEND wa_itext TO t_itext.

* Begin of addition BRB040309
* Since item text can only be 132 characters, append new lines
* to text table for each 132 characters.
    DO.
      IF STRLEN( pw_notes ) &amp;gt; 132.
        SHIFT pw_notes LEFT BY 132 PLACES.
        wa_itext-text_line = pw_notes.
        APPEND wa_itext TO t_itext.
      ELSE.
        EXIT.
      ENDIF.
    ENDDO.
* End of addition BRB040309

  ENDIF.

* Create the PR with the above data's.
  CALL FUNCTION 'BAPI_PR_CREATE'                            "#EC *
    EXPORTING
      prheader     = wa_header
      prheaderx    = wa_headerx
    IMPORTING
      number       = pw_pr_number
    TABLES
      return       = t_return
      pritem       = t_item
      pritemx      = t_itemx
      pritemsource = t_itemsource
      pritemtext   = t_itext
    EXCEPTIONS
      OTHERS       = 1.

* Check whether any error exist. If not commit the changes else rollback the changes.
  READ TABLE t_return
*             TRANSPORTING NO FIELDS                         dar013009
             INTO wa_return                                 "dar013009
             WITH KEY type = c_msgty_e.
  IF sy-subrc = 0.
    pw_flag = c_error.
    pw_msg  = wa_return-message.                            "dar013009
  ELSE.
    pw_flag = c_success.

  ENDIF.


ENDFORM.                    " BAPI_PR_CREATE


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2009 17:31:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-pr-create/m-p/5479604#M1254526</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-15T17:31:09Z</dc:date>
    </item>
  </channel>
</rss>

