<?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 purchase order in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277264#M151787</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;Assuming that instead of creating from scratch, you just want to create PO for test purpose, e.g. may be as Test data , then-&lt;/P&gt;&lt;P&gt;You can use any existing PO in the system and &lt;/P&gt;&lt;P&gt;In transaction ME21n or ME21 , use copy option to create the Order.&lt;/P&gt;&lt;P&gt;If you have Purchase requisition with you , you can use option of Create with reference to PReq in ME21.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regads,&lt;/P&gt;&lt;P&gt;Akshay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Apr 2006 09:10:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-04-20T09:10:31Z</dc:date>
    <item>
      <title>creating purchase order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277258#M151781</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;an anyone jst tell me how to create  purchase order&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2006 08:41:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277258#M151781</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-20T08:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: creating purchase order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277259#M151782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;Tcode Me21n&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;satesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2006 08:43:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277259#M151782</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-20T08:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: creating purchase order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277260#M151783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello varalakshmi,&lt;/P&gt;&lt;P&gt;U can use ME21 and ME21n(enjoy trx). U will need the following to create PO.&lt;/P&gt;&lt;P&gt;Company code for which u r cretaing the PO.&lt;/P&gt;&lt;P&gt;Purc. Org and group.&lt;/P&gt;&lt;P&gt;Vendor,Material,qantity and may be price if it is not gettign derived.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2006 08:47:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277260#M151783</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-20T08:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: creating purchase order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277261#M151784</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;Refer this link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.allsaplinks.com/purchaseorder_create.html" target="test_blank"&gt;http://www.allsaplinks.com/purchaseorder_create.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_ides/helpdata/en/bf/cd27548dfb11d383fc0000e8a5eb64/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_ides/helpdata/en/bf/cd27548dfb11d383fc0000e8a5eb64/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gayathri&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Gayathri Hariharan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2006 08:50:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277261#M151784</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-20T08:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: creating purchase order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277262#M151785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi varalakshmi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;through coding...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;report  z_test_po                               .

*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;---------------------------------------------------------------------*
  item-po_item = item_num.
  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;---------------------------------------------------------------------*
  itemx-po_item = item_num.
  itemx-po_itemx = c_x.
*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;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2006 08:56:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277262#M151785</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-20T08:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: creating purchase order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277263#M151786</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;  You can create a new purchase order by giving reference document(a purchase order that is already existing) also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to ME21 tcode, Purchase order -&amp;gt; create w.reference -&amp;gt; specify PO Number which you got from table EKPO -&amp;gt; Enter .&lt;/P&gt;&lt;P&gt;Then Click Copy+Details button on application toolbar.&lt;/P&gt;&lt;P&gt;(New PO number will also have the same items which are in the reference PO Number).&lt;/P&gt;&lt;P&gt;then save.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A generated PO Number will be displayed in the message displayed on the status bar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check the values of new PO Number in tables EKKO, EKPO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sailaja.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2006 09:04:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277263#M151786</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-20T09:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: creating purchase order</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277264#M151787</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;Assuming that instead of creating from scratch, you just want to create PO for test purpose, e.g. may be as Test data , then-&lt;/P&gt;&lt;P&gt;You can use any existing PO in the system and &lt;/P&gt;&lt;P&gt;In transaction ME21n or ME21 , use copy option to create the Order.&lt;/P&gt;&lt;P&gt;If you have Purchase requisition with you , you can use option of Create with reference to PReq in ME21.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regads,&lt;/P&gt;&lt;P&gt;Akshay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2006 09:10:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-purchase-order/m-p/1277264#M151787</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-20T09:10:31Z</dc:date>
    </item>
  </channel>
</rss>

