Getting errors when iam using  BAPI_PO_CREATE1 for Purchase Order creation

Hi sap Gurus,
  I am getting Errors when iam using  BAPI_PO_CREATE1 for Purchase Order creation that Material (144) does not exist but it is alreardy maintained in MM01.
I dont get how it is coming.and what are the mandatory fields in bapi BAPI_PO_CREATE1 in item level .that is too material only.
pls let me know .
thanks in advance.

Hi,
Check the sample code..
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.
start-of-selection.
*DATA POPULATION
  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 .
*POPULATE HEADER FLAG.
  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.
*POPULATE ITEM DATA.
  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.
*POPULATE ITEM FLAG TABLE
  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.
*POPULATE ACCOUNT DATA.
  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.
*POPULATE ACCOUNT FLAG TABLE.
  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.
*BAPI CALL
  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.
*Confirm the document creation by calling database COMMIT
  call function 'BAPI_TRANSACTION_COMMIT'
  exporting
  wait = 'X'
IMPORTING
RETURN =
end-of-selection.
*Output the messages returned from BAPI call
  loop at return.
    write / return-message.
  endloop.
Regards
Sudheer

Similar Messages

  • Getting errors when iam using bapi ' BAPI_PO_CREATE1'

    Hi Sap Gurus,
    I need small info over bapi BAPI_PO_CREATE1.
    While creating Purchase orders using BAPI_PO_CREATE1 it is not allowing me to enter partner function details .I am getting below errors.
    i.e
    1)  it is not allowing to update partner function details.and iam not getting what excact bapi structure for partner function details.here i found 'BAPIEKKOP' in tables option.but these fields are not matching with ME21N screen partner function fields . I want to update PARTNER FUNTCION, PARTNER NAME, DEFALT PARTNER.in bapi structure BAPIEKKOP there is no DEFAULT PARTNER instead of this there is DELETION INDICATOR.
    Pls let me know the exact bapi structure and fields in BAPI.
    2). I am getting the below error when iam posting the Pur.Order
    i.e Item 10 Acct Assgt 1
    Account 460600 does not exist in chart of accounts CANO.
    what does it means? Evenif that Account is existed in chart of account CANO and Even i posted that PO, it showing like above.and iam getting all field in PO like CO area,COST center and G/L account for Account Assingment group 'K' .
    I could not understand why it is giving such type of errors.
    Pls let me know the anwsers for above errors .
    thanks in advance.

    Hi Sap Gurus,
    I need small info over bapi BAPI_PO_CREATE1.
    While creating Purchase orders using BAPI_PO_CREATE1 it is not allowing me to enter partner function details .I am getting below errors.
    i.e
    1)  it is not allowing to update partner function details.and iam not getting what excact bapi structure for partner function details.here i found 'BAPIEKKOP' in tables option.but these fields are not matching with ME21N screen partner function fields . I want to update PARTNER FUNTCION, PARTNER NAME, DEFALT PARTNER.in bapi structure BAPIEKKOP there is no DEFAULT PARTNER instead of this there is DELETION INDICATOR.
    Pls let me know the exact bapi structure and fields in BAPI.
    2). I am getting the below error when iam posting the Pur.Order
    i.e Item 10 Acct Assgt 1
    Account 460600 does not exist in chart of accounts CANO.
    what does it means? Evenif that Account is existed in chart of account CANO and Even i posted that PO, it showing like above.and iam getting all field in PO like CO area,COST center and G/L account for Account Assingment group 'K' .
    I could not understand why it is giving such type of errors.
    Pls let me know the anwsers for above errors .
    thanks in advance.

  • When iam using jdownloader for dowload, the firefox did not work at any page, as like there in no internet conexion?

    When iam using jdownloader for dowload, the firefox did not work at any page, as like`` there in no internet conexion?``

    you need to check whether '''jdownloader''' is compatible with the Firefox version you are using.
    -> Tap ALT key or press F10 to show the Menu Bar
    -> go to Tools Menu -> Add-ons -> Extension section -> check the Status of '''jdownloader''' extension -> if '''an update''' is available for this add-on then install the update -> Restart Firefox and check again check the compatibility -> if it is '''GREYED with Exclamation mark''' then it is incompatible with Firefox
    Try using this extension to force compatibility.
    https://addons.mozilla.org/en-US/firefox/addon/add-on-compatibility-reporter/
    Check and tell if its working.

  • Document is in transfer for purchase order.Creation not possible

    Dear All,
    We did partial confirmation in EBP and later when trying to do confiramtion for the remaining quantiy getting the message"document is in transfer for purchase order.Creation not possible"
    We are taking this problem in production as well as in quality systems also.
    What are possible reason and how to solve it.
    kindly share your views.
    Thank you.

    Hi yshu,
    use tcode bd87 in SRM to check for failed confirmation IDOC (type MBGMCR).
    The double click the status record to see the exact cause of the failure.
    Rectify the error. Then try to execute the IDOC from BD87 tcode.
    For a few errors you may not be able to execute the IDOC but to create a new confirmation in SRM. In such cases, follow the below procedure..
    There should be an entry for the confirmation in the transfer table BBP_DOCUMENT_TAB in SRM. Display the details.
    Then run FM "BBP_DELETE_FROM_DOCUMENT_TAB" to delete the entry from the doc tab table.
    Then post a new confirmation in SRM.
    There is also a FM in SRM using which you can change the status of thefailed IDOC from 51 to 68 or 31.
    Rgds,
    MJ

  • Document in transfer for purchase order - creation not possible

    Hi Experts,
    we get this error when we do confirmation"'document in transfer for purchase order - creation not possible'"
    any inputs are appreciated
    Rg
    sam

    Hi All,
    We have resolved the above problem.
    When user does confirmation ,if it sucessfully  created then there will be  no entry in BBP_Document_tab table.If it's in error in process and next time when user tries to do GR then he will encounter a pop up message "Document in transfer for PO, creation not possible".
    So we need to delete the entries from table BBP_DOCUMENT_TAB using FM BBP_DELETE_FROM_DOCUMENT_TAB.
    Then check again in BBP_DOCUMENT_TAB now there will be noentry there...so now user can do the confirmation from SRM,he will not encounter this error now.
    Thanks to all the ppl who has replied
    sameer

  • Profitability segment for purchase order creation - how to read it

    Hello,
    how to read it profitability segment for purchase order creation at item level ??
    There's a method on ME_PROCESS_PO_CUST ?
    Tks

    Hi,
    Use the below FM from the function group KEAK
    To read: COPA_CALL_PROF_SEGMENT or COPA_INPUT_PSEGMENT_RETURN
    To create: COPA_PROFITABILITY_SEGMENT
    Hope this helps
    Regards
    Shiva

  • Error:-document is in transfer for purchase order..creation is not possible

    Hello,
    While doing confirmation of PO I am getting this error, saying "document is in transfer for purchase order..creation is not possible".
    can anyone please suggest me solution on this type of error?

    Hi,
    Is the PO in ORDERED status? Is there any confirmation posted for this PO which might be stuck (idoc failed to reach back end)?
    If it is a case of idoc failure, then reprocess the idoc and then do the next confirmation.
    regards,
    MRao

  • IDoc Error "" No goods receipt possible for purchase order"

    Hi All
    I am getting IDoc failed with the error massaeg " No goods receipt possible for purchase order I510954-02 00010
    Message type :MBGMCR
    Basic type : MBGMCR03
    Message no. M7036
    Status : 51
    Please suggest on this
    Thanks
    Ajit

    Hi
    Please go through thid link i think it will help you..
    No goods receipt possible in PO
    Error - E 036 No goods receipt possible for purchase order
    No goods receipt possible for purchase order
    Regards
    Sharada

  • BAPI for Purchase Order Creation

    Hi All,
    Purchase Order creation through BAPI, Auto Po creation. Please advise program.
    The requirement is: when we delivery the goods from one plant to another plant,PO should create in second plant with goods what delivered from first plant.
    Pranitha
    Moderator message : Spec/requirements dumping is not allowed. Thread locked.
    Edited by: Vinod Kumar on Sep 30, 2011 3:37 PM

    Hi,
    As per  u r requirement
    you can use  : BAPI =>    BAPI_PO_CREATE  with suitable Document  Type ( Stock trasnfert : STO )
    IF  u want to auto po must be created after each delivry in this case you need to use BADI
    'MB_MIGO_BADI; In This BAPI  There is method : POST_DOCUMENT
    In this method u can write code for Auto PO Creation by using BAPI .
    Hope This will Resolve u r query.
    Thanks and Regads
    Santosh

  • Is it possible to use IQS1 for purchase orders without material master?

    Hello,
    We are currently trying to come up with a way to send a notification on purchase orders which have GR's posted against them so that the purchasing team/requestor know that products have been shipped.  We have an office in Qatar where we would like to ship products to (which we are purchasing out of a catalog based in the US) and we need a way to track the shipment.  We are currently using T-Code IQS1 for any items which have been created as material master and are in stock within Qatar however we would like to utilize this t-code for products which are pulled in from a supplier catalog, which are not part of the material master.
    Is there a way to use IQS1 for non-material master products?
    Thanks,
    Katie

    Worked with my development team to locate the resolution.

  • DMP ERROR When I am Finding the Purchase Order

    Hello Experts,
    I am Using SAP 8.8 PL 16
    My Client Finding the Purchase Order that time .DMP Error Creating.
    And Automatically SAP Application Doing Close
    Please Help me About that Issue
    Dixit Patel

    Hi Gordon
    I Created the New User  and Check with  that User
    Also Removing All File in Temp Folder
    But . DMP File is Creating
    Thanks
    Dixit Patel

  • Error when update supplier site in Purchase Order

    Step to re-produce:
    1. Create New Purchase Order.
    2. Add 1 line item, fill-in Type = Goods, Item No, Need-By or Promised.
    3. Click on the "Shipment" button.
    4. Change the Site of the Supplier in the PO header.
    5. Error shown: "You cannot change the supplier or site for this order. Re-query the order to proceed".
    What is causing this error? Pls help. Thanks.

    If I delete the purchase details/line item, the supplier site can be changed.
    The error appeared again after the new line item selected,click on "Shipment" button, and change the supplier site.
    It's not able to change it. Any reason caused by the line item shipment? how it relate?

  • Idoc using EDI for purchase order

    hi all,
    could someone explain me all  the steps required in generating purchase order idoc  using EDI butnot using ALE.
    i want all the steps to be in detail.
    thanks in advance
    suma sailaja pvn

    EDI is described as the interchange of structured data according to agreed message standards between computer systems, by electronic means. Structured data equates to a simple and direct method of presenting the data content of a document. The method of ensuring the correct interpretation of the information by the computer system is defined by the EDI standard."
    EDI is a technique used to communicate business transactions between computer systems of different companies and organizations. Note that sometimes the EDI mechanism deployed at a company is often used to interface to other systems within the same organization."
    The difference between ALE and EDI process flows occurs at the communication level. The EDI process transmits IDocs to an EDI subsystem using flat file format. The ALE process transmits IDocs to an SAP system via memory, using asynchronous communication.
    Check the following links
    How Can I transfer invoice details to customer through IDOC in EDI
    Re: IDOC Types and their equivalent messages in EDIFACT and ANSI X12
    http://www.sapgenie.com/sapedi/idoc_abap.htm
    http://www.henrikfrank.dk/abapexamples/IDOC/IDOC.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/0b/2a6095507d11d18ee90000e8366fc2/frameset.htm
    Reward Points if useful.

  • Replacing the bapi with the new bapi for purchase order creation

    Hi,
       In the customised code call is there for the bapi function module  'BAPII_PO_CREATE'.
       Iam trying to replace the call with the code that calls function module 'BAPI_PO_CREATE1'.
       Please help me about what changes I needed to do in the code . As there is much mismatch in the import and export parameters
    and tables in both the function modules.
       Thanks in advance.
    Edited by: anwar.indya on Mar 25, 2011 2:18 PM
    Edited by: anwar.indya on Mar 25, 2011 2:19 PM

    Hi,
    As per  u r requirement
    you can use  : BAPI =>    BAPI_PO_CREATE  with suitable Document  Type ( Stock trasnfert : STO )
    IF  u want to auto po must be created after each delivry in this case you need to use BADI
    'MB_MIGO_BADI; In This BAPI  There is method : POST_DOCUMENT
    In this method u can write code for Auto PO Creation by using BAPI .
    Hope This will Resolve u r query.
    Thanks and Regads
    Santosh

  • Determine Plant and Sloc for Purchase Order Creation

    Hi Gurus,
    I want to determine while create a Purchase Order (ME21N), I can restrict the Purchase Order only for specific Order Type , specific Plant and specific Storage Location.
    The business needs is to prevent human error while create Purchase Order with wrong Order Type, Plant and SLoc combination.
    Is there any Exit related ?
    Thx in advance.
    Tri W

    Hi ,
    This is MM question
    In MM , you could use authorzation in PFCG to limit the plant selection and document typefor a specific  user .
    This would also have effection to the ME21N .
    For the storage location ,then please to set the field as display only and then add a default value to the user in
    the personal setting.
    I hope this will help you a little bit apart from the  BADI.
    Regards
    Summer Wang

Maybe you are looking for

  • How to get date in format(1st jan 2006 ).

    can we get get the date in the 1st jan 2006 format . we can get the date in format 1 jan 2006 by using (d MMM yyyy) but i am not able to get st, nd, or rd after the day in(d mmm yyyy)format like 1st 2nd 3rd 4th

  • How to make udev load ALSA driver automaticly?

    I have added " modprobe snd-via82xx " (ALSA driver) to /etc/profile.d/mysh.sh, and I could use almost every multimedia software except mp3blaster. But after I installed udev, the udev load "via82cxxx_audio"  (OSS driver) automaticly instead of snd-vi

  • In Bcc CA Task tab, actions are not shown

    Hi all, In BCC show this content, Content Administration Project : Master_Style In History (tab) Author: admin Date: Mar 23, 2013 12:14 PM Action: create Author: admin Date: Mar 23, 2013 12:20 PM Action: Ready for Review Assets are ready for approval

  • Music says it's playing but there's no sound

    I got a new computer and moved all of the music from my old computer. Now when I try to play a song the equalizer moves like the song is playing but there is no sound. I've checked the obvious things like volume and mute. Any ideas? I transferred the

  • Workflow giving "Suspended" Error on Calculated Columns- Sending Reminder Emails on List Due Date

    I have created a list that has our reporting due dates plus calculated columns for 5 and 10 day reminders. Example: Due Date: 3/7/2014 1:00 PM 5 Day Reminder (Calculated Column= [Due Date] – 5): 3/2/2014 1:00 PM 10 Day Reminder (Calculated Column= [D