Create PR using BAPI_PR_create

Hi Friends,
Can any body send step by step procedure to create PR using BAPI.
Also  when i try to create pr using bapi_pr_create , im  getting following error.
T ID                   NUM    MESSAGE
E ME                   083   Enter Document Type
E BAPI                 001  No instance of object type PurchaseRequisition has been created. External reference: # 5
E ME                   083 Enter Plant
E KI                   205 Cost accounting is not active in company code QP01
Regards,
Jaya

Example
TABLES:eban.
DATA: BEGIN OF itab OCCURS 0,
     NO(5),
     bnfpo LIKE eban-bnfpo,
     bsart LIKE eban-bsart,
     matnr LIKE eban-matnr,
     lgort LIKE eban-lgort,
     menge LIKE eban-menge,
     bednr LIKE eban-bednr,
     lfdat LIKE eban-lfdat,
     TX(132),
     END OF itab.
DATA :
prheader LIKE TABLE OF bapimereqheader WITH HEADER LINE,
prheaderx LIKE TABLE OF bapimereqheaderx WITH HEADER LINE,
PRITEMEXP LIKE TABLE OF BAPIMEREQITEM WITH HEADER LINE,
return LIKE TABLE OF bapiret2 WITH HEADER LINE,
pritem LIKE TABLE OF bapimereqitemimp WITH HEADER LINE,
pritemx LIKE TABLE OF bapimereqitemx WITH HEADER LINE,
PRITEMTEXT LIKE TABLE OF BAPIMEREQITEMTEXT WITH HEADER LINE.
DATA auxfilename LIKE rlgrap-filename.
CALL FUNCTION 'UPLOAD'
EXPORTING
   filename     = 'C:\PRCREATE.TXT'
   filetype     = 'DAT'
IMPORTING
   act_filename = auxfilename
TABLES
   data_tab     = itab.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
         WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

Similar Messages

  • How to Create PR using bapi_pr_create?

    Hi Friends,
    Can any body send step by step procedure to create PR using BAPI. I am using bapi_pr_create.
    I want to know the mandatory fields required to create a PR and also the test data of these fields.
    Any kind of help would be appreciated. Be assured of points too....
    Cheers,
    Deepak.

    Hi
    You can test the BAPI first & you yourself can figure out all the required fileds, as the required fileds may change according to the Document type.
    Goto SE37 enter the Function module , click on test/execute or F8.
    Click on the
    PRHEADER  - click on Single entry or Shift+F7.
    here give the details
    PR_TYPE, ITEM_INTVL
    Click on PRHEADERX fill the fields
    PR_TYPE - X
    ITEM_INTVL - X
    You need to flag X in all the fields in which you have made entries. if you have filled PRITEM , you need to fill PRITEMX with X - this will update the item records.
    Similarly you need to fillout the details in the below structure.
    PRITEM
    PRITEMX
    PRITEMEXP
    PRITEMSOURCE
    PRACCOUNT
    PRACCOUNTPROITSEGMENT
    PRACCOUNTX
    PRADDRDELIVERY
    PRITEMTEXT
    Based on your requirement you need to use the structure.
    After entering the details click on execute. Here you can get the results in structure RETURN, based on the details you can adjust the fields.
    You can save your succesful test data by click on save.
    & you can reuse them by clicking on test data directory.
    Thanks & Regards
    Kishore
    PRHEADERTEXT

  • Create PR using BAPI_PR_CREATE-- Field Mapping

    Hi Forum,
    We need to create PR from SRM to ECC using BAPI_PR_CREATE instead of standard BAPI_REQUISITION_CREATE. I understand that we can change driver determination to call this BAPI by changing the adapter class but the interface of these two BAPIs is very different.
    Has any one done the mapping of fields from SRM to BAPI_PR_CREATE?
    If yes, it would a be a great help if you can share the code or provide any other information on this.
    Thanks,
    Anubhav

    Example
    TABLES:eban.
    DATA: BEGIN OF itab OCCURS 0,
         NO(5),
         bnfpo LIKE eban-bnfpo,
         bsart LIKE eban-bsart,
         matnr LIKE eban-matnr,
         lgort LIKE eban-lgort,
         menge LIKE eban-menge,
         bednr LIKE eban-bednr,
         lfdat LIKE eban-lfdat,
         TX(132),
         END OF itab.
    DATA :
    prheader LIKE TABLE OF bapimereqheader WITH HEADER LINE,
    prheaderx LIKE TABLE OF bapimereqheaderx WITH HEADER LINE,
    PRITEMEXP LIKE TABLE OF BAPIMEREQITEM WITH HEADER LINE,
    return LIKE TABLE OF bapiret2 WITH HEADER LINE,
    pritem LIKE TABLE OF bapimereqitemimp WITH HEADER LINE,
    pritemx LIKE TABLE OF bapimereqitemx WITH HEADER LINE,
    PRITEMTEXT LIKE TABLE OF BAPIMEREQITEMTEXT WITH HEADER LINE.
    DATA auxfilename LIKE rlgrap-filename.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
       filename     = 'C:\PRCREATE.TXT'
       filetype     = 'DAT'
    IMPORTING
       act_filename = auxfilename
    TABLES
       data_tab     = itab.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

  • Unable to create Service PR using BAPI_PR_CREATE

    Hi Guys,
    I am creating PRs using BAPI_PR_CREATE. I am able to create all type of PRs except Service.
    I have tried passing additional data to structures servicelines, servicelinesx, serviceaccount, serviceaccountx, but still i could not able to create service PR successfully. Getting error message like 'In case of account assignmernt, please enter acc. assignment data for item'.
    Please let me know what data I need to pass to get service PR created.
    Thx in advance.

    Hi,
    In order to create the Service PR you need to pass the list of services in a way similar to that in which they appear in the ESLL table i.e with the combination of the package number and the subpackage number and that option is not there in this bapi so either you need to activate the properties of the business function LOG_MM_CI_2 using the T-Code SFW5 or you need to use the
    BAPI:-       'BAPI_REQUISITION_CREATE'
    In which need to pass the following tables:-
    REQUISITION_ITEMS
    REQUISITION_SERVICES
    REQUISITION_SRV_ACCASS_VALUES
    The First table will contain the data relevant to the items that will be created in the PR.
    The Second table will contain the Header and Item level data for each item defined in the previous table
    Say for Example:-
    Header Data You need to pass a Pack Number that could be any number I passed 1234 and then the sub package number will be the pack number + 1. Other fields that we need to pass are ext_line line_no and short_text.
    ITEM DATA   Here we need to pass the subpackNumber from the header data as the pack number
    and the sub pack number will be left blank here at the item level and the other details like the qty and gross price and the activity number and others will be passed here.
    So if there are multiple services( Say 5 ) in the single line item of a PR you should create a single header data and append that to the table REQUISITION_SERVICES and then you must create or get the item data 5 times one for each service and append all those to the same table   REQUISITION_SERVICES.
    Third Table  This table will contain the account assignment data for the line items of the PR.
    In Case of any issue do revert back and i will give you the test data.
    <removed by moderator>
    Regards,
    Dev
    Message was edited by: Thomas Zloch

  • Error whil creating Service Line item in ME51N using BAPI_PR_CREATE

    Hi Experts,
                Am able to create PR number using BAPI_PR_CREATE, but when am trying to create Service line item am getting acc assignment error please check my code and solve my issue. ..its very adj  please help me .
    DATA : t_bapimereqitemimp TYPE TABLE OF bapimereqitemimp ,
          t_bapimereqaccount TYPE TABLE OF bapimereqaccount,
          t_bapimereqaccountx TYPE TABLE OF bapimereqaccountx,
          t_pritemx    TYPE TABLE OF bapimereqitemx,
          wa_bapimereqitemimp        TYPE bapimereqitemimp,
          pr_number  TYPE bapimereqheader-preq_no,
          wa_prheader  TYPE   bapimereqheader,
          wa_prheaderx TYPE  bapimereqheaderx,
          wa_pritemx   TYPE  bapimereqitemx,
          wa_bapimereqaccountx TYPE bapimereqaccountx,
          wa_bapimereqaccount TYPE bapimereqaccount,
          t_return     TYPE TABLE OF bapiret2,
          wa_return    TYPE bapiret2.
    DATA : t_bapi_srv_limit_data TYPE TABLE OF bapi_srv_limit_data,
            wa_bapi_srv_limit_data TYPE bapi_srv_limit_data.
    DATA servicelimitx  TYPE TABLE OF bapi_srv_limit_datax.
    DATA w_servicelimitx  TYPE bapi_srv_limit_datax.
    DATA : t_servicelines TYPE TABLE OF bapi_srv_service_line,
            w_servicelines TYPE bapi_srv_service_line,
            t_servicelinesx TYPE TABLE OF bapi_srv_service_linex,
            w_servicelinesx TYPE bapi_srv_service_linex,
            t_bapi_srv_acc_data TYPE TABLE OF bapi_srv_acc_data,
            w_bapi_srv_acc_data TYPE bapi_srv_acc_data,
            t_bapi_srv_acc_datax TYPE TABLE OF bapi_srv_acc_datax,
            w_bapi_srv_acc_datax TYPE bapi_srv_acc_datax.
    DATA : t_bapimereqitem TYPE TABLE OF bapimereqitem,
            w_bapimereqitem TYPE bapimereqitem.
    DATA :  t_bapimereqitemx TYPE TABLE OF bapimereqitemx,
            w_bapimereqitemx TYPE bapimereqitemx.
    wa_prheader-pr_type  = 'RV'."lv_doc_type.
    wa_prheaderx-pr_type = 'X'.
    wa_bapimereqitemimp-preq_item  = '1'."wa_eban-item.
    wa_bapimereqitemimp-pur_group  = '100'."wa_eban-ekgrp.
    wa_bapimereqitemimp-preq_name  = 'E.R. TITTO'."wa_eban-afnam.
    wa_bapimereqitemimp-short_text = 'AC Fitting'."wa_eban-txz01.
    wa_bapimereqitemimp-material   = ' '."wa_eban-matnr.
    wa_bapimereqitemimp-plant      = '1000'."wa_eban-werks.
    wa_bapimereqitemimp-store_loc  = 'ST00'."wa_eban-lgort.
    wa_bapimereqitemimp-matl_group = 'Z13'."wa_eban-matkl.
    wa_bapimereqitemimp-quantity   = '1'."wa_eban-menge.
    wa_bapimereqitemimp-unit       = 'AU'."wa_eban-meins.
    wa_bapimereqitemimp-deliv_date =  '20140604'."wa_eban-lfdat.
    wa_bapimereqitemimp-preq_price = '100'."wa_eban-preis.
    wa_bapimereqitemimp-item_cat   = 'D'."wa_eban-pstyp.
    wa_bapimereqitemimp-acctasscat =  'K'."wa_eban-knttp.
    wa_bapimereqitemimp-fixed_vend = ' '."wa_eban-flief.
    wa_bapimereqitemimp-purch_org  = '1000'."wa_eban-ekorg.
    wa_bapimereqitemimp-currency   = 'INR'."wa_eban-waers.
    wa_bapimereqitemimp-pckg_no = '00000001'.
    wa_bapimereqaccount-preq_item  = '1'."wa_eban-item.
    *wa_bapimereqaccount-serial_no  = '01'.
    wa_bapimereqaccount-gl_account = '0000002244'."wa_eban-sakto.
    wa_bapimereqaccount-costcenter = 'OPSD'."wa_eban-kostl.
    APPEND wa_bapimereqitemimp TO t_bapimereqitemimp.
    APPEND wa_bapimereqaccount TO t_bapimereqaccount.
    wa_pritemx-preq_item  = '1'."wa_eban-item.
    wa_pritemx-pur_group  = 'X'.
    wa_pritemx-preq_name  = 'X'.
    wa_pritemx-short_text = 'X'.
    wa_pritemx-material   = 'X'.
    wa_pritemx-plant      = 'X'.
    wa_pritemx-store_loc  = 'X'.
    wa_pritemx-matl_group = 'X'.
    wa_pritemx-quantity   = 'X'.
    wa_pritemx-unit       = 'X'.
    wa_pritemx-deliv_date = 'X'.
    wa_pritemx-preq_price = 'X'.
    wa_pritemx-item_cat   = 'X'.
    wa_pritemx-acctasscat = 'X'.
    wa_pritemx-fixed_vend = 'X'.
    wa_pritemx-purch_org  = 'X'.
    wa_pritemx-currency   = 'X'.
    wa_pritemx-pckg_no   = 'X'.
    wa_bapimereqaccountx-preq_item  = '1'."wa_eban-item.
    *wa_bapimereqaccountx-serial_no  = '01'.
    wa_bapimereqaccountx-preq_itemx = 'X'.
    wa_bapimereqaccountx-serial_nox = 'X'.
    wa_bapimereqaccountx-gl_account = 'X'.
    wa_bapimereqaccountx-costcenter = 'X'.
    APPEND wa_pritemx TO t_pritemx.
    APPEND wa_bapimereqaccountx TO t_bapimereqaccountx.
    **Service item limit
    *wa_bapi_srv_limit_data-doc_item = '10'.
    wa_bapi_srv_limit_data-overall_limit = '1000'.
    wa_bapi_srv_limit_data-exp_value = '800'.
    APPEND wa_bapi_srv_limit_data TO  t_bapi_srv_limit_data.
    *w_servicelimitx-doc_item = '10'.
    w_servicelimitx-overall_limit = 'X'.
    w_servicelimitx-exp_value = 'X'.
    APPEND w_servicelimitx TO servicelimitx.
    w_bapimereqitem-preq_item = '10'.
    ***w_bapimereqitem-preq_name = 'E.R. TITTO'.
    ***w_bapimereqitem-plant = '1000'.
    ***w_bapimereqitem-store_loc = 'ST00'.
    ***w_bapimereqitem-matl_group = 'Z03'.
    ***w_bapimereqitem-quantity = '1'.
    ***w_bapimereqitem-unit = 'AU'.
    w_bapimereqitem-item_cat = 'D'.
    w_bapimereqitem-deliv_time = '20140604'.
    w_bapimereqitem-acctasscat = 'K'.
    **w_bapimereqitem-consumpt = 'U'.
    APPEND w_bapimereqitem TO t_bapimereqitem.
    **w_bapi_srv_acc_data-doc_item = '1'.
    **w_bapi_srv_acc_data-outline = '0000000001'.
    *w_bapi_srv_acc_data-srv_line = '20'.
    w_bapi_srv_acc_data-serial_no = '10'.
    w_bapi_srv_acc_data-serial_no_item = 'D'.
    *w_bapi_srv_acc_data-quantity = '1'.
    *APPEND w_bapi_srv_acc_data TO t_bapi_srv_acc_data.
    **w_bapi_srv_acc_datax-doc_item = '1'.
    **w_bapi_srv_acc_datax-outline = '0000000001'.
    *w_bapi_srv_acc_datax-srv_line = '20'.
    **w_bapi_srv_acc_datax-serial_no = '01'.
    **w_bapi_srv_acc_datax-serial_no_item = '01'.
    *w_bapi_srv_acc_datax-quantity = '1'.
    *APPEND w_bapi_srv_acc_datax TO t_bapi_srv_acc_datax.
    w_servicelines-service = '00000001'.
    APPEND w_servicelines TO t_servicelines.
    w_servicelinesx-service = 'X'.
    APPEND w_servicelinesx TO t_servicelinesx.
    CALL FUNCTION 'BAPI_PR_CREATE'
       EXPORTING
         prheader        = wa_prheader
         prheaderx       = wa_prheaderx
       IMPORTING
         number          = pr_number
       TABLES
         return          = t_return
         pritem          = t_bapimereqitemimp
         pritemx         = t_pritemx
         pritemexp       = t_bapimereqitem
         praccount       = t_bapimereqaccount
         praccountx      = t_bapimereqaccountx
         servicelimit    = t_bapi_srv_limit_data
         servicelimitx   = servicelimitx
         servicelines    = t_servicelines
         servicelinesx   = t_servicelinesx
         serviceaccount  = t_bapi_srv_acc_data
         serviceaccountx = t_bapi_srv_acc_datax.

    Hi,
    Check this Thread , Thread1 . It might help you to resolve the issue.
    Thanks
    KH

  • How to create SERVICE PR using BAPI_PR_CREATE

    Hi everyone,
    How to create SERVICE PR using BAPI_PR_CREATE
    Regards,
    My Code(it doesn't work,I don't know what's wrong.):
    *& Report  ZWTEST
    REPORT  zwtest.
    DATA: header TYPE bapimereqheader,
          headerx TYPE bapimereqheaderx,
          item LIKE TABLE OF bapimereqitemimp WITH HEADER LINE,
          itemx LIKE TABLE OF bapimereqitemx WITH HEADER LINE,
          account  LIKE TABLE OF bapimereqaccount WITH HEADER LINE,
          accountx LIKE TABLE OF bapimereqaccountx WITH HEADER LINE,
          service LIKE TABLE OF bapi_srv_service_line WITH HEADER LINE,
          servicex LIKE TABLE OF bapi_srv_service_linex WITH HEADER LINE,
          serviceaccount LIKE TABLE OF  bapi_srv_acc_data WITH HEADER LINE,
          serviceaccountx  LIKE TABLE OF bapi_srv_acc_datax WITH HEADER LINE,
          preq_no LIKE  bapimereqheader-preq_no,
          lt_return LIKE TABLE OF bapiret2 WITH HEADER LINE,
          wa_return LIKE bapiret2.
    header-pr_type = 'NB'."订单类型(采购)
    headerx-pr_type = 'X'.
    CLEAR: item.
    item-preq_item = '00010'.
    item-pur_group = '426'."采购组
    item-short_text = '服务类PR'."短文本
    item-plant = '1051'."工厂
    item-matl_group = 'AS07'."物料组
    item-item_cat = '9'."项目类别
    item-acctasscat = 'K'."科目分配类别
    item-pckg_no = '0000000001'."软件包编号
    APPEND item.
    CLEAR: itemx.
    itemx-preq_item = '00010'.
    itemx-preq_itemx = 'X'.
    itemx-pur_group = 'X'."采购组
    itemx-short_text = 'X'."短文本
    itemx-plant = 'X'."工厂
    itemx-matl_group = 'X'."物料组
    itemx-item_cat = 'X'."项目类别
    itemx-acctasscat = 'X'."科目分配类别
    itemx-pckg_no = 'X'."软件包编号
    APPEND  itemx.
    CLEAR: account.
    account-preq_item = '00010'.
    account-serial_no = '01'.
    *account-quantity = '0.955'.
    *account-distr_perc = '95.5'.
    account-gl_account = '4205020000'.
    account-costcenter = '1042000001'.
    *account-co_area = 'CNOC'.
    *account-profit_ctr = '9999999999'.
    APPEND account.
    CLEAR: accountx.
    accountx-preq_item = '00010'.
    accountx-serial_no = '01'.
    accountx-preq_itemx = 'X'.
    accountx-serial_nox = 'X'.
    *accountx-quantity = 'X'.
    *accountx-distr_perc = 'X'.
    accountx-gl_account = 'X'.
    accountx-costcenter = 'X'.
    *accountx-co_area = 'X'.
    *accountx-profit_ctr = 'X'.
    APPEND accountx.
    CLEAR: service.
    service-doc_item = '00010'.
    service-outline = '0000000001'.
    service-srv_line = '0000000010'.
    service-short_text = 'service test'.
    service-quantity = '10.000'.
    service-uom = 'AU'.
    service-gross_price = '10.00'.
    service-currency = 'CNY'.
    *service-matl_group = 'AS07'."物料组
    APPEND service.
    CLEAR: servicex.
    servicex-doc_item = '00010'.
    servicex-outline = '0000000001'.
    servicex-srv_line = '0000000010'.
    servicex-short_text = 'X'.
    servicex-quantity = 'X'.
    servicex-uom = 'X'.
    servicex-gross_price = 'X'.
    servicex-currency = 'X'.
    *servicex-matl_group = 'X'.
    APPEND servicex.
    CLEAR: serviceaccount.
    serviceaccount-doc_item = '00010'.
    serviceaccount-outline = '0000000001'.
    serviceaccount-srv_line = '0000000010'.
    serviceaccount-serial_no = '01'.
    serviceaccount-serial_no_item = '01'.
    serviceaccount-percent = '100'.
    APPEND serviceaccount.
    CLEAR: serviceaccountx.
    serviceaccountx-doc_item = '00010'.
    serviceaccountx-outline = '0000000001'.
    serviceaccountx-srv_line = '0000000010'.
    serviceaccountx-serial_no = '01'.
    serviceaccountx-serial_no_item = 'X'.
    serviceaccountx-percent = 'X'.
    APPEND serviceaccountx.
    CALL FUNCTION 'BAPI_PR_CREATE'
      EXPORTING
        prheader               = header
        prheaderx              = headerx
    *   TESTRUN                =
      IMPORTING
        number                 = preq_no
    *   PRHEADEREXP            =
      TABLES
        return                 = lt_return
        pritem                 = item
        pritemx                = itemx
    *   PRITEMEXP              =
    *   PRITEMSOURCE           =
        praccount              = account
    *   PRACCOUNTPROITSEGMENT  =
        praccountx             = accountx
    *   PRADDRDELIVERY         =
    *   PRITEMTEXT             =
    *   PRHEADERTEXT           =
    *   EXTENSIONIN            =
    *   EXTENSIONOUT           =
    *   PRVERSION              =
    *   PRVERSIONX             =
    *   ALLVERSIONS            =
    *   PRCOMPONENTS           =
    *   PRCOMPONENTSX          =
    *   SERVICEOUTLINE         =
    *   SERVICEOUTLINEX        =
        servicelines           = service
        servicelinesx          = servicex
    *   SERVICELIMIT           =
    *   SERVICELIMITX          =
    *   SERVICECONTRACTLIMITS  =
    *   SERVICECONTRACTLIMITSX =
        serviceaccount         = serviceaccount
        serviceaccountx        = serviceaccountx
    *   SERVICELONGTEXTS       =
    *   SERIALNUMBER           =
    *   SERIALNUMBERX          =
    * 处理错误消息:通过判断消息的类型,来判断BAPI是否成功
    READ TABLE lt_return INTO wa_return WITH KEY type = 'E'.
    IF sy-subrc = 0.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
      WRITE: / '成功创建采购申请', preq_no.
    ENDIF.
    LOOP AT lt_return INTO wa_return.
      WRITE: / wa_return-message, wa_return-type, wa_return-id, wa_return-number.
    ENDLOOP.

    see note:
    1950319 - How to create service PR with BAPI_PR_CREATE.pdf

  • Create a Service Purchase Requisition using BAPI_PR_CREATE

    Hi Everyone,
    I am using BAPI_PR_CREATE.
    I am able to create Standard Purchase requisition.
    But while creating Service Purchase Requisition, i am not able to create.
    I am getting no errors for the PR Item, but even after entering Services for the PR Item i am getting error message in return table of bapi "Please Maintain Services or limits'.
    Do i have to pass value to Package_No field in the item level table of BAPI_PR_CREATE.
    Please help.
    Regards,
    Akash

    Hi,
    Check this link for creation of services.
    Bapi_pr_change in services
    PO Upload through BAPI_PO_CREATE1 - Problem in Service Item
    BAPI_PO_CREATE1 Error
    Hope it helps
    Sujay

  • Create service PR using BAPI_PR_CREATE

    Hi experts,
    I am trying to create service PR using BAPI_PR_CREATE, though i am a able to create a service PR with account assignment category =  'K'(i.e. cost centre), I am not ble to create PR with acc. assign. category = 'N' (i.e. network).
    It gives me an error saying please entre operation/activity number, when i pass the activity number in the acc. assgn. data structure in the BAPI, it gives an error that the network XXX cannot be assigned with an the activity number.
    As this BAPI is for ME51N, i do not understand why does it ask for an activity number.Can you please help.
    Regards

    Solved Using Item category 9 instead of D

  • Error on creation of PR using BAPI_PR_CREATE

    Hello All,
    while creating a PR using BAPI_PR_CREATE getting an error simultaneously a PR is creating
    The error is Enter a G/L Account. Even when I am providing with the G/L Account number.
    There is one input field as SERIAL_NO in tables PRACCOUNT and PRACCOUNTX. If I give SERIAL_NO as 00 in tables PRACCOUNT and PRACCOUNTX, then  it gives the same error but and no PR is created but if i give 01 it gives the same error but and now PR is created simultaneouly .
    Using the same details if I execute BAPI_REQUISITION_CREATE and SERIAL_NO as 00, the PR is successfully created.
    Please let me know if anybody worked on it.
    Thanks & Regards,
    Ruchi Tiwari

    Hi,
    you just need to populate the following fields:
    praccount-preq_item = '10'. <--- this depends on how many items you have in your PR.
    praccount-serial_no = '1'. <--- this one is required, in case you split the qty of the item by G/L or Cost Center.
    dont forget to populate the ff. fields in the Purchase Requisition Change Parameter - Account Assignment table.
    praccountx-preq_item = '10'.
    praccountx-serial_no = '1'.
    Thanks & regards,
    ShreeMohan

  • How to add components to a subcontract PR using BAPI_PR_CREATE

    I am trying to use BAPI_PR_CREATE in SAP ECC 6.0 to create a Purchase Requisition with Item Category "L" (subcontracting) to be subcontracted to a vendor for repair.  Normally, in ME51N, we would add components to the PR before creating it, but I can't see any way to do that with this BAPI, and the documentation doesn't say.
    The result is an error with the following messages:
    T ID                   NUM MESSAGE
    E BAPI                 001 No instance of object type PurchaseRequisition has been created. External reference: # 1
    E ME                   154 Not possible to determine any components
    E ME                   642 Subcontracting only possible with vendor
    The error 154 (Not possible to determine any components) is the same message that would appear in ME51N if the components were not added for the repair.
    The error 642 (Subcontracting only possible with vendor) is confusing because a valid vendor number is being supplied to the FIXED_VEND field in PRITEM and the equivalent field in PRITEMX is marked with X.
    Any help would be greatly appreciated.

    Very late reply - but hoping it might help somebody in the future:
    SAP Note 1489799 - ME 154: Creating subcontracting purchase requisition w/o BOM

  • Using BAPI_PR_CREATE , but failed to overwrite the item short text

    As I want to create PR items and rewrite the items' short text,
    even if i have give the short_text some  values ,
    but it still to be the default value after the PR items created.
    The following is main part of my program using BAPI  'BAPI_PR_CREATE' to create PR:
         w_pritem-material = t_in-matnr.
          perform frm_add_zero using w_pritem-material.
         W_PRITEM-PREQ_ITEM = SY-TABIX.
          w_pritem-preq_item = l_tabix.
          perform frm_add_zero using w_pritem-preq_item.
          w_pritem-acctasscat = t_in-knttp.
          w_pritem-plant = t_in-werks.
         W_PRITEM-STORE_LOC = '1003'.
          w_pritem-quantity = t_in-menge.
          w_pritem-SHORT_TEXT = t_in-txz01.
          append w_pritem to t_pritem.
          w_pritemx-preq_item = w_pritem-preq_item.
          w_pritemx-material = 'X'.
          w_pritemx-preq_itemx = 'X'.
          w_pritemx-acctasscat = 'X'.
          w_pritemx-plant = 'X'.
         W_PRITEMX-STORE_LOC = 'X'.
          w_pritemx-quantity = 'X'.
            w_pritemx-SHORT_TEXT = 'X'.
          append w_pritemx to t_pritemx.
        call function 'BAPI_PR_CREATE'
            exporting
                prheader = w_prhead
                prheaderx = w_prheadx
            importing
                number =  l_prnum
            tables
                return =  t_return
                pritem =  t_pritem
                pritemx = t_pritemx
                praccount = t_praccount
                praccountx = t_praccountx
                pritemtext = t_pritemtext
    Ivan Yang

    Now I try to use 'BAPI_REQUISITION_CREATE'  to instead of 'BAPI_PR_CREATE'.
    But it still fail , it always give a error message like that 'No direct postings can be made to G/L acct.'.
    Pls note that the ACCTASSCAT is setted to be 'M' , and I am sure that all the data entries can generate a PR without problem
    while using 'BAPI_PR_CREATE'.
    Following is the main part of my program:
    PR_ITEM-DOC_TYPE   = T_in-BSART.
    PR_ITEM-PREQ_ITEM  = l_tabix.
    perform frm_add_zero using PR_ITEM-PREQ_ITEM.
      PR_ITEM-ACCTASSCAT = 'M' .
    PR_ITEM-MATERIAL = t_in-MATNR.
      perform frm_add_zero using PR_ITEM-MATERIAL.
          if t_in-txz01 is not initial.
            PR_ITEM-SHORT_TEXT = t_in-txz01.
          endif.
        PR_ITEM-QUANTITY  = T_IN-MENGE.
        PR_ITEM-DELIV_DATE = '20090801'. 
        PR_ITEM-PLANT  = T_IN-WERKS.
        PR_ITEM-PREQ_DATE = '20090801'.
        APPEND PR_ITEM.
        PR_ACCOUNT-PREQ_ITEM = PR_ITEM-PREQ_ITEM.
        PR_ACCOUNT-G_L_ACCT = T_IN-SAKNR.  
        PR_ACCOUNT-SERIAL_NO = 1.
         PR_ACCOUNT-CO_AREA =  'XXX'.
          PR_ACCOUNT-PREQ_QTY = t_in-MENGE.
          PR_ACCOUNT-sd_doc = t_in-vbeln.
          perform frm_add_zero using PR_ACCOUNT-sd_doc.
          PR_ACCOUNT-SDOC_ITEM = t_in-posnr.
          perform frm_add_zero using PR_ACCOUNT-SDOC_ITEM.
        APPEND PR_ACCOUNT.
        CLEAR PR_ACCOUNT.
         CLEAR PR_ITEM.
    CALL FUNCTION 'BAPI_REQUISITION_CREATE'
    EXPORTING
      SKIP_ITEMS_WITH_ERROR                =
      AUTOMATIC_SOURCE                     = 'X'
           IMPORTING
             NUMBER                               = l_prnum
            TABLES
              REQUISITION_ITEMS                    = PR_ITEM
              REQUISITION_ACCOUNT_ASSIGNMENT       = PR_ACCOUNT
              RETURN                               = PR_RETURN
    Ivan Yang

  • Error while creating stock using tcode: MB1C

    Error while creating stock using tcode: MB1C
    The Error is: Check table T004F:entry G006 does not exist

    Hi ,
    Please check the FSV (field status variant) for your company code in OBY6 .
    then go to transaction code OB14 --> enter the FSV --> Check if field status group G006(Material account) is maintained there or not.
    if not please maintain it.
    Thanks & Regards
    Anshu

  • Logical error in creating tables using db link in solaris

    Hi,
    While creating table using the syntax create table newtab...as select * from tab@dblink .. I am facing a problem. The newtab table created is having a structure different (from datalength point of view of varchar2 and char datatypes) from the source. The data length is getting tripled i.e. if a column a is varchar2(20) in tab then it is becoming --- a varchar2(60) in newtab. This is happening in solaris environment when the two databases are in 2 different servers. Please let me know if there are any patches to resolve the problem.
    Thanks
    Arnab

    ORA-02019: connection description for remote database not foundHave you used this database link successfully for some other queries?
    The error posted seems to indicate that the DB Link is not functional at all. Has it worked for any other type of DML operation or is this the first time you ever tried to use the link?

  • How to save report in PersonalCategory  after creating it using java panel?

    Hi,
    Anybody knows How to save report in PersonalCategory  after creating it using java panel?
    I dont want to save it in public folder. I want to save report (webi) in user's personal category.
    can anybody send me source code?
    It will help me a lot.
    Thanks in advance
    Amol Mali

    Hi teda,
    i'm assuming that you have seen my post that i did successfuly save report in user's personal category.
    Actually the report is created in webi java panel using RE SDK and  is saved in Report Sample Folder then i'm saving it in user's personal category by following code
    string query = "Select SI_PERSONAL_CATEGORIES From CI_INFOOBJECTS Where "
                         + "SI_INSTANCE=0 And SI_ID=" + reportID;
                    InfoObjects infoObjects = infoStore.Query(query);
                    InfoObject infoObject = infoObjects[1];
                    Webi wreport = (Webi)infoObject;
                    ObjectRelativeIDs personalIDs = wreport.PersonalCategories;
                /personalIDs.Add(Convert.ToInt32(categoryID));
                   infoStore.Commit(infoObjects);
    But the report is presents in the Folder also and in user's personal category also.
    I dont want the report to be in the folder (Report Sample) if i saved it in user's personal category.
    How can i do that?
    any idea.
    Please help me.
    Thanks in advance
    Amol Mali
    Edited by: amol mali on Jan 9, 2009 7:55 PM

  • I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?

    I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?
    I have tried back ups and  restoring, resetting, and even updating the pages app. And nothing has worked.

    I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?
    I have tried back ups and  restoring, resetting, and even updating the pages app. And nothing has worked.

Maybe you are looking for

  • There is no data in the partitioned  tablespace?

    I am creating a new partition table like this: create table PART_TABLE eid number(10), ename varchar2(30), hiredate date, jdate date, pdate date nologging parallel partition by range(hiredate) partition par_new1 values less than (to_date('01-JAN-2009

  • Problems, trying to use backup from 5.1.1 iOS Gen 3 iPod does not sync music to 4th gen iOS 6 iPod.

    My 3rd Gen iPod's headphone connector is basically shot, I've had it for around if not over two years now; sometimes I'm surprised it lasted this long; since I am not one who usually listens to her music without headphones, this is problematic, . Luc

  • Likely usage costs in the UK??

    From what I can tell from the O2 web site data and Wi-Fi access is unlimited (with a fair usage policy). My questions are: 1) I assume that this includes all email and web access? 2) I understand that there will be an agreement with the The Cloud to

  • How to upload the .tiff file

    when i try to the upload the .tiff file using RSTXLDMC program am not suceeded.. help me... is there any transaction for preview purpose.... of what ever .tiff files upl

  • Select item list

    is their a way to do a add from a select item list. IE: created a view of the items i wanted to select off. based on this view i want to select it from the select item list and then add these records to another table. table 1: item id, item descripti