<?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 Re: BAPI_PO_CREATE1 - Problems with accounting in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-create1-problems-with-accounting/m-p/5041198#M1172256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you be a bit more forthcoming about "the error about accounting for the item?" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jan 2009 18:34:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-07T18:34:00Z</dc:date>
    <item>
      <title>BAPI_PO_CREATE1 - Problems with accounting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-create1-problems-with-accounting/m-p/5041197#M1172255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using the bapi_po_create1 to create a service po but it is always giving the error about accounting for the item. Where a sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data poheader type  bapimepoheader.
data poheaderx type  bapimepoheaderx.
data return	type table of	bapiret2.
data poitem	type table of	bapimepoitem.
data wa_poitem  type bapimepoitem.
data poitemx  type table of bapimepoitemx.
data wa_poitemx	type bapimepoitemx.

data poaccount  type table of bapimepoaccount.
data wa_poaccount type  bapimepoaccount.
data poaccountx	type table of	bapimepoaccountx.
data wa_poaccountx  type  bapimepoaccountx.

data poservices	type table of	bapiesllc.
data wa_poservices  type  bapiesllc.

data item_nr type ebelp value 10.
data service_line type packno value 100.
data int_serv_line type srv_line_no value 1.


* --------------------------------------------------- *
* ---------------- Header --------------------------- *
* --------------------------------------------------- *

poheader-comp_code = 'PT01'.
poheader-doc_type = 'NB'.

poheader-vendor = '0000100405'.

poheader-purch_org = 'GF'.
poheader-pur_group = 'GF0'.
poheader-doc_date = sy-datum.

poheaderx-comp_code = 'X'.
poheaderx-doc_type = 'X'.

poheaderx-vendor = 'X'.

poheaderx-purch_org = 'X'.
poheaderx-pur_group = 'X'.
poheaderx-doc_date = 'X'.

* --------------------------------------------------- *
* ----------------- Item ---------------------------- *
* --------------------------------------------------- *
wa_poitem-po_item = item_nr.
wa_poitem-short_text = 'testeJAC'.
wa_poitem-plant = '0006'.
wa_poitem-matl_group = 'SERVICOS'.
wa_poitem-item_cat = '9'.
wa_poitem-acctasscat = 'K'.
wa_poitem-distrib = 'V'.
*wa_poitem-tax_code = 'A0'.
wa_poitem-pckg_no = service_line.

append wa_poitem to poitem.

wa_poitemx-po_item = item_nr.
wa_poitemx-po_itemx = 'X'.
wa_poitemx-short_text = 'X'.
wa_poitemx-plant = 'X'.
wa_poitemx-matl_group = 'X'.
wa_poitemx-item_cat = 'X'.
wa_poitemx-acctasscat = 'X'.
wa_poitemx-distrib = 'X'.
*wa_poitemx-tax_code = 'X'.
wa_poitemx-pckg_no = 'X'.

append wa_poitemx to poitemx.

* --------------------------------------------------- *
* ----------------- Account-------------------------- *
* --------------------------------------------------- *

**wa_poaccount-po_item = item_nr.
**wa_poaccount-serial_no = '01'.
***wa_poaccount-quantity = '2000'.
**wa_poaccount-gl_account = '6223610099'.
**wa_poaccount-costcenter = '602630'.
**wa_poaccount-bus_area = '0012'.
**wa_poaccount-co_area = 'PT01'.
**
**append wa_poaccount to poaccount.
**
**wa_poaccountx-po_item = item_nr.
**wa_poaccountx-serial_no = '01'.
**wa_poaccountx-po_itemx = 'X'.
***wa_poaccountx-quantity = 'X'.
**wa_poaccountx-gl_account = 'X'.
**wa_poaccountx-costcenter = 'X'.
**wa_poaccountx-bus_area = 'X'.
**wa_poaccountx-co_area = 'X'.
**
**append wa_poaccountx to poaccountx.


wa_poaccount-po_item = item_nr.
wa_poaccount-costcenter = '602630'.
wa_poaccount-gl_account = '6223610099'.
wa_poaccount-serial_no = '01'.
wa_poaccount-co_area = 'PT01'.
append wa_poaccount to poaccount.

wa_poaccountx-po_item = item_nr.
wa_poaccountx-serial_no = '01'.
wa_poaccountx-po_itemx = 'X'.
wa_poaccountx-costcenter = 'X'.
wa_poaccountx-gl_account = 'X'.
wa_poaccountx-co_area = 'X'.

append wa_poaccountx to poaccountx.


* --------------------------------------------------- *
* ----------------- Service ------------------------- *
* --------------------------------------------------- *
wa_poservices-pckg_no = service_line.
wa_poservices-line_no = int_serv_line.
wa_poservices-service = '5000491'.
wa_poservices-quantity = '2000'.
wa_poservices-base_uom = 'L'.
wa_poservices-tax_code = 'A0'.

append wa_poservices to poservices.

* --------------------------------------------------- *
* ----------------- Create PO ---------------------- *
* --------------------------------------------------- *

call function 'BAPI_PO_CREATE1'
  exporting
    poheader                     = poheader
   poheaderx                     = poheaderx
* IMPORTING
*   EXPPURCHASEORDER             =
 tables
   return                       = return
   poitem                       = poitem
   poitemx                      = poitemx
   poaccount                    = poaccount
   poaccountx                   = poaccountx
   poservices                   = poservices

          .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If anyone have an idea its great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanzs in advanced &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jaime&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 18:30:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-create1-problems-with-accounting/m-p/5041197#M1172255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T18:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PO_CREATE1 - Problems with accounting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-create1-problems-with-accounting/m-p/5041198#M1172256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you be a bit more forthcoming about "the error about accounting for the item?" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2009 18:34:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-create1-problems-with-accounting/m-p/5041198#M1172256</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-07T18:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PO_CREATE1 - Problems with accounting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-create1-problems-with-accounting/m-p/5041199#M1172257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, heres the output of the return&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;E	BAPI	001	No instance of object type PurchaseOrder has been created. External reference:
E	MEPO	000	Purchase order still contains faulty items
E	06	436	In case of account assignment, please enter acc. assignment data for item&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanzs for the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2009 10:20:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-create1-problems-with-accounting/m-p/5041199#M1172257</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-08T10:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_PO_CREATE1 - Problems with accounting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-create1-problems-with-accounting/m-p/5041200#M1172258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, problem solved.&lt;/P&gt;&lt;P&gt;The problem was the missing of a second line of service and uisng the table psrvaccessvalues to relate the account to the service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;heres the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
wa_poservices-pckg_no = service_line.
wa_poservices-line_no = int_serv_line.
wa_poservices-service = '000000000005000491'.
wa_poservices-quantity = '2000'.
wa_poservices-base_uom = 'L'.
*wa_poservices-tax_code = 'A0'.
wa_poservices-outl_ind = 'X'.
wa_poservices-subpckg_no = service_line + 1.

append wa_poservices to poservices.
clear wa_poservices.

wa_poservices-pckg_no = service_line + 1.
wa_poservices-line_no = int_serv_line + 1.
wa_poservices-service = '000000000005000491'.
wa_poservices-quantity = '2000'.
wa_poservices-base_uom = 'L'.
wa_poservices-outl_ind = 'X'.
append wa_poservices to poservices.

* --------------------------------------------------- *
* ----------------- Accounting to Service ----------- *
* --------------------------------------------------- *

wa_posrvaccessvalues-pckg_no = service_line + 1.
wa_posrvaccessvalues-line_no = int_serv_line + 1.
wa_posrvaccessvalues-serno_line = 01.
wa_posrvaccessvalues-serial_no = 01.
wa_posrvaccessvalues-quantity = '2000'.
append wa_posrvaccessvalues to posrvaccessvalues.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2009 11:35:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-po-create1-problems-with-accounting/m-p/5041200#M1172258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-08T11:35:37Z</dc:date>
    </item>
  </channel>
</rss>

