<?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: creating po using bapi_po_create1 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-po-using-bapi-po-create1/m-p/1536864#M244923</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry.. couldn't find anything related to number range..looks normal??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Aug 2006 13:28:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-16T13:28:27Z</dc:date>
    <item>
      <title>creating po using bapi_po_create1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-po-using-bapi-po-create1/m-p/1536860#M244919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am using bapi_po_create1 to create po's..po number and item(posnr) numbers are external numbers..so we have External order no range configured based on order type...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do i need create external number ranges for posnr too..?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason even if pass posnr = '9999', it's creating po's with '10','20'..etc.. is there a flag i need to set in BAPIMEPOITEM??? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Siva.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2006 03:03:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-po-using-bapi-po-create1/m-p/1536860#M244919</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-16T03:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: creating po using bapi_po_create1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-po-using-bapi-po-create1/m-p/1536861#M244920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siva&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Can you tell us if itz behaving the same way if you try to create a PO online via ME21N with explicitly giving the item numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2006 03:22:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-po-using-bapi-po-create1/m-p/1536861#M244920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-16T03:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: creating po using bapi_po_create1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-po-using-bapi-po-create1/m-p/1536862#M244921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think external number range is only for the PO. The line items will be created with 10, 20 etc. However, the PO number will be whatever the no. you are passing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note :Please mark the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2006 03:37:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-po-using-bapi-po-create1/m-p/1536862#M244921</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-16T03:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: creating po using bapi_po_create1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-po-using-bapi-po-create1/m-p/1536863#M244922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check the sample code, and Observe the Bold Code. may be you missed that.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zpo_test             .

*DATA DECLARATION
CONSTANTS : c_x VALUE 'X'.

*Structures to hold PO header data
DATA : header LIKE bapimepoheader ,
       headerx LIKE bapimepoheaderx .

*Structures to hold PO account data
DATA : account LIKE bapimepoaccount OCCURS 0 WITH HEADER LINE ,
       accountx LIKE bapimepoaccountx OCCURS 0 WITH HEADER LINE .

*Internal Tables to hold PO ITEM DATA
DATA : item LIKE bapimepoitem OCCURS 0 WITH HEADER LINE,
       itemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE,

*Internal table to hold messages from BAPI call
return LIKE bapiret2 OCCURS 0 WITH HEADER LINE,

*Internal table to hold messages from BAPI call
pocontractlimits LIKE bapiesucc OCCURS 0 WITH HEADER LINE.

DATA : w_header(40) VALUE 'PO Header',
       purchaseorder LIKE bapimepoheader-po_number,
       delivery_date LIKE bapimeposchedule-delivery_date.

DATA : ws_langu LIKE sy-langu.

*text-001 = 'PO Header' - define as text element
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : company LIKE header-comp_code DEFAULT '122' ,
             doctyp LIKE header-doc_type DEFAULT 'NB' ,
             cdate LIKE header-creat_date DEFAULT sy-datum ,
             vendor LIKE header-vendor DEFAULT '2000000012' ,
             pur_org LIKE header-purch_org DEFAULT 'PU01' ,
             pur_grp LIKE header-pur_group DEFAULT '005' .
*sociedad like HEADER-COMP_CODE default '122' ,
*vendedor like HEADER-SALES_PERS default 'sale person'.


SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS : item_num LIKE item-po_item DEFAULT '00010',
             material LIKE item-material DEFAULT '12000000' ,
             tipo_imp LIKE item-acctasscat DEFAULT 'K' ,
*            pos_doc like ITEM-ITEM_CAT default 'F' ,
             shorttxt LIKE item-short_text DEFAULT 'PRUEBA BAPI' ,
             grup_art LIKE item-matl_group DEFAULT '817230000' ,
             plant LIKE item-plant DEFAULT '3001' ,
             mpe LIKE item-trackingno DEFAULT '9999' ,
*contrato like ITEM-AGREEMENT default '4904000003' ,
*quantity like ITEM-QUANTITY default 1 .
            po_unit LIKE item-po_unit DEFAULT 'EA'.

SELECTION-SCREEN END OF BLOCK b2.

* Par?mnetros de imputaci?n
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-004.
PARAMETERS : centro LIKE account-costcenter DEFAULT '1220813150',
             cuenta LIKE account-gl_account DEFAULT '6631400' ,
             num_pos LIKE account-po_item DEFAULT '10' ,
             serial LIKE account-serial_no DEFAULT '01' ,
             ind_imp LIKE account-tax_code DEFAULT 'I2' .

SELECTION-SCREEN END OF BLOCK b3.


*&amp;amp;---------------------------------------------------------------------*
START-OF-SELECTION.
*&amp;amp;---------------------------------------------------------------------*
*DATA POPULATION
*&amp;amp;---------------------------------------------------------------------*
  ws_langu = sy-langu. "Language variable

*POPULATE HEADER DATA FOR PO
*HEADER-COMP_CODE = sociedad .
  header-doc_type = doctyp .
  header-vendor = vendor .
  header-creat_date = cdate .
  header-created_by = 'TD17191' .
  header-purch_org = pur_org .
  header-pur_group = pur_grp .
  header-comp_code = company .
  header-langu = ws_langu .
*HEADER-SALES_PERS = vendedor .
*HEADER-CURRENCY = 'DOP' .
*HEADER-ITEM_INTVL = 10 .
*HEADER-PMNTTRMS = 'N30' .
*HEADER-EXCH_RATE = 1 .


*&amp;amp;---------------------------------------------------------------------*
*POPULATE HEADER FLAG.
*&amp;amp;---------------------------------------------------------------------*
  headerx-comp_code = c_x.
  headerx-doc_type = c_x.
  headerx-vendor = c_x.
  headerx-creat_date = c_x.
  headerx-created_by = c_x.
  headerx-purch_org = c_x.
  headerx-pur_group = c_x.
  headerx-langu = c_x.
*HEADERX-sales_pers = c_x.
*HEADERX-CURRENCY = c_x.
*HEADER-ITEM_INTVL = c_x.
*HEADER-PMNTTRMS = c_x.
*HEADER-EXCH_RATE = c_x.
*HEADER-EXCH_RATE = c_x.

*&amp;amp;---------------------------------------------------------------------*
*POPULATE ITEM DATA.
*&amp;amp;---------------------------------------------------------------------*
  &amp;lt;b&amp;gt;item-po_item = item_num.&amp;lt;/b&amp;gt;
  item-quantity = '1'.
*ITEM-MATERIAL = material .
  item-short_text = 'prueba bapi_po_create1'.
*ITEM-TAX_CODE = ''.
  item-acctasscat = 'K' .
*ITEM-ITEM_CAT = 'D' .
  item-matl_group = '817230000' .
  item-plant = '3001' .
  item-trackingno = '99999'.
  item-preq_name = 'test'.
*ITEM-AGREEMENT = '' .
*ITEM-AGMT_ITEM = ''.
  item-quantity = '1' .
  item-po_unit = 'EA'.
*ITEM-ORDERPR_UN = 'EA'.
  item-conv_num1 = '1'.
  item-conv_den1 = '1'.
  item-net_price = '1000000' .
  item-price_unit = '1'.
  item-gr_pr_time = '0'.
  item-prnt_price = 'X'.
  item-unlimited_dlv = 'X'.
  item-gr_ind = 'X' .
  item-ir_ind = 'X' .
  item-gr_basediv = 'X'.
*ITEM-PCKG_NO = '' .

  APPEND item.
  CLEAR item.

*&amp;amp;---------------------------------------------------------------------*
*POPULATE ITEM FLAG TABLE
*&amp;amp;---------------------------------------------------------------------*
&amp;lt;b&amp;gt;  itemx-po_item = item_num.
  itemx-po_itemx = c_x.&amp;lt;/b&amp;gt;
*ITEMX-MATERIAL = C_X.
  itemx-short_text = c_x.
  itemx-quantity = c_x.
*ITEMX-TAX_CODE = C_X.
  itemx-acctasscat = c_x.
*ITEMX-ITEM_CAT = c_x.
  itemx-matl_group = c_x.
  itemx-plant = c_x.
  itemx-trackingno = c_x.
  itemx-preq_name = c_x.
*ITEMX-AGREEMENT = C_X.
*ITEMX-AGMT_ITEM = c_x.
  itemx-stge_loc = c_x.
  itemx-quantity = c_x.
  itemx-po_unit = c_x.
*ITEMX-ORDERPR_UN = C_X.
  itemx-conv_num1 = c_x.
  itemx-conv_den1 = c_x.
  itemx-net_price = c_x.
  itemx-price_unit = c_x.
  itemx-gr_pr_time = c_x.
  itemx-prnt_price = c_x.
  itemx-unlimited_dlv = c_x.
  itemx-gr_ind = c_x .
  itemx-ir_ind = c_x .
  itemx-gr_basediv = c_x .
  APPEND itemx. CLEAR itemx.

*&amp;amp;---------------------------------------------------------------------*
*POPULATE ACCOUNT DATA.
*&amp;amp;---------------------------------------------------------------------*
  account-po_item = item_num.
  account-serial_no = serial .
  account-creat_date = sy-datum .
  account-costcenter = centro .
  account-gl_account = cuenta .
  account-gr_rcpt = 'tester'.
  APPEND account. CLEAR account.

*&amp;amp;---------------------------------------------------------------------*
*POPULATE ACCOUNT FLAG TABLE.
*&amp;amp;---------------------------------------------------------------------*
  accountx-po_item = item_num .
  accountx-po_itemx = c_x .
  accountx-serial_no = serial .
  accountx-serial_nox = c_x .
  accountx-creat_date = c_x .
  accountx-costcenter = c_x .
  accountx-gl_account = c_x .
  account-gr_rcpt = c_x.
  APPEND accountx. CLEAR accountx.


*&amp;amp;---------------------------------------------------------------------*
*BAPI CALL
*&amp;amp;---------------------------------------------------------------------*
  CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.

  CALL FUNCTION 'BAPI_PO_CREATE1'
    EXPORTING
      poheader         = header
      poheaderx        = headerx
    IMPORTING
      exppurchaseorder = purchaseorder
    TABLES
      return           = return
      poitem           = item
      poitemx          = itemx
      poaccount        = account
      poaccountx       = accountx.


*&amp;amp;---------------------------------------------------------------------*
*Confirm the document creation by calling database COMMIT
*&amp;amp;---------------------------------------------------------------------*
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
  wait = 'X'
* IMPORTING
* RETURN =
  .

END-OF-SELECTION.
*&amp;amp;---------------------------------------------------------------------*
*Output the messages returned from BAPI call
*&amp;amp;---------------------------------------------------------------------*
  LOOP AT return.
    WRITE / return-message.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the Bold code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2006 04:46:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-po-using-bapi-po-create1/m-p/1536863#M244922</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-16T04:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: creating po using bapi_po_create1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-po-using-bapi-po-create1/m-p/1536864#M244923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry.. couldn't find anything related to number range..looks normal??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2006 13:28:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-po-using-bapi-po-create1/m-p/1536864#M244923</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-16T13:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: creating po using bapi_po_create1</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-po-using-bapi-po-create1/m-p/1536865#M244924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;HI Siva

  Are you still facing the problem for item number when passing the item number explicitly through BAPI.

Kind Regards
Eswar&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2006 13:57:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-po-using-bapi-po-create1/m-p/1536865#M244924</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-16T13:57:36Z</dc:date>
    </item>
  </channel>
</rss>

