BAPI_SALESORDER_CHANGE insert sales order item lines ERRORS

Hello experts,
i have to insert new item lines for a given sales order document number.
i use bapi_salesorder_change but it does not work.
these are the messages in the return table:
Error 1.
Message: ORDER_HEADER_IN has been processed succesfully
Message: No item category available
Message: Error in ITEM_IN
Message: Condition cc_cond is not allowed as header condition
Message: Sales document was not changed
Error 2.
Message: ORDER_HEADER_IN has been processed succesfully
Message:Material is not defined for sales org., distribution chan, language DE {but i checked the table mvke with the matnr and sales org and distribution chanel and the material exists}
Message: Error in ITEM_IN
Message: Condition cc_cond is not allowed as header condition
Message: Sales document was not changed
here is the code:
  i_t_item-itm_number    = p_posnr.
  i_t_item-material      = p_matnr.
  i_t_item-target_qty    = p_qty.
  i_t_item-plant         = p_plant.
  i_t_item-hg_lv_item = p_uepos.
  i_t_item-price_date   = p_preisdat.
   i_t_item-prc_group2   = cc_prc_group.
  APPEND i_t_item.
*setting conditions
  i_t_bapicond-itm_number  = p_posnr.
  i_t_bapicond-cond_type   = cc_condition_type.
  i_t_bapicond-cond_value  = l_netwr.
  i_t_bapicond-conpricdat  = gc_datum.
  i_t_bapicond-currency    = cc_eur.
  APPEND i_t_bapicond.
  i_t_itemx-updateflag = cc_i. {= 'I'}
  i_t_itemx-itm_number = p_posnr.
  i_t_itemx-material      = cc_x.
  i_t_itemx-target_qty    = cc_x.
  i_t_itemx-plant         = cc_x.
  i_t_itemx-hg_lv_item    = cc_x.
  i_t_itemx-price_date    = cc_x.
  i_t_itemx-prc_group2    = cc_x.
  APPEND i_t_itemx.
  i_t_bapicondx-updateflag = cc_i.{'I'}
  i_t_bapicondx-itm_number = p_posnr.
  i_t_bapicondx-cond_type = cc_x.
  i_t_bapicondx-cond_value = cc_x.
i_t_bapicondx-conpricdat = cc_x.
  i_t_bapicondx-currency = cc_x.
  append i_t_bapicondx.
  CLEAR: l_behave, sy-subrc.
  CLEAR i_t_header.
  i_t_header-updateflag = cc_u. {='U'}
  APPEND i_t_header.
  CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
       salesdocument               = sales_ord_number
   ORDER_HEADER_IN       =
       order_header_inx            = i_t_header
       simulation                      = cc_x
       behave_when_error         = l_behave
   INT_NUMBER_ASSIGNMENT       = ' '
   LOGIC_SWITCH                =
    TABLES
       return                              = i_t_return
       order_item_in                  = i_t_item
       order_item_inx                = i_t_itemx
   PARTNERS                        =
   PARTNERCHANGES              =
   PARTNERADDRESSES            =
   ORDER_CFGS_REF              =
   ORDER_CFGS_INST             =
   ORDER_CFGS_PART_OF          =
   ORDER_CFGS_VALUE            =
   ORDER_CFGS_BLOB             =
   ORDER_CFGS_VK               =
   ORDER_CFGS_REFINST          =
   SCHEDULE_LINES         =
   SCHEDULE_LINESX             =
       order_text                    = i_t_text
   ORDER_KEYS                  =
       conditions_in               = i_t_bapicond
       conditions_inx             = i_t_bapicondx
     extensionin                 = i_t_extensionin.
  IF i_t_return-type EQ cc_s OR i_t_return-type EQ cc_w OR i_t_return-type EQ cc_i.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = cc_x.
    PERFORM return_code.
  ELSE.
    p_flag = cc_x.
    PERFORM return_code_err.
to rollback the transation for error records
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
  ENDIF. " IF i_t_return-type EQ 'S'
i hope you can tell me where my code is wrong.
Best Regards,
Emilia

Hello ,
Error 2
i checked about the material number and it seems that everything is in order.
so this is not the problem.:(
Error 1
about the item category error: do i get this error because i don't fill the field ITEM_CATEG?
Error 1 and Error 2
About Message: Condition cc_cond is not allowed as header condition
i really don't undesrtand what this is about.
thank you for your answer.
Best regards,
Emilia

Similar Messages

  • While Creating Sales order Item pricing error is coming........

    HI Friends,
    I  have just given all values in VA01  not saved at tht time and before saving i go the Extras -->Output ---> Header -> Print Preview----> i got the form then i  back to the screen ... now i save sales order but it giving error " Item Pricing error" if  i click on item pricing error button it goes to the  sap first screen.
    could you please help me in this......
    Regards
    Venkat boddu

    May be fault items where there is no pricing or so.
    Check all items and reprice them before save. if they are ok then go to MV45AFZZ and check save document prepare and save document user exits for the message. Also check form and print program.
    Last but not least, get the message number and class for the message then go where used list for that message.
    Mostly, this message is populated in user exits.

  • Sales Order Item charge

    In the Sales Order item line have lines charge,
    How to insert the charge ? Is it set in the Item Master or Price List ,please let me know ?
    thanks

    It is not very clear from your post what you actually did. It seems that you applied freight cost during ship confirm. If that is yes, and you haven't done the cost to charge setup then it won't appear as a charge at the line level. When you enter any freight costs associated with the line or delivery during ship confirmation then, those costs are transferred to the order line (during Shipping to OM interface after ship confirm) as price adjustments. Then the conversion of the costs into charges will be triggered, provided the 'cost to charge' conversion setup has been done. The converted charges will be applied to the line. The cost to charge conversion part will require you to define a "Freight and Special Charges List" type modifier to be used along with a seeded (there are many already) / user defined "Cost to charge conversion formula". For details you can refer to "*Setting up Freight and Special Charges For Cost to Charge Conversion*" in OM implementation manual.
    If you want to apply the actual Freight and Special charges at the order/ line level directly then you have to define "Freight and Special charge List" type modifiers and you should have proper security privilege through OM%Charging%Privilege profile to apply the same (as mentioned in my previous post). You can set these modifiers for as automatic application as well.
    Please note these are 2 different functionalities and based on your need you to decide which one is applicable.

  • Pop up when Sales order item partner is changed

    Hi,
    Can we get a pop up when a partner function in sales order item line is changed which should display the text maintained for the customer in XD02??
    If so please let me know..
    Thanks & regards,
    Santhosh
    Edited by: SS on Jun 8, 2009 3:27 PM

    Hi..
    Put option C there & save.
    This filed defines result of ava chk in sales order.
    (Rule for transferring the results of the availability check
    Specifies for a particular sales area how the system reacts when the availability check determines that the inventory is insufficient to satisfy the order quantity.
    Use
    When inventory is insufficient, the system can react in one of two ways:
    The system presents a pop-up window and you choose from different alternatives, or
    The system automatically proposes one of the alternatives (no pop-up window appears)
    Example
    The system can, for example, automatically confirm the delivery proposal. The delivery proposal consists of the quantity that is available for delivery by the requested delivery date.)
    Also make sure in OVZ8 you have ticked Av Chk for your schedule line category
    Regds
    MM
    Edited by: MANOJ  MAHAJAN on Oct 26, 2009 12:21 PM

  • BAPI_SALESORDER_CHANGE to update reason for rejection of sales order item

    Hi,
    The FM BAPI_SALESORDER_CHANGE is not working properly as I am getting below error when try to update the reason for rejection at sales order item level.
    The delivery is done for this salesorder. Is it because the reason for rejection field is not as an input field when delivery done?
    error in return table is " Field 'ABGRU' cannot be changed, VBAPKOM 000010  ready for input"
    Request your suggestions to avoid this error.
    Thanks

    >
    anikaushi wrote:
    > Hi,
    > The delivery is done for this salesorder. Is it because the reason for rejection field is not as an input field when delivery done?
    >
    >  error in return table is " Field 'ABGRU' cannot be changed, VBAPKOM 000010  ready for input"
    >
    >
    > Thanks
    Yes, Most likely.. You can confirm this by trying to change a order without delivery and see if it goes thru (to ensure that you have passed correct parameters)...
    you may have to delete the delivery (and if billing document exist, cancel it), before you can reject the line item... it would be safer to raise an error message and let the users manually delete delivery document as long as you don't have large volumes of this scenario..
    Please see the SDN thread for how you can avoid this error...
    Re: Cancel Sale Order after Issued Billing

  • How to add line item to sales order item table?

    Kindly help me the with the below requirement .
    Add line item to sales order(va01) dynamically on click of button. The button is also custom created push button.
    In the above requirement I have added the pushbutton to va01 tcode. But when I click on that button I need to add line item to sales order item table.
    I tried a lot but I am not successful. If possible can u please help on this.
    Regards,
    Rachel

    Hi!
    It's quite easy even in the standard SAP to add a line item for a customer order, I don't think it worth to develop a new button for this.
    However if you wanted to add a line automatically, the you can do the following in the program MV45AFZZ, FORM USEREXIT_SAVE_DOCUMENT.
    You can use similar code, but with some modifications.
    DATA: lv_posnr.
    LOOP AT xvbap.
    MOVE xvbap-posnr TO lv_posnr.   "get the last posnr
    ENDLOOP.
    ADD 10 TO lv_posnr.
    MOVE 'XYZ' TO xvbap-matnr.   "enter your material number here
    MOVE lv_posnr TO xvbap-posnr.
    * fill additinal field data in XVBAP if necessary
    MOVE 'I' TO xvbap-updkz.                  "Insert line
    APPEND xvbap.
    Regards
    Tamá

  • Sales order item assignemnt block ,if we click edit extra blank line on items level i want remove that line how to do it?

    Hi Team,
    Sales order item assignemnt block ,if we click edit ,Item assignment block extra blank line on items level is showing , i want remove that line how to do it?
    Thanks&regards
    Kalpana

    Hi Ravi,
    With the help of Dharmakasi Thotakura...
    As suggested to do changes in DO_INITCONTEXT and GET_I_T_TABLE methods ....i have implemented these two methods...Now problem only one column ITEM_NO will be disabled  remaining cloumns not disabled...i want to disable entire column including ACTION column also..Action Column contains INSERT and DELETE buttons.how to do it?
    METHOD
    do_init_context.
    CALL METHOD SUPER->DO_INIT_CONTEXT.
    DATA : lr_ent TYPE REF TO cl_crm_bol_entity,
    lr_btadminh TYPE REF TO cl_crm_bol_entity,
    lv_object_id TYPE string,
    lo_context TYPE REF TO /RCRM/15IT__ITEMS_CN00.
    * gv_flag TYPE crmt_boolean.
    lr_ent ?= me->typed_context->btitems->collection_wrapper->get_current( ).
    lr_btadminh ?= lr_ent->get_parent( ).
    lv_object_id = lr_btadminh->get_property_as_string( iv_attr_name = 'OBJECT_ID' ).
    lo_context ?= me->typed_context->btadmini.
    clear lo_context->gv_flag.
    IF lv_object_id IS NOT initial.
    lo_context->gv_flag = abap_true.
    ELSE.
    CLEAR lo_context->gv_flag.
    ENDIF.
    ENDMETHod
    METHOD
    get_i_t_table.
    CALL METHOD super->get_i_t_table
    EXPORTING
    index = index
    component = component
    RECEIVING
    rv_disabled = rv_disabled.
    DATA: lv_component TYPE name_komp,
    lo_entity TYPE REF TO cl_crm_bol_entity,
    lo_property TYPE REF TO cl_crm_bol_entity,
    lv_string TYPE string.
    IF rv_disabled = 'FALSE'.
    lv_component = component.
    lo_property ?= collection_wrapper->find( iv_index = index ).
    lo_entity ?= lo_property.
    lv_string = lo_entity->get_property_as_string( iv_attr_name = lv_component ).
    IF lv_string IS INITIAL or lv_string = '0000000000'.
    IF gv_flag IS NOT INITIAL.
    rv_disabled = 'TRUE'.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDMETHOD.
    Thanks
    Kalpana

  • Price is not changing in sales order in line item

    dear all.,
    price is not changing in sales order on line item,error comes "CHECK ORDER STRUCTURE.
    Regards,
    Praveen

    Dear
    You can go into VA03 --> Menu --> Environment --> Partner --> display credit account (if the data is maintained, than the system springs into FD33). Another way is to check if the sales order type is assigned to credit management in the transaction OVAK (should be D for aut. credit management).
    Did you enter the pricing date , prcing condition and press enter , so  that it should pick the correct price?
    Check this and come back
    Regards
    JH

  • Mapping between Sales Order-Schedule-Line and Delivery-item

    Hi together,
    I want to extend the Datasource 2LIS_12_VCITM (Delivery-number, -item, Order-number,-item is available) by Sales Order Schedule Line.
    Could not find any ERP table (VBEP and LIPS allow a mapping only on item level) for the mapping between Sales Order Schedule Line and Delivery item yet. The use of the extractor 2LIS_12_VCSCL for the extention (e.g. infoset) afterwards is no option.
    Thanks for your help in advance!!
    Assign full points!!
    Sven

    Hi Reddy,
    thanks for your answer.
    I know that I have to add this field.. but the problem is, how to fill this field. I don't know how to map the delivery-item with the schedule line-item.

  • Ignore the number of schedule lines in sale order item when run MRP

    Dear All,
    I have a problem when I create production order (discrete manufacturing)
    When I create a sale order with one sale order item and 3 schedule lines for this sale order item.
    After that, I run MRP for this sale order, what I get is 3 planned orders for 3 schedule lines. It means that I will have 3 production orders for 1 sale order item.
    I want  create one production order for one sale order item whatever the number of schedule lines in sale order item.
    I think I have to config in MRP. Please help me.
    Thanks in advance

    Dear
    Check in OPPQ then look in Master data Availability Check & strategy for material also check whether u have maintained strategy for same material and see did u extended sales views for other material
    As u said 3 schedule lines for this sale order item check whether u have extended sales views for next material
    With Regards
    Pushpalas

  • Difference between sales order schedule line and item level data

    Hi All,
    Could you please let me know what is the difference between sales order schedule line and item level data?
    Thanks,
    Ramya

    Hi Ramya,
    Sales order schedule line contains del date, order qty, rounded qty, confirmed qty, delivery qty, schedule line category, purchase requisition etc.,  ie It contains the full details of sales order data with respect to the scheduled line of delivery.  The total quantity of a sales order item can be subdivided into schedule lines that contain the various subsets with the corresponding delivering dates.
    Sales order Item level data contains details of the item in the sales order like material code, net price, net value, UoM, PO details, reason for rejection if any, material group,billing date, plant etc., ie this
    contains the full details of item irrespective of scheduled line.
    Regards,
    R. Senthil Mareeswaran.

  • Sales order some line items are showing not relavant

    Hi SD Guys,
    In sales order some line items are showing not relavant.
    Why are they showing a status of not complete or "not relevant"?
    Thanks
    Sunny

    Hi sunny,
                     plz check the each line item in the sales order controls by the item category, so check the item category , depends on the item category, pricing,delivery and billing takes place.
    regards,
    ram.

  • Locking Sales order and line item from reading

    Hi,
    I am writing an interface program to create an offer list inspection report. If two users are running the program at the same time, and if the first user read and processing a sales order line item, it should not read the same sales order line item twice for the second user.
    Please let me know if anybody has used locking sales order at line item level (VBAP).
    The enqueue function for VBAP is not working.
    Any suggestions will be helpful.
    Regards
    Ravikanth

    hi Ravi ,
    u Can lock the Sales Order for processing ,  u cannt restrict users @ tables level.
    u hhave to enqueue the VBELN
    Regards
    Prabhu

  • Bdc sales order multiple line items

    hi friends,
    i prepare multiple sales orders multiple line items through  single flat file
    in bdc program.
    i know information about ...
    H
    I
    I
    I
    BUT my problem is
    H
    I
    I
    H1
    I
    I
    H2
    I
    I
    how will develop this code?

    George Bush,
    Answer fir this question is, you need to do basic ABAP Training.
    Search for SAP ABAP Training Courses.
    You need to build logic in you program by defining appropriate internal table and use loop events to build BDC.   BDC is old style of programming. I would advice you to use BAPI with immediate order processing.
    If you want BDC, you can also try to use LSMW by defining appropriate inbound data structures.
    If you need help let me know.
    Thanks & Regards,
    Mahesh Apte

  • Sales order with line items having multiple values in multiple currency

    Please suggest solution for creating sales order having line items with multiple values in multiple currencies.
    e.g. Line Item A Qty/1 No,  value 100INR100$100EUR. Customer wants all three values to display at sales order line item level and create billing in 3 currencies.

    Hi,
    As far as my understanding it may be possible round the solution,
    For 1 company code we can able to maintain 3 currancies,
    1 currancy is hard currance & other two are dual currancies.
    Create sales order with 3 line items having 3 diffrant currancies
    Spilt invoice on the basis of currancy
    Last pass to this invoices to accounting.
    Whole process is
    Sales order >>> Delivery >>> Invoice 1, Invoice 2, Invoice 3(Split invoice on basis of Currancy).
    Consult with FI Team they will tell you about dual currancy & hard currancy
    Kapil

Maybe you are looking for