Batch not updating while creating delivery using bapi

Hi
I have used following bapi to create delivery BAPI_DELIVERYPROCESSING_EXEC and passed the following parameters into bapi
lt_request-document_type = 'A'.
        lt_request-document_numb = deltab-vbeln.
        lt_request-document_item = deltab-posnr.
        lt_request-batch        = deltab-charg.
        lt_request-material = deltab-matnr.
        lt_request-plant = '3200'.
        lt_request-quantity_base__uom = deltab-kwmeng.
        lt_request-delivery_date = sy-datum.
CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'
EXPORTING
DELIVERY_EXTEND =
TECHN_CONTROL =
      TABLES
      request = lt_request
      createditems = lt_createditems
      return = lt_return.
here i am able to create delivery successfully but the batch which i passed in bapi is not getting updated in vl02n to do PGI.
again i need to go to vl02n and give batch and quanitty manually to do PGI.is there anyway that batch gets updated in vl02n also.
Regards,
Venkat.

Hi
My answer is pure assumption.
Please check the following OSS notes
Note 758810 - BAPI_PO_CHANGE vendor batch and batch not visible
Note 1230268 - Field Vendor Batch never filled for PO BAPIs
Please take help from BASIS and SAP, before implementing the OSS note
Regards
Madhan D

Similar Messages

  • Problem while creating assets using BAPI

    Use table enhancement BAPI_TE_ANLU
    Diagnosis :The BAPIs for creating and changing assets currently support only those customer enhancements that relate to the user fields created using SAP enhancement AIST0002.
    Can anybody give the appropriate solution why this error is coming while creating assets using BAPI.

    Looks like you are trying to transfer custom fields into the asset master data that were not added following the steps in enhancement AIST0002.
    Using EXTENSIONIN parameter, you can transfer user fields from the asset master record. However, it is not possible to transfer fields that are updated in user-defined tables. Only user fields that were defined using SAP enhancement AIST0002 and are automatically updated in table ANLU can be udpated in this way. This means you have to use table extension BAPI_TE_ANLU.
    Enhancement AIST0002 contains function module EXIT_SAPL1022_001 as a component in which user fields can be implemented.
    The documentation ( BAPIPAREX) of the structure that forms the basis for this parameter contains additional information about using this parameter.
    Please check how table ANLU has been enhanced and also go through the documentation of enhancement AIST0002.
    Regards,
    Shyam

  • Planner group is not updated in service notification using BAPI

    Hi,
    Planner group is not updated in service notification using BAPI BAPI_ALM_ORDER_MAINTAIN.
    I have written the below code, but planner group is not updated in the service notification.
    Please advice which parameters do i need to pass to update planner group in the service notification.
              wa_methods-refnumber      = '000001'.
              wa_methods-objecttype     = 'PARTNER'.
              wa_methods-method         = 'CREATE'.
              wa_methods-objectkey      = wa_subscr1-aufnr.
              APPEND wa_methods TO i_methods.
              wa_methods-refnumber      = '000002'.
              wa_methods-objecttype     = 'HEADER'.
              wa_methods-method         = 'CREATE'.
              wa_methods-objectkey      = wa_subscr1-aufnr.
              APPEND wa_methods TO i_methods.
              wa_methods-refnumber      = '000000'.
              wa_methods-objecttype     = ' '.
              wa_methods-method         = 'SAVE'.
              APPEND wa_methods TO i_methods.
              REFRESH i_partner.
              CLEAR wa_partner.
              wa_partner-orderid        = wa_subscr1-aufnr.
              wa_partner-partn_role     = 'VW'.
              wa_partner-partn_role_old = ''.
              wa_partner-partner        = wa_subscr1-parnr.
              wa_partner-partner_old    = ''.
              APPEND wa_partner TO i_partner.
              REFRESH i_planrgrp.
              CLEAR wa_planrgrp.
              wa_planrgrp-orderid        = wa_subscr1-aufnr.
              wa_planrgrp-plangroup      = wa_subscr1-ingpr.
              APPEND wa_planrgrp TO i_planrgrp.
              REFRESH i_planrgrp_up.
              CLEAR wa_planrgrp_up.
              wa_planrgrp_up-orderid     = wa_subscr1-aufnr.
              wa_planrgrp_up-plangroup   = 'X'.
              APPEND wa_planrgrp_up TO i_planrgrp_up.
    *----Change order details with Technician name
              CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
                TABLES
                  it_methods   = i_methods
                  it_header    = i_planrgrp
                it_header_up = i_planrgrp_up
                  it_partner   = i_partner
                  return       = i_return.
    Thanks & regards,
    Krishna

    Try this way
    CALL FUNCTION 'BAPI_SERVNOT_CREATE'
    EXPORTING
    * EXTERNAL_NUMBER =
    notif_type = 'S3'
    notifheader = ls_notif_h
    * TASK_DETERMINATION = ' '
    * SENDER =
    * ORDERID =
    IMPORTING
    NOTIFHEADER_EXPORT = ls_notif_e
    TABLES
    * NOTITEM =
    * NOTIFCAUS =
    * NOTIFACTV =
    * NOTIFTASK =
    * NOTIFPARTNR =
    * LONGTEXTS =
    * KEY_RELATIONSHIPS =
    return = lt_return
    * IF lt_return IS INITIAL.                                               " <<< Comment this lie
    read table  lt_return into ls_return with key type = 'E'. " << Change
    if sy-subrc ne 0.                                                             " << Change
    COMMIT WORK AND WAIT.
    write: / ls_notif_e-NOTIF_NO.
    ELSE.
    LOOP AT lt_return INTO ls_return.
    WRITE:/ 'errors'.
    * ls_return.
    ENDLOOP.
    endif.

  • Entity Attributes are not populating while creating EO using EO wizard.

    Hi,
    I am using JDeveloper version 10.1.3.3.0.3 and E-Business suite12.1.2.
    I am facing problem while creating EO using EO wizard.
    In Entity Object Editor Entity Attributes are not populating while creating EO.
    Please help me resolve this issue.
    Thanks & Regards,
    Sagarika

    Please ensure you click on Tables and Synonyms check box and select proper schema.
    Try to select the table from the list after this instead of writing as in 10.1.3 when we write table name it automatically selects from the list if it exists in the list.
    Thanks
    AJ

  • Account assignment while creating reservation using bapi

    Hi , I am creating reservation using BAPI  (BAPI_RESERVATION_CREATE1), but when I seeing the open reservation account assignment field is blank, could any on ehelp me on this, i.e what parameter I am missing in BAPI for account assignment.
    best regards
    pankaj

    Hi,
    there is not field to assign the account assignment in Bapi..
    you need to assignt he account manaually.
    Assign account assignment category.
        SELECT * FROM eban INTO TABLE lt_eban WHERE banfn = w_banfn .
        IF sy-subrc = 0.                                     
          LOOP AT lt_eban .                 
            lt_eban-knttp = 'J'.    "assign your own account categeory
            MODIFY eban FROM lt_eban.
            COMMIT WORK AND WAIT.                            
          ENDLOOP.
    endif.
    Regards,
    Prabhudas

  • Error while creating BOM using BAPI 'BAPI_BOM_UPLOAD_SAVE'

    Hi All,
    We are getting an error as 'Data is incomplete' while trying to create BoM using the bapi 'BAPI_BOM_UPLOAD_SAVE', if the item contains Item category as 'T'. But for other item category like 'L' or 'N', the bapi is sucessfull.
    The values that we pass to fill the item category 'T' are operation, item_cat, bom_itm_no, COMPON_QTY, FIXED_QTY as 'X', UNMEAS as 'ST', ITEM_TEXT1 and ITEM_TEXT2.
    Anyone who has faced same problem or has a solution to the problem, kindly provide a solution.
    Regards,
    Vijay

    The error you receive is because of different config for different Item Categories. Find out from the functional team what fields have they kept mandatory for the item category 'T'. You may not be passing one of those fields in the BAPI.
    Try creating a BOM manually for item category 'T' and you may figure our which field you are missing.

  • Error while creating delivery using ME2O

    Hi ,
    We are using ME2O to creat delivery for subcontracting . But I click on "Create delivery" button there is an error message coming.
    The error is as following:
    Global official numbering: Input parameter incomplete
    Message no. ICC_NUMBERING770
    If anyone has any solution for it could you please let me know.
    Thanks in advance.
    Sonali.

    Then make sure you have defined the LB in purchiasng for sub contract order
    Or Goto this document and check that you have did all the config
    External Subcontracting: Configuration Guide
    1     Purpose
    This configuration guide provides the information you need to set up the configuration of this building block manually.
    2     Preparation
    Before you start installing this building block, you must install prerequisite building blocks. For information on the prerequisite building blocks, see the Quick Guide for installing Chemicals (located on the DVD in BBLibraryDocumentationChem_Quick_Guide_EN_US.doc).
    3     Configuration
    3.1     Defining Shipping Data for Plant BP01
    Use
    The purpose of this activity is to maintain the shipping data for the supplying plant. (Shipping of the components)
    Here you maintain the customer number of the receiving plant. This customer number is used in SD shipping processing to identify the goods recipient (ship-to party) if provision has been made in Customizing for a stock transfer to be carried out with an SD delivery
    Procedure
    1.     Access the activity using one of the following navigation options:
    IMG Menu     Materials Management à Purchasing à Purchase Order à Set Up Stock Transport Order à Define Shipping Data for Plants
    Transaction Code     SPRO
    2.     On the Change View “Stock Transport Order”: Overview screen, select the production plant BP01 and choose Details.
    3.     On the Change View “Stock Transport Order”: Details screen, make the following entries:
    Field name     Description     User action and values     Comment
    Plant          BP01     
    Customer no. - plant               
    Sales organization          BP01     
    Distribution channel          03     Intercompany
    Division for intercompany billing          01     Product division 01
    Language key          EN     English
    4.     Save your settings.
    Result
    The shipping data for plant BP01 has been set.
    3.2     Defining Delivery Type for Subcontracting
    Use
    The purpose of this activity is to assign Delivery Type for Subcontracting. For the supply of the input materials to be provided to the vendor (subcontractor) with respect to subcontract purchase orders, you have the option of creating an SD delivery from the list of stocks for a subcontractor.
    In this step, you can specify a delivery type for the delivery of materials to be provided to the subcontractor.
    Procedure
    1.     Access the activity using one of the following navigation options:
    IMG Menu     Materials Management &#61664; Purchasing&#61664; Purchase Order &#61664; Set Up Subcontract Order
    Transaction Code     SPRO
    2.     On the Change View “Subcontracting Data: Delivery Type f. Provision of Material” screen choose New Entries (F5) and make the following entries:
    Field name     Description     User action and values     Comment
    Supplying plant          BP01     
    Del. type f. subcon.          LB     SAP Standard
    3.     Save your settings.
    Result
    The delivery type LB has been assigned.
    3.3     Assigning checking rule
    Use
    The purpose of this activity is to assign the checking rule B = SD-Delivery to the MRP-Group 0000. This rule defines the checking procedure to be used for the availability check.
    Procedure
    1.     Access the activity using one of the following navigation options:
    IMG Menu     Production à Material Requirements Planning  à MRP Groups à Carry out overall maintenance of MRP-Groups
    Transaction Code     SPRO
    2.     On the MRP-Group View choose Plant BP01 and MRP-Group 0000.
    3.     On the View choose the Button: Check.rule dep.reqmt screen make the following entries:
    Field name     Description     User action and values     Comment
    Checking rule          B     
    4.     Save your entries.
    Result
    The checking rule B will be used for the availability check for the components during creating the LB-PO.
    3.4     Defining item category determination in deliveries
    Use
    The purpose of this activity is to maintain the item determination for the delivery type LB and the Item category group VERP. (VERB is used in material master CH-4120)
    Procedure
    1.     Access the activity using one of the following navigation options:
    IMG Menu     Logistic execution à Shipping à Deliveries à Define Item Category Determination in Deliveries
    Transaction Code     0184
    2     On the Change View “Delivery item category determination”: Overview screen copy the entry LB/NORM to LB/VERP. (The item category LBN will be found)
    3     Save your settings.
    Result
    For materials with item category groups VERP you can create a delivery.
    3.5     Assigning Picking Locations
    Use
    The purpose of this activity is to assign the picking locations to the combinations of shipping point and storage condition for every plant.
    Procedure
    1.     Access the activity using one of the following navigation options:
    IMG Menu     Logistics Execution à Shipping à Picking  à Determine Picking Location  à Assign Picking Locations
    Transaction Code     SPRO
    2.     On the Picking location determination screen, make the following entries:
    Field name     Description     User action and values     Comment
    ShPt     Shipping Point     BP01     Shipping point BP01
    Plnt     Plant     BP01     
    SC     Shipping Condition     01     
    Sloc     Storage Location     0001     
    3.     Maintain another entry with the following values:
    Field name     Description     User action and values     Comment
    ShPt     Shipping Point     BP01     Shipping point BP01
    Plnt     Plant     BP01     
    SC     Shipping Condition     02     
    Sloc     Storage Location     0002     
    5.     Save your settings.
    Result
    Storage locations have been assigned.
    3.6     Searching Strategy for DL
    Use
    The purpose of this activity is to allocate the search procedure SD0001 to the order type DL.
    Procedure
    1.     Access the activity using one of the following navigation options:
    IMG Menu     Logistic General &#61664; Batch Management &#61664; Batch Determination and Batch Check &#61664; Batch Search Procedure Allocation and Check Activation &#61664; Allocate SD-Search Procedure/Activate Check
    Transaction Code     SPRO
    2.     Copy any entry for Sales Org. BP01, Distr. Channel 03 and Division 01.
    3.     Change the Sales Doc.Type to DL and save your entry.
    4.     Choose Save.
    Result
    The search strategy SD0001 has been assigned to the sales DL.
    3.7     Activating Automatic Batch Determination for Delivery Item Categories
    Use
    The purpose of this activity is to allocate the automatic batch determination for appropriate delivery item categories.
    Procedure
    1.     Access the activity using one of the following navigation options:
    IMG Menu     Logistics – General &#61614; Batch Management &#61614; Batch Determination and Batch Check &#61614; Activate Automatic Batch Determination in SD
    Transaction Code     SPRO
    2.     On the Choose Activity screen select Activate Automatic Batch Determination for Delivery Item Cat and choose Choose.
    3.     On the Change View “Automatic Batch Determination for Delivery Item Category” screen, make the following entries:
    ItCa     Description     AutBatchDt
    LBN     "Mat. Provided" Item     X
    4.     Choose Save.
    Result
    The automatic batch determination for delivery item categories has been activated for appropriate item categories.
    4     Master Data
    The following activities describe the master data required for this Building Block. The steps do not describe the transactions in detail but list the relevant transaction and the corresponding master data file. For more details on using the individual transactions refer to the Online Help in the system.
    4.1     Creating Customer C-9000 for Subcontract Vendor (S-9000)
    Procedure
    1.     Access the activity using one of the following navigation options:
    SAP Menu     Logistics &#61664; Sales and Distribution &#61664; Master Data &#61664; Business Partner &#61664; Customer &#61664; Create &#61664; Complete
    Transaction Code     XD01
    2.     Refer to the following file for details of the master data required: SMB15_SD_CUSTOMER_O034_J30_Q15.txt.
    4.2     Creating Info Record CH-6120/S-9000
    Procedure
    1.     Access the activity using one of the following navigation options:
    SAP Menu     Logistics &#61664; Materials Management &#61664; Purchasing &#61664; Master Data &#61664; Info Record &#61664; Create
    Transaction Code     ME11
    2.     Refer to the following file for details of the master data required: SMB99_ME11_O250_J01_Q15.TXT.
    4.3     Creating Output Condition Record
    Procedure
    1.     Access the activity using one of the following navigation options:
    SAP Menu     Logistics &#61664; Sales and Distribution &#61664; Master Data &#61664; Output &#61664; Shipping &#61664; Create
    Transaction Code     VV21
    2.     Refer to the following file for details of the master data required: SMB99_VV21_O229_J01_Q15.TXT.
    4.4     Creating Quality Info Record
    Use
    The purpose of this activity is to create the quality Info records for subcontracting.
    Procedure
    1.     Access the activity using one of the following navigation options:
    SAP Menu     Logistics à Quality Management à Quality Planning àLogistics Master Data  à Quality Info Record: Procurement à Create
    Transaction Code     QI01
    2.     Refer to the following file for details of the master data required: SMB18_QI01_O002_Q41_Q15.TXT.
    Result
    The Q-Info record has been created.
    4.5     Change material (add or replace values on Plant data/stor1 - Plant data/stor2.)
    Use
    The purpose of this activity is to add the storage condition to the appropriate material.
    Procedure
    1.     Access the activity using one of the following navigation options:
    SAP Menu     Logistics à Materials Management &#61664; Material Master &#61664; Material &#61664; Change &#61664; Immediately
    Transaction Code     MM02
    2.     Refer to the following file for details of the master data required: SMB10_MM02_O011_P02_Q15.TXT.
    Result
    The storage condition has been added to the material master.

  • Error while creating Contracts using BAPI

    Hello,
    I am trying to use BAPI BUS2014 to create new Purchasing Contracts. Now everything works fine, except for some strange cases where Contracts are failing out with a message as:
    Reference document or master record has different language
    I don't understand it why. Language being set in Contracts is defined for those items in MM and it works for others but not for all. I think I am missing some basic point here. Can anyone please suggest?
    Any help is highly appreciated!
    Cheers
    EssKay

    OK - stupid question. I did figure it out myself. Sorry for my impatience. This is my first BAPI program, so a bit too shaky
    Cheers
    EssKay

  • Ekkn is not updated while creating PO

    hi,
    when i execute my ZRFC for PO creation i am getting this problem.
    ekkn table is not get updated with tax code details but successfully PO created
    i can able to get ADRC , ekko, EKPO details (header and itrem details)
    this is my code
    ""Local Interface:
    *"  TABLES
    *"      LT_EKKO STRUCTURE  ZPO_DATA_60 OPTIONAL
    *"      LT_EKPO STRUCTURE  ZPO_ITEM_60 OPTIONAL
    *"      LT_EKET STRUCTURE  ZPO_EKET_60 OPTIONAL
    *"      LT_ADRC STRUCTURE  ZPO_ADRC_60 OPTIONAL
    *"      LT_EKKN STRUCTURE  ZPO_EKKN_60 OPTIONAL
    *"      LT_EKBE STRUCTURE  ZPO_EKBE_60 OPTIONAL
    *"      LT_SUCCESS_PO STRUCTURE  ZPO_SUCCESS
    *"      LT_ERROR_PO STRUCTURE  ZPO_ERROR_60
    *data it_head type standard table of bapimepoheader.
      DATA ls_head TYPE bapimepoheader.
      DATA it_headx TYPE STANDARD TABLE OF bapimepoheaderx.
      DATA ls_headx TYPE bapimepoheaderx.
      DATA it_item TYPE STANDARD TABLE OF bapimepoitem.
      DATA ls_item TYPE bapimepoitem.
      DATA it_itemx TYPE STANDARD TABLE OF bapimepoitemx.
      DATA ls_itemx TYPE bapimepoitemx.
      DATA it_sch TYPE STANDARD TABLE OF bapimeposchedule  .
      DATA ls_sch TYPE bapimeposchedule.
      DATA it_schx TYPE STANDARD TABLE OF bapimeposchedulx.
      DATA ls_schx TYPE bapimeposchedulx.
      DATA it_poact TYPE STANDARD TABLE OF bapimepoaccount.
      DATA ls_poact TYPE bapimepoaccount.
      DATA it_poactx TYPE STANDARD TABLE OF bapimepoaccountx.
      DATA ls_poactx TYPE bapimepoaccountx.
      DATA it_cond TYPE STANDARD TABLE OF bapimepocond.
      DATA ls_cond TYPE bapimepocond.
      DATA it_adrc TYPE STANDARD TABLE OF bapimepoaddrdelivery.
      DATA st_adrc TYPE bapimepoaddrdelivery.
      DATA it_condx TYPE STANDARD TABLE OF bapimepocondx.
      DATA ls_condx TYPE bapimepocondx.
      DATA it_popart TYPE STANDARD TABLE OF bapiekkop.
      DATA ls_popart TYPE bapiekkop.
      data : ret2 type bapiret2 occurs 0 with header line.
      DATA ls_ekko TYPE zpo_data_60.
      DATA st_ekko TYPE zpo_data_60.
      DATA ls_ekpo TYPE zpo_item_60.
      DATA st_ekpo TYPE zpo_item_60.
      DATA:     ls_adrc TYPE zpo_adrc_60,
              ls_ekkn TYPE zpo_ekkn_60,
             ls_eket TYPE zpo_eket_60,
              ls_ekbe TYPE zpo_ekbe_60,
              w_purchaseorder type BAPIMEPOHEADER-PO_NUMBER.
      LOOP AT lt_ekpo INTO st_ekpo.
        ls_ekpo = st_ekpo.
        AT NEW ebeln.
          READ TABLE lt_ekko WITH KEY ebeln = ls_ekpo-ebeln.
          IF sy-subrc = 0.
            ls_head-comp_code = lt_ekko-bukrs.
            ls_head-doc_type = lt_ekko-bsart.
            ls_head-vendor = lt_ekko-lifnr.
            ls_head-purch_org = lt_ekko-ekorg.
            ls_head-pur_group = lt_ekko-ekgrp.
            ls_head-pmnttrms = lt_ekko-zterm.
            ls_head-exch_rate = lt_ekko-wkurs.
           ls_head-incoterms1 = lt_ekko-inco1.
           ls_head-incoterms2 = lt_ekko-inco2.
            ls_head-currency = lt_ekko-waers.
            ls_head-PO_NUMBER = lt_ekko-ebeln.
    *append ls_head to it_head.
    *Parameter: POHEADERX
            ls_headx-comp_code = 'X' .
            ls_headx-doc_type = 'X' .
            ls_headx-vendor = 'X' .
            ls_headx-purch_org = 'X'.
            ls_headx-pur_group = 'X' .
            ls_headx-pmnttrms = 'X'.
            ls_headx-currency = 'X'.
            ls_headx-exch_rate = 'X'.
           ls_headx-incoterms1 = 'X'.
           ls_headx-incoterms2 = 'X'.
            ls_headx-currency = 'X'.
            ls_headx-PO_NUMBER = 'X'.
    *append ls_headx to it_headx.
          ENDIF.
        ENDAT.
        ls_item-po_unit = ls_ekpo-meins.
        ls_item-po_item  = ls_ekpo-ebelp.
        ls_item-material = ls_ekpo-matnr.
        ls_item-price_unit = ls_ekpo-peinh.
        ls_item-orderpr_un = ls_ekpo-bprme.
        ls_item-net_price = ls_ekpo-netpr.
        ls_item-matl_group = ls_ekpo-matkl.
       ls_item-short_text = ls_ekpo-txz01.
        ls_item-plant = ls_ekpo-werks.
        ls_item-stge_loc = ls_ekpo-lgort.
        ls_item-quantity = ls_ekpo-menge.
        ls_item-acctasscat = ls_ekpo-knttp.
        ls_item-gr_basediv  = ls_ekpo-webre.
        ls_item-vend_mat  = ls_ekpo-idnlf.
        ls_item-no_more_gr = ls_ekpo-elikz.
        ls_item-final_inv  = ls_ekpo-erekz.
        ls_item-gr_ind   = ls_ekpo-wepos.
        ls_item-gr_non_val = ls_ekpo-weunb.
        ls_item-conv_num1   = ls_ekpo-bpumz.
        ls_item-conv_den1   = ls_ekpo-bpumn.
        ls_item-ir_ind      = ls_ekpo-repos.
        ls_item-unlimited_dlv = ls_ekpo-uebtk.
        ls_item-reminder1 = ls_ekpo-mahn1.
        ls_item-reminder2  = ls_ekpo-mahn2.
        ls_item-reminder3   = ls_ekpo-mahn3.
        ls_item-vend_mat  = ls_ekpo-idnlf.
        ls_item-no_more_gr = ls_ekpo-elikz.
        ls_item-final_inv = ls_ekpo-erekz.
        ls_item-gr_ind  = ls_ekpo-wepos.
    *Parameter: POITEMX
        ls_itemx-po_unit = 'X'.
        ls_itemx-po_item  = ls_ekpo-ebelp.
        ls_itemx-material = 'X'.
        ls_itemx-price_unit = 'X'.
        ls_itemx-orderpr_un = 'X'.
        ls_itemx-net_price = 'X'.
        ls_itemx-matl_group = 'X'.
       ls_itemx-short_text = 'X'.
        ls_itemx-plant = 'X'.
        ls_itemx-stge_loc = 'X'.
        ls_itemx-quantity = 'X'.
        ls_itemx-acctasscat = 'X'.
        ls_itemx-gr_basediv  = 'X'.
        ls_itemx-vend_mat  = 'X'.
        ls_itemx-no_more_gr = 'X'.
        ls_itemx-final_inv  = 'X'.
        ls_itemx-gr_ind   = 'X'.
        ls_itemx-gr_non_val = 'X'.
        ls_itemx-conv_num1   = 'X'.
        ls_itemx-conv_den1   = 'X'.
        ls_itemx-ir_ind      = 'X'.
        ls_itemx-unlimited_dlv = 'X'.
        ls_itemx-reminder1 = 'X'.
        ls_itemx-reminder2  = 'X'.
        ls_itemx-reminder3   = 'X'.
        ls_itemx-vend_mat  = 'X'.
        ls_itemx-no_more_gr = 'X'.
        ls_itemx-final_inv = 'X'.
        ls_itemx-gr_ind  = 'X'.
        APPEND ls_itemx TO it_itemx.
        APPEND ls_item TO it_item.
        READ TABLE lt_eket INTO ls_eket WITH KEY ebeln = ls_ekpo-ebeln
                                                 ebelp = ls_ekpo-ebelp.
        IF sy-subrc = 0.
    *Parameter: POSCHEDULE
          ls_sch-po_item = ls_ekpo-ebelp.
          ls_sch-sched_line = LS_EKET-ETENR.
          ls_sch-delivery_date = ls_eket-eindt.
          ls_sch-quantity = ls_ekpo-menge .
          APPEND ls_sch TO it_sch.
        ENDIF.
    *Parameter: POSCHEDULEX
        ls_schx-po_item = ls_ekpo-ebelp.
        ls_schx-sched_line = LS_EKET-ETENR.
        ls_schx-po_itemx = 'X' .
        ls_schx-sched_linex = 'X'.
        ls_schx-delivery_date = 'X'.
        ls_schx-quantity = 'X' .
        APPEND ls_schx TO it_schx.
    read table lt_ekkn into ls_ekkn with key ebeln = ls_ekpo-ebeln
                                             ebelp = ls_ekpo-ebelp.
    *Parameter: POACCOUNT
        ls_poact-po_item = ls_ekpo-ebelp.
        ls_poact-serial_no = sy-tabix.
        ls_poact-quantity = ls_ekpo-menge.
        ls_poact-gl_account = ls_ekkn-sakto.
       '0000400000'.
        ls_poact-costcenter = ls_ekkn-KOSTL.
       ls_poact-co_area = '1000'.
        ls_poact-tax_code = ls_ekkn-mwskz.
        APPEND ls_poact TO it_poact.
    *Parameter: POACCOUNTX
        ls_poactx-po_item = ls_ekpo-ebelp.
        ls_poactx-serial_no = sy-tabix .
        ls_poactx-quantity = ls_ekpo-menge.
        ls_poactx-gl_account = ls_ekkn-sakto.
        ls_poactx-costcenter = ls_ekkn-KOSTL.
       ls_poactx-co_area = 'X' .
        ls_poactx-tax_code = ls_ekkn-mwskz.
       'X'.
        APPEND ls_poactx TO it_poactx.
    *Parameter: POCOND
        ls_cond-itm_number = ls_ekpo-ebelp.
        ls_cond-cond_st_no = '001' .
        ls_cond-cond_type = 'PB00' .
        ls_cond-cond_value = '79.900000000' .
        ls_cond-currency = ls_ekko-waers.
        ls_cond-currency_iso = 'USD'.
        ls_cond-cond_unit = 'KG' .
        ls_cond-cond_p_unt = '1' .
        ls_cond-change_id = 'U' .
        APPEND ls_cond TO it_cond.
    *Parameter: POCONDX
        ls_condx-itm_number = ls_ekpo-ebelp.
        ls_condx-cond_st_no = '000' .
        ls_condx-itm_numberx = 'X' .
        ls_condx-cond_type = 'X' .
        ls_condx-cond_value = 'X' .
        ls_condx-currency = 'X' .
        ls_condx-change_id = 'X' .
        APPEND ls_condx TO it_condx.
    *Parameter: POPARTNER,
       ls_popart-partnerdesc = 'OA' .
       ls_popart-langu = 'EN' .
       ls_popart-buspartno = '0000001100' .
       ls_popart-partnerdesc = 'GS' .
       ls_popart-langu = 'EN' .
       ls_popart-buspartno = '0000001200' .
       ls_popart-partnerdesc = 'IP' .
       ls_popart-langu = 'EN' .
       ls_popart-buspartno = '0000001000'.
       APPEND ls_popart TO it_popart.
    Address data
        READ TABLE lt_adrc  INTO ls_adrc WITH KEY addrnumber = ls_ekko-adrnr.
        IF sy-subrc = 0.
          st_adrc-addr_no = ls_adrc-addrnumber.
          st_adrc-name = ls_adrc-name1.
          st_adrc-street = ls_adrc-street.
          st_adrc-district = ls_adrc-city2.
          st_adrc-postl_cod1 = ls_adrc-post_code1.
          st_adrc-city = ls_adrc-city1.
          st_adrc-country = ls_adrc-country.
          st_adrc-region = ls_adrc-region.
          APPEND st_adrc TO it_adrc.
        ENDIF.
        AT END OF ebeln.
          CALL FUNCTION 'BAPI_PO_CREATE1'
            EXPORTING
             poheader                     =  ls_head
             poheaderx                    = ls_headx
      POADDRVENDOR                 =
      TESTRUN                      =
      MEMORY_UNCOMPLETE            =
      MEMORY_COMPLETE              =
      POEXPIMPHEADER               =
      POEXPIMPHEADERX              =
      VERSIONS                     =
      NO_MESSAGING                 =
      NO_MESSAGE_REQ               =
      NO_AUTHORITY                 =
      NO_PRICE_FROM_PO             =
    IMPORTING
       EXPPURCHASEORDER              = w_purchaseorder
      EXPHEADER                    =
      EXPPOEXPIMPHEADER            =
           TABLES
             return                       = ret2
             poitem                       = it_item
             poitemx                      = it_itemx
             poaddrdelivery               = it_adrc
             poschedule                   = it_sch
             poschedulex                  = it_schx
             poaccount                    = it_poact
      POACCOUNTPROFITSEGMENT       =
             poaccountx                   = it_poactx
      POCONDHEADER                 =
      POCONDHEADERX                =
             pocond                       = it_cond
             pocondx                      = it_condx
      POLIMITS                     =
      POCONTRACTLIMITS             =
      POSERVICES                   =
      POSRVACCESSVALUES            =
      POSERVICESTEXT               =
      EXTENSIONIN                  =
      EXTENSIONOUT                 =
      POEXPIMPITEM                 =
      POEXPIMPITEMX                =
      POTEXTHEADER                 =
      POTEXTITEM                   =
      ALLVERSIONS                  =
            popartner                    = it_popart
      POCOMPONENTS                 =
      POCOMPONENTSX                =
      POSHIPPING                   =
      POSHIPPINGX                  =
      POSHIPPINGEXP                =
    if w_purchaseorder is not initial.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           LOOP AT ret2 WHERE type = 'S'.
                lt_success_po-ebeln =   ret2-message_v2.
                lt_success_po-type = ret2-type.
                lt_success_po-message = ret2-message.
                append lt_success_po.
                clear : lt_success_po.
              ENDLOOP.
    else.
    loop at ret2 where type = 'E'.
    move-corresponding lt_ekko to lt_error_po.
    move-corresponding ls_ekpo to lt_error_po.
    move ret2-type to lt_error_po-type.
    move ret2-message to lt_error_po-message.
    append lt_error_po.
    clear : lt_error_po.
    endloop.
      endif.
      CLEAR : ls_ekko,
                  st_ekko,
                  ls_ekpo,
                  st_ekpo,
                  ls_ekkn,
                  ls_ekbe,
                  ls_eket.
        ENDAT.
      ENDLOOP.
    ENDFUNCTION.
    Thanks
    Ruban

    hi,
    I could able to get successful PO creation no.
    but problem is with  tax code(MWskz) not updated for that tax code in EKKN table for that successfully created PO.
    Even though the value is passing into the standard BAPI bapi_PO_create1.
    Thanks
    Ruban

  • Error while creating BOM using BAPI (urgent)

    Hi all,
    Thanks for ur help. i am getting some error while creting a BOM using that BAPI
    BAPI_MATERIAL_BOM_GROUP_CREATE.
    errors are
    1) Error/warning when checking the structure of the BOM group with ID =
    2)Alternative does not exist for material assignment to material BAPIBOMFG1
    is it mandatory to pass the bom group id to this bapi?
    In bomgroup structure , i am not passing anything to BOM_GROUP field.
    is it mandatory to pass this data? i am giving my coding below.plz suggest , where i am making mistake. it is urgent.
    regards
    pabitra
    report z_bom_create
    line-size 132
    line-count 65
    no standard page heading.
    *-- DATA DECLARATION--
    include <icon> .
    *---Tables
    tables : s076, t100, marc .
    *---Types
    types : begin of t_upload, " Upload file data
    col1(18),
    col2(10),
    col3(30),
    col4(12),
    col5(50),
    end of t_upload,
    begin of t_split,
    location like stpu-ebort,
    end of t_split.
    data:begin of i_return occurs 10.
    include structure bapiret2.
    data:end of i_return.
    types:begin of t_item."occurs 10.
    include structure BAPI1080_ITM_C.
    types:end of t_item.
    types:begin of t_subitem." occurs 10.
    include structure BAPI1080_SUI_C.
    types:end of t_subitem.
    types:begin of t_header." occurs 10.
    include structure BAPI1080_MBM_C.
    types:end of t_header.
    types:begin of t_bomgroup." occurs 10.
    include structure BAPI1080_BGR_C.
    types:end of t_bomgroup.
    types:begin of t_variant." occurs 10.
    include structure BAPI1080_BOM_C.
    types:end of t_variant.
    *--- Tables
    data: i_upload type standard table of t_upload, " to hold data
    i_upload1 type standard table of t_upload,
    i_split type standard table of t_split,
    i_item type standard table of t_item,
    i_subitem type standard table of t_subitem,
    i_header type standard table of t_header,
    i_bomgroup type standard table of t_bomgroup,
    i_variant type standard table of t_variant.
    data: wa_upload type t_upload, " to hold file data,
    wa_upload1 type t_upload, " to hold plan data,
    wa_split type t_split,
    wa_item type t_item,
    wa_subitem type t_subitem,
    wa_header type t_header,
    wa_bomgroup type t_bomgroup,
    wa_variant type t_variant.
    data:v_matnr like mara-matnr,
    v_start like sy-index,
    v_count(3) type c.
    *--Constants
    data: c_dot type c value '.',
    c_x type c value 'X',
    c_comma type c value ','.
    -------Selection Screen Design -
    *Selection screen for input of upload file address
    selection-screen skip 2.
    selection-screen begin of block blk1 with frame.
    parameters : p_file like rlgrap-filename obligatory .
    parameters : p_matnr like mara-matnr obligatory,
    p_werks like marc-werks obligatory memory id wrk,
    p_stlan like afko-stlan obligatory default '1' .
    selection-screen end of block blk1.
    ---AT SELECTION SCREEN -
    at selection-screen on value-request for p_file.
    *--For popup to select file.
    perform f_give_help.
    at selection-screen on p_matnr.
    perform f_check_matnr.
    -----START OF SELECTION -
    *--Data upload using WS_Upload.
    perform f_get_data.
    perform f_get_bom_data.
    perform f_get_bom_data1.
    perform f_call_bapi.
    *& Form f_give_help
    text
    --> p1 text
    <-- p2 text
    FORM f_give_help.
    call function 'WS_FILENAME_GET'
    exporting
    mask = ',.,..'
    mode = 'O'
    importing
    filename = p_file
    exceptions
    inv_winsys = 1
    no_batch = 2
    selection_cancel = 3
    selection_error = 4
    others = 5.
    if sy-subrc <> 0 and not sy-msgty is initial.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    ENDFORM. " f_give_help
    *& Form f_check_matnr
    text
    --> p1 text
    <-- p2 text
    FORM f_check_matnr.
    CALL FUNCTION 'BAPI_MAT_BOM_EXISTENCE_CHECK'
    EXPORTING
    MATERIAL = p_matnr
    PLANT = p_werks
    BOMUSAGE = '1'
    VALID_FROM_DATE =
    VALID_TO_DATE =
    TABLES
    RETURN = i_return.
    ENDFORM. " f_check_matnr
    *& Form f_get_data
    text
    --> p1 text
    <-- p2 text
    FORM f_get_data.
    call function 'WS_UPLOAD'
    exporting
    CODEPAGE = ' '
    filename = p_file
    filetype = 'DAT'
    tables
    data_tab = i_upload
    exceptions
    conversion_error = 1
    file_open_error = 2
    file_read_error = 3
    invalid_type = 4
    no_batch = 5
    unknown_error = 6
    invalid_table_width = 7
    gui_refuse_filetransfer = 8
    customer_error = 9
    others = 10
    if sy-subrc <> 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    endif.
    ENDFORM. " f_get_data
    *& Form f_get_bom_data
    text
    --> p1 text
    <-- p2 text
    FORM f_get_bom_data.
    delete i_upload where col1 is initial.
    delete i_upload where col1 cs 'ITEM'.
    read table i_upload into wa_upload with key col1 = 'FINISHED GOOD:'.
    if sy-subrc = 0.
    v_matnr = wa_upload-col2.
    if v_matnr <> p_matnr.
    message e001(zl) with p_matnr.
    endif.
    else.
    message e000(zl).
    endif.
    ENDFORM. " f_get_bom_data
    *& Form f_get_bom_data1
    text
    --> p1 text
    <-- p2 text
    FORM f_get_bom_data1.
    loop at i_upload into wa_upload where col1 CS 'FINISHED GOOD'.
    v_start = sy-tabix + 1.
    loop at i_upload into wa_upload1 from v_start .
    if wa_upload1-col1 cs 'FINISHED GOOD'.
    exit.
    else.
    perform f_split_upload_data.
    endif.
    endloop.
    endloop.
    ENDFORM. " f_get_bom_data1
    *& Form f_split_upload_data
    text
    --> p1 text
    <-- p2 text
    FORM f_split_upload_data.
    if not wa_upload1-col5 is initial.
    if wa_upload1-col5 cs c_comma.
    split wa_upload1-col5 at c_comma into table i_split.
    loop at i_split into wa_split.
    v_count = v_count + 1.
    endloop.
    if wa_upload1-col4 <> v_count.
    wa_upload1-col4 = v_count.
    endif.
    clear wa_upload1-col5.
    clear wa_split.
    loop at i_split into wa_split.
    wa_upload1-col5 = wa_split-location.
    append wa_upload1 to i_upload1.
    endloop.
    else.
    append wa_upload1 to i_upload1.
    endif.
    else.
    append wa_upload1 to i_upload1.
    endif.
    ENDFORM. " f_split_upload_data
    *& Form f_call_bapi
    text
    --> p1 text
    <-- p2 text
    FORM f_call_bapi.
    clear wa_upload1.
    wa_header-material = p_matnr.
    wa_header-plant = p_werks.
    wa_header-bom_usage = p_stlan.
    append wa_header to i_header.
    wa_bomgroup-bom_usage = p_stlan.
    wa_bomgroup-created_in_plant = p_werks.
    append wa_bomgroup to i_bomgroup.
    wa_variant-alternative_bom = 1.
    wa_variant-base_qty = 1.
    wa_variant-valid_from_date = sy-datum.
    append wa_variant to i_variant.
    loop at i_upload1 into wa_upload1.
    wa_item-item_no = wa_upload1-col1.
    wa_item-item_cat = wa_upload1-col2.
    wa_item-component = wa_upload1-col3.
    wa_item-comp_qty = wa_upload1-col4.
    append wa_item to i_item.
    wa_subitem-subitem_qty = '1'.
    wa_subitem-installation_point = wa_upload1-col5.
    append wa_subitem to i_subitem.
    endloop.
    CALL FUNCTION 'BAPI_MATERIAL_BOM_GROUP_CREATE'
    EXPORTING
    TESTRUN = ' '
    ALL_ERROR = ' '
    TABLES
    BOMGROUP = i_bomgroup
    VARIANTS = i_variant
    ITEMS = i_item
    SUBITEMS = i_subitem
    MATERIALRELATIONS = i_header
    ITEMASSIGNMENTS =
    SUBITEMASSIGNMENTS =
    TEXTS =
    RETURN = i_return.
    if i_return[] is initial.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    *write: /'BOM created:', stpo-stlnr.
    else.
    *if not i_return[] is initial.
    loop at i_return.
    IF i_return-TYPE = 'E'.
    errmsg-type = i_return-type.
    errmsg-line = i_return-message.
    append errmsg.
    ULINE /1(108).
    write:/ icon_led_RED as icon, i_return-MESSAGE.
    ULINE /1(108).
    ENDIF.
    IF i_return-TYPE = 'W'.
    errmsg-type = i_return-type.
    errmsg-line = i_return-message.
    append errmsg.
    ULINE /1(108).
    write:/ icon_led_YELLOW as icon, i_return-MESSAGE.
    ULINE /1(108).
    ENDIF.
    ENDLOOP.
    *write: / i_return-id, i_return-number, i_return-message(80).
    *endloop.
    *write: /'Error'.
    endif.
    ENDFORM. " f_call_bapi

    Hi shashi,
    Thanks for ur help.i tried after passing the group but it is giving same error.
    i am getting the error
    "Error/warning when checking the structure of the BOM group with ID= test"
    i am gettig the above error when i put bomgroup-bom_group_identification = 'TEST'.
    whatever i am putting in this field, the same error is comming having different value.
    if i put--- bomgroup-bom_group_identification = ' '. then i will get error
    "Error/warning when checking the structure of the BOM group with ID=
    if i omit that field, then also , i am getting same error.
    plz suggest what r the fields i need to pass for BOMGROUP structure for that bapi?
    regards
    pabitra

  • Error while creating GR using BAPI

    *I am creating material document using BAPI_GOODSMVT_CREATE .
    When I create the Material document using this BAPI I am able to create is successfully when there is no Account assignment category used means it blank at scheduling agreement level.
    But if the Account assignment category is given at the scheduling agreement level then BAPI fails and shows the error message u201CNo goods receipt possible for purchase order.
    I am using SAP version 4.6C
        SPLIT w_file-dln AT '.' INTO w_dd w_mm w_yyyy.
        CONCATENATE w_yyyy w_mm w_dd INTO w_dt.
        w_gm_hdr-pstng_date = w_dt.    " Posting Date
        w_gm_hdr-doc_date   = sy-datum." Doc Date
        w_gm_hdr-pr_uname   = sy-uname." User Name
        w_gm_cd-gm_code     = '01'.    "01 Goods Receipts for Purchase Order
        w_gm_itm-move_type  = '101'.
        w_gm_itm-mvt_ind    = 'B'.
      BAPI Call.
    Edited by: Nandkumar Ghodke on May 21, 2010 4:15 PM
    Edited by: Nandkumar Ghodke on May 21, 2010 4:16 PM

    As per i know..
    that the account assignment information applies to the item level and not to the schedule line level. This means that the quantities, values, and percentage rates indicate how the account assignment information of an item is assigned. This also applies to service items and purchase orders with invoicing plan
    Thanks
    Naresh

  • Net price must be greater than 0 error while creating PO using BAPI

    Hi guys!
    I'm using BAPI_PO_CREATE1 to create several PO's from a Z table record. I finally achieved that my BAPI to work as wished, with conditions, etc.
    The problem im having is that  i get the error of net price must be > 0.
    I do not have any condition type defined . Is it necessary to define one?
    Plz any help will be very appreciated.
    Thx.

    It will be configuration problem,create one PO manually and see the results
    and create same data for Po using  Function module and see the results
    most of the time net price should be more than 0,keep net price should be more than zero
    see the simple program ,what i created :
    *& Report  ZBAPI
    REPORT  ZBAPI.
    DATA: BEGIN OF i_data OCCURS 0,
            text(255),
          END OF i_data.
    DATA: i_ekko TYPE bapiekkoc.
    DATA: it_ekko LIKE TABLE OF i_ekko INITIAL SIZE 0  WITH HEADER LINE.
    DATA: BEGIN OF i_ekpo OCCURS 0,
            po_item(5),
            pur_mat(18),
            plant(4),
            net_price(23),
            disp_quan(13),
         END OF i_ekpo.
    DATA: it_ekpo LIKE TABLE OF bapiekpoc INITIAL SIZE 0 WITH HEADER LINE .
    DATA: BEGIN OF i_eket OCCURS 0,
             po_item(5),
             deliv_date(8),
             quantity(13),
          END OF i_eket.
    DATA: it_eket LIKE TABLE OF bapieket INITIAL SIZE 0 WITH HEADER LINE.
    DATA: v_index TYPE i.
    DATA: return TYPE TABLE OF bapireturn INITIAL SIZE 0 WITH HEADER LINE.
    DATA: po_num(10).
    START-OF-SELECTION.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
      CODEPAGE                      = ' '
      FILENAME                      = ' '
      FILETYPE                      = ' '
      ITEM                          = ' '
      FILEMASK_MASK                 = ' '
      FILEMASK_TEXT                 = ' '
      FILETYPE_NO_CHANGE            = ' '
      FILEMASK_ALL                  = ' '
      FILETYPE_NO_SHOW              = ' '
      LINE_EXIT                     = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      SILENT                        = 'S'
    IMPORTING
      FILESIZE                      =
      CANCEL                        =
      ACT_FILENAME                  =
      ACT_FILETYPE                  =
      TABLES
        data_tab                      = i_data
    EXCEPTIONS
      CONVERSION_ERROR              = 1
      INVALID_TABLE_WIDTH           = 2
      INVALID_TYPE                  = 3
      NO_BATCH                      = 4
      UNKNOWN_ERROR                 = 5
      GUI_REFUSE_FILETRANSFER       = 6
      OTHERS                        = 7
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    loop at i_data.
    if i_data-text(1) = 'H'.
       shift i_data-text.
       v_index = v_index + 1.
       split i_data-text at ',' into i_ekko-doc_type
                                    i_ekko-purch_org
                                    i_ekko-pur_group
                                    i_ekko-vendor.
      append i_ekko to it_ekko.
    elseif i_data-text(1) = 'I'.
    shift i_data-text.
    split i_data-text at ',' into i_ekpo-po_item
                                   i_ekpo-pur_mat
                                   i_ekpo-plant
                                   i_ekpo-net_price
                                   i_ekpo-disp_quan.
    append i_ekpo.
    move-corresponding i_ekpo to it_ekpo.
    append it_ekpo.
    clear it_ekpo.
    else.
    shift i_data-text.
    split i_data-text at ',' into i_eket-po_item
                                   i_eket-deliv_date
                                   i_eket-quantity.
    append it_eket .
    move-corresponding i_eket to it_eket.
    append it_eket.
    clear it_eket.
    endif.
    endloop.
    CALL FUNCTION 'BAPI_PO_CREATE'
      EXPORTING
        po_header                        = i_ekko
      PO_HEADER_ADD_DATA               =
      HEADER_ADD_DATA_RELEVANT         =
      PO_ADDRESS                       =
      SKIP_ITEMS_WITH_ERROR            = 'X'
      ITEM_ADD_DATA_RELEVANT           =
      HEADER_TECH_FIELDS               =
    IMPORTING
      PURCHASEORDER                    =
      tables
        po_items                         = it_ekpo
      PO_ITEM_ADD_DATA                 =
        po_item_schedules                = it_eket
      PO_ITEM_ACCOUNT_ASSIGNMENT       =
      PO_ITEM_TEXT                     =
       RETURN                           = return
      PO_LIMITS                        =
      PO_CONTRACT_LIMITS               =
      PO_SERVICES                      =
      PO_SRV_ACCASS_VALUES             =
      PO_SERVICES_TEXT                 =
      PO_BUSINESS_PARTNER              =
      EXTENSIONIN                      =
      POADDRDELIVERY                   =
    write: po_num.
    use BAPi_TRANSACTION_COMITT FM always
      loop at return.
      write:/ return-message,return-type.
      endloop.
    Thanks
    Seshu
    Message was edited by:
            Seshu Maramreddy
    Message was edited by:
            Seshu Maramreddy

  • Error while creating Salesorder using BAPI

    hello frnds,
    I m new to abap and tryin to make use of BAPI_SALESORDER_CREATEFROMDAT1 to create Sales Order
    I have used the progrtam below.
    *& Report  ZSALESBAPITRIAL
    REPORT  zsalesbapitrial.
    TABLES : vbak , vbap.
    Parameter Screen.
    Sales Document Type.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    Sales document type.
    PARAMETERS: p_auart TYPE vbak-auart OBLIGATORY.
    Sales Organisation.
    PARAMETERS: p_vkorg TYPE vbak-vkorg OBLIGATORY.
    Distribution channel.
    PARAMETERS: p_vtweg TYPE vbak-vtweg OBLIGATORY.
    Division.
    PARAMETERS: p_spart TYPE vbak-spart OBLIGATORY.
    SKIP 1.
    Sold to.
    PARAMETERS: p_sold TYPE vbak-kunnr OBLIGATORY.
    Ship to.
    PARAMETERS: p_ship TYPE vbak-kunnr OBLIGATORY.
    SKIP 1.
    Material(Article No).
    PARAMETERS: p_matnr TYPE vbap-matnr   OBLIGATORY.
    Quantity (Cummulative quantity of sales Order)
    PARAMETERS: p_menge type vbap-kwmeng obligatory.
    Plant(Site )
    parameters: p_plant type vbap-werks obligatory.
    SELECTION-SCREEN END OF BLOCK b1.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
    EXPORTING
    sales_header_in = header
    sales_header_inx = headerx
    IMPORTING
    salesdocument_ex = v_vbeln
    TABLES
    return = return
    sales_items_in = item
    sales_items_inx = itemx
    sales_schedules_in = lt_schedules_in
    sales_schedules_inx = lt_schedules_inx
    sales_partners = partner.
    Check the return table.
    LOOP AT return WHERE type = 'E' OR type = 'A'.
    EXIT.
    ENDLOOP.
    IF sy-subrc = 0.
    WRITE: / 'Error in creating document'.
    ELSE.
    WRITE: / 'Document ', v_vbeln, ' created'.
    ENDIF.
    but its giving 'Error in creating document' I m unable to figure wat i m missing . Is it tht i m gving wrong parameters.
    Please help !!!

    Does tht mean i need to add the following code
    Line item number.
    item-itm_number = '000010'.
    itemx-itm_number = 'X'.
    Material
    item-material = p_matnr.
    itemx-material = 'X'.
    Plant
    item-plant    = p_plant.
    itemx-plant   = 'X'.
    Quantity
    item-target_qty = p_menge.
    itemx-target_qty = 'X'.
    APPEND item.
    APPEND itemx.
    For second item.
    Line item number.
    item-itm_number = '000020'.
    itemx-itm_number = 'X'.
    Material
    item-material = '600020001'.
    itemx-material = 'X'.
    Plant
    item-plant    = p_plant.
    itemx-plant   = 'X'.
    Quantity
    item-target_qty = p_menge.
    itemx-target_qty = 'X'.
    APPEND item.
    APPEND itemx.
      Fill schedule lines
    lt_schedules_in-itm_number = '000010'.
    lt_schedules_in-sched_line = '0001'.
    lt_schedules_in-req_qty    = p_menge.
    APPEND lt_schedules_in.
      Fill schedule lines
    lt_schedules_in-itm_number = '000020'.
    lt_schedules_in-sched_line = '0002'.
    lt_schedules_in-req_qty    = p_menge.
    APPEND lt_schedules_in.
      Fill schedule line flags
    lt_schedules_inx-itm_number  = '000010'.
    lt_schedules_inx-sched_line  = '0001'.
    lt_schedules_inx-updateflag  = 'X'.
    lt_schedules_inx-req_qty     = 'X'.
    APPEND lt_schedules_inx.
      Fill schedule line flags
    lt_schedules_inx-itm_number  = '000020'.
    lt_schedules_inx-sched_line  = '0002'.
    lt_schedules_inx-updateflag  = 'X'.
    lt_schedules_inx-req_qty     = 'X'.
    APPEND lt_schedules_inx.
    But i guess it is overwritting my frst material..
    Also i m gettin a error 
    For object rv_beleg, number  range interval doesnot exist
    Pls suggest

  • Error while creating SO using BAPI

    Hello frnds,
    I m new to abap and trying to create sales orser

    Dear Rachana More,
    Maintain the number range interval for object rv_beleg.
    In IMG under
    Sales and Distribution -> Sales -> Sales Documents -> Sales Document Header -> Define Number Ranges for Sales Documents -> enter
    Or from Transaction SNRO -> enter number range object rv_beleg -> Choose Number Range pushbutton from application tool bar -> Click on change intervals pushbutton -> Maintain intervals
    Regards,
    Naveen.

  • Update Termination Error while creating Delivery

    Hello Experts,
    I am trying to create delivery with reference to Standard Order when I click on SAVE I am getting message that delivery is being created. But when I am trying to open the same delivery in change mode I am getting Update termination Error saying delivery not created.
    So what I tried doing is while creating delivery I have given Picked quantity and done with PGI then i am able to save the Delivery successfully and table LIKP is also updated. But this is not always that I can do. In my production system, without doing PGI I should able to save Delivery.
    Please could anybody help me on this ..is there any SAP notes?
    PS: My system is upgraded from ECC 6.0  Ehp2 to ECC 6.0 Ehp7.
    Many Thanks in advance.
    Priyanka J.

    Hello Kiran, Hello Klaus,
    Below are the details;
    Function Module   
    RV_DELIVERIES_SAVE
    Status            
    Update was terminated
    Report            
    LV50UF0L
    Row               
    50
    Error details   Class:
    00    
    Number:
    671
    Internal session terminated with a runtime error POSTING_ILLEGAL_STATE
    MENT (see ST22)

Maybe you are looking for

  • I cannot get new purchases to sync with IPad - it says my computer isn't authorized - it is How do I fix this?

    I cannot get my new TV show purchases to sync to my IPad.  It says "you are not authorized on this computer"  It is authorized.  How can I fix this????

  • Version incompatibility

    Dear all, I have a valid backup of 10.2.0.4.0 database taken using RMAN (veritas netbackup )..I tried restoring this version database in 10.2.0.3.0 database.. it failed with the error version incompatible.. anyway can I restore 10.2.0.4. databsae in

  • Attaching JPG files

    I've searched but I am not finding the answer. How do I send an attached JPG or other pic file without the image itself being embedded or visible in the body of the email? This should be easy, but I am embarrased to say I cannot find out how to do th

  • Checking the number Activations allowed and remaining on registered Adobe products

    Where in Adobe do I go to verify remaining product activations. I have installed 2 registered Adobe programs but have download the final install for these versions. I have the links for download and I have valid keys. I have deactivated one product b

  • Win7, BC 3.0.1 problems

    When I try to install after partitioning I get a black screen that has a 1. and a 2. below it and below that a line that says, "Select CD-ROM Boot Type:_ The cursor is flashing but the keyboard is non-functional as is the wireless mouse. BC partition