Urgent: Change custom conditions on item level

Hi experts,
could you please tell me how you resolve this issue, its very urgent? I´m facing the promblem that my condition type doesn´t get changed! I want only to change KBETR at item level. After CRM_ORDER_SAVE is called I can see, that order got saved, but nothing happens
Please help me out! I think there is not a lot which has to be change. Here is my Coding:
parameters: lv_head type crmt_object_guid default '...'.
parameters: lv_item type crmt_object_guid default '...'.
parameters: lv_kbetr type prct_cond_rate default '12'.
insert lv_head into table lt_guid.
insert lv_item into table lt_item.
call function 'CRM_ORDER_READ'
   exporting
     it_header_guid                    = lt_guid
     it_item_guid                      = lt_item
   importing
     et_pridoc                         = lt_pridoc
     et_pricing_i                      = lt_pricing_i
* CHANGING
*   CV_LOG_HANDLE                     =
  exceptions
    document_not_found                = 1
    error_occurred                    = 2
    document_locked                   = 3
    no_change_authority               = 4
    no_display_authority              = 5
    no_change_allowed                 = 6
    others                            = 7.
if sy-subrc <> 0 and lt_pridoc is not initial.
   write: / 'ERROR'.
   exit.
endif.
read table lt_pridoc index 1 into ls_pridoc.
if sy-subrc <> 0.
   write: / 'ERROR'.
   exit.
endif.
read table ls_pridoc-pric_cond into ls_cond with key kschl = 'Z002'.
if sy-subrc <> 0.
   write: / 'ERROR'.
   exit.
endif.
ls_input-ref_guid   = lv_item.
ls_input-ref_kind   = 'B'.
ls_input-objectname = 'PRIDOC'.
ls_input_fn-fieldname = 'WAERS'.
insert ls_input_fn into table ls_input-field_names.
ls_input_fn-fieldname = 'KBETR'.
insert ls_input_fn into table ls_input-field_names.
*ls_input_fn-fieldname = 'ACTIVATE'.
*insert ls_input_fn into table ls_input-field_names.
insert ls_input into table lt_input.
ls_pricom-ref_guid   = lv_head.
ls_pricom-ref_kind   = 'B'.
ls_pricom-pric_cond[] = ls_pridoc-pric_cond[].
move-corresponding ls_cond to ls_cond_chg.
ls_cond_chg-waers = 'EUR'.
ls_cond_chg-kbetr = lv_kbetr.
insert ls_cond_chg into table ls_pricom-cond_change.
append ls_pricom to lt_pricom.
call function 'CRM_ORDER_MAINTAIN'
   exporting
     it_pridoc         = lt_pricom
   changing
    ct_orderadm_h     = lt_header
     ct_input_fields   = lt_input
   exceptions
     error_occurred    = 1
     document_locked   = 2
     no_change_allowed = 3
     no_authority      = 4
     others            = 5.
if sy-subrc <> 0.
   exit.
endif.
call function 'CRM_ORDER_SAVE'
   exporting
     it_objects_to_save   = lt_guid
   importing
     et_saved_objects     = lt_saved
*   ET_EXCEPTION         =
*   ET_OBJECTS_NOT_SAVED =
   exceptions
     document_not_saved   = 1
     others               = 2.
if sy-subrc eq 0.
   commit work and wait.
else.
   rollback work.
endif.
Best Regards
Tanja

Hi Tanja,
I am probably not the right person for code but please review below listed former threads which should be helpful:
http://forums.sdn.sap.com/thread.jspa?threadID=661004
http://forums.sdn.sap.com/thread.jspa?threadID=596313
http://forums.sdn.sap.com/thread.jspa?threadID=186588
Best regards - Christophe

Similar Messages

  • Sales order: How to add pricing conditions at item level in BDC of VA01

    Hello Experts,
    Am writing BDC for sales order, in this process I need to add ITEM PRICING CONDITIONS, so, am selecting item and pressing the DOLLAR symbol button and am adding the conditions by pressing PLUS button in loop!! but am getting this erorr- Field KOMV-KMEIN (2) is not an input field!! when I execute it in we19-BACK GROUND only!! if I execute the same CODE IN we19-Fore ground, I dont have any issue!!  I checked this SDN (field status in config), Google, but did not helped me!
    Pls. let  me know is there any other way to add conditions at item level in VA01 in BDC code?
    THank you

    Hi,
    It is happening because the second row of the item level data screen is becoming display only. Please check whether In foreground mode you are pressing an extra enter to give data in the second row of the item level data after giving data in the first row and in BDC recording you have not recorded that 'Enter'.
    Regards,
    Gargi

  • Sales order condition change for Header and Item level..

    Hi Gurus,
    My requirement is as below..
    Business wants to create new sales order from reference.. While creating slaes order fron reference , need to populate header/Item level condition tab data from originally paid by the invoice for that refence sales order not from refence sales order condition price.
    I would like to how to bring this one, any user exit or copy control and any VOFm routine need to populate this kind of requirement.
    Any one have any idea please let me know.. It very urgent, give reward points for right solution..
    thanks,

    Hi,
    Here are the answers to your question
    > Is it possible to add/change condition types on the sales order (header and item level) for which invoice has been created already?
    I mean is it possible to add some surcharge condition to already invoiced order and than as result debit memo?
    The answer is No. You cannot add or change the condition once it is invoiced.
    > And one more question : Are there some time restrictions when debit/credit memo can be created? (I believe not, but I would like to have this confirmed, as I am not SD expert.)
    The answer is No again. There is no time restriction and you can create debit or credit memo immediately when the invoice is released to accounting.
    Hope this helps
    Thanks
    Mukund S

  • Steps to implement ME_GUI_PO_CUST ME21N to create custom tab at item level

    Dear Gurus,
    I have to create one Custom tab in ME21N item level beside Conditions.
    The Tab name is Customer. I'm very new to ABAP so after searching the forums I got ME_GUI_PO_CUST  badi is used to do that. In the Custom tab my required fields are
    PO NO1--                        PO NO2--
    PO Item NO1----
                     PO Item NO2
    Quantity----
                          Quantity
    SO NO1--                       SO NO2--
    SO Item NO--                 SO Item NO--
    any one provide me the sample code to implement this.
    Thanks!

    solved

  • Changes in conditions at header level in Scheduling Agreement

    Dear experts,
    I would like  to change condition for duty at header level.when i did through ME32l,system is showing these conditions in Grey field.I want to over write the condition value with new one.
    Please suggest me how to do this.
    Thanks in advance
    MK

    Hi MK,
    While condition customizing in "chnages can be made" manual entries if you select manual entry has priority "c" then only you can overwrite the condition value
    but for selection "B" you will not be able to overwrite because this value is flowing auto from conition record
    If you think logically if you are maintaining condition record and condition value is flowing auto why system should allow you to change instead you can change the condition record from where the value is flowing
    And if you want that value to be always overwritten make "c" as priority
    Hope this clears your doubt
    BR
    Diwakar
    reward if useful

  • Add "Customer fields" for item level

    Hi experts.
    Please i need a help.
    Im using the SAP CRM 5.0 win client.
    I will use the EEWB method to add new fields at the item level (CRMD_CUSTOMER_I). I believe that these fields will appear in the "customer fields" tab, but this tab isnu2019t displayed inside item details.
    Why its can be happen?
    Is some config. missed?
    Thanks in advanced.
    Daniel

    Yes. it is possible but you have to take care of in the back end too and how these fields comes and sit in ECC. so that you may need to map in the IDOC or XI data . so that these information must be pssed to ECC and available  and accordingly you need to change in purchase order too since all these data will be copied into purchase order too.
    for example :- if you add one field in header level /item level of contract
    and it must be coppied into Backend contract as well as your next consecutive docuemnt like Purchase order must be taken care. hope you understand now.
    Muthu

  • Double PR00 condition at item level in the IC

    Hello SAP Gurus,
    I need your help with this issue.
    Scenario: I enter the Interaction Center UI and start creating a sales order with "MXN" as the currency at header level, I enter a product in "USD" and price is not calculated automatically and has to be enter manually.
    When going into the item details two identical price conditions appear:
    PR00 - ....... - USD (blank)
    PR00 - 1.34 - USD (the price I entered at header level)
    I tried to get rid-off one but ít wont let me,a messages is generated: "Cannot erase condition, it´s mandatory".
    I´ve also tried matching the header and item level currency but the same thing happens; the price is enter manually and two PR00 conditions are created.
    This cannot be left like this since it generates errors at the invoicing stage.
    Your help will be trully appreciated.
    Thanks.
    May
    PS.  I am working in the Interaction Center UI / ERP Order / CRM 7.0

    Found the reason and solution for this error in my situation, which has to do with how the prices are assigned to the material.
    The prices for the materials are maintain in a List of Prices per volume uploaded in ECC.  This list has serveral volumen scales, and each scale has a different price (Logic: as the volume increases, the price decreases).  The issue here is that the initial scale for some materials was to set to high and sales orders were being created with quantities under that scale, as a consequence the price was not calculated automatically because it didnt fell under any scale and the by manually entering the PR00 condition, somehow it would create an extra could not be erase.
    Example:
    - Material: ABCD
    - List of Prices per volume for ABCD: Scale 1) 1000KG - 1499KG -> 2.50 USD  /  Scale 2)1500KG - 1999KG -> 2.44 USD  /  Scale 3) 2000KG - 2499KG -> 2.38USD
    - Sales Order: Material ABCD / Qty order: 550KG = MISSING PR00 MANDATORY CONDITION
    - Reason: QTY 550 KG is out of scale
    The solution proposed, was to review the scales and if sales orders are being created in lower quantities, they need to set a low volumen for the initial scale.

  • How to restrict the user from making any changes in Sales order- item level

    Hi to all
    How to restrict the users from making any changes in sales order at item level if the same sales order is released by senior user through status profile.
    Regards
    Anish Parikh
    Edited by: anish parikh on Jan 24, 2008 5:16 AM

    Hi Anish,
    This can be achieved through the roles and authorization.
    This can be done through the basis team. they can create user profiles and roles.
    For the roles they assign some transaction codes so that they can view the only assigned tr. codes.
    Like that ur requirement can be done.
    Also u can prevent the user to change any fields in the sales order screen (VA02). for that please modify the authorisations.
    Hope i answers.
    Reward points if useful.
    Edited by: kaleeswaran bhoopathy on Jan 24, 2008 9:57 AM

  • BAdI: ME_GUI_PO_CUST add customer field to item level

    Hi Experts,
    I want to add a customer field to PO item level, how to do that? the functional consultant told me to first implement the BAdI: ME_PROCESS_PO_CUST before I can use BAdI: ME_GUI_PO_CUST, can anyone show me the procedure on how to implement this? thanks in advance.
    Kind regards
    Dawson

    Hi Dawson,
    Those BADIs are having good documentation and sample code. Once gone through the documentation, you can refer below thread.
    Re: ME_GUI_PO_CUST & ME_PROCESS_PO_CUST   - ME21N/ME22N/ME23N
    Reddy

  • Add fields in "customer fields" at item level

    Hi experts.
    Please i need a help.
    Im using the SAP CRM 5.0 win client.
    I will use the EEWB method to add new fields at the item level (CRMD_CUSTOMER_I). I believe that these fields will appear in the "customer fields" tab, but this tab isnu2019t displayed inside item details.
    Why its can be happen?
    Is some config. missed?
    Thanks in advanced.
    Daniel

    Hi Ratish
    First i wanna thank you for the reponse.
    In fact i didnt execute the EEWB yet.
    My question is, the tab "customer fields" isent displayed inside the item details so after that i run the EEWB and check "item" to add the fields, the tab "customer fields" will be displayed automatically?
    Thanks so much, i have added to you some points.
    regards.

  • Authorization scheme for display/read only conditions on item level

    Hi All,
    I have question. I want to use an authorization scheme to manage if users with a certain role have the permission to either update an item or have the persmission to only see the item or that they don't have permission to see it at all.
    So, the input for the scheme would be: 1. user role 2. the current page 3. the current item.
    The output would be: 0 (update) 1 (read only) 2 (not displayed).
    I think I can manage that.
    And I can attach this schema to the items.
    So far so good.
    But how can I make it so that the 0,1 and the 2 will actually do what they need to do?
    I have been thinking about making a function like GET_AUTHORISATON(ROLE,PAGE,ITEM) output: 0,1,2 but I still can't figure out how to connect this with the functionality I want to achieve.
    Can somebody give me a hint?
    Andre

    Thanks Hari,
    Thanks, it works, almost, but what if items are mandatory on a page, but not always mandatory?
    If a user has a certain role, some fields are manadatory, otherwise not.
    Again, a function would do the trick as far as the input and output information
    something like IS_MANDATORY(USER_ROLE, CURRENT_PAGE, CURRENT_ITEM) but how can I make it work?
    I guess a PL/SQL validation like:
    IF IS_MANDATORY(USER_ROLE, CURRENT_PAGE, CURRENT_ITEM) THEN ITEM IS NOT NULL
    END IF;
    Andre
    PS: personally I think item level security is not something you wish to implement in your system. I prefer different screens for different roles.
    Far more straightforeward. Easy for maintenance. When something disfunctions, it's far more easy to pinpoint the location of the cause.

  • Customer PO at item level needs to be populated to existing Z report

    Hi All,
    Just would like your confirmation on the below requirement.
    Requirement: Already there is existing Z open sales orders report is availble for which we need to add the below mentioned line item PO into the output of the report.Business manually change the line item PO that should be displyed into output of the report.
    And one more point already the header PO  number is alredy displying inth output of the report.
    My understanding is: Since the customer PO is unique to the entire document what ever the PO is maintained at header level which will be copied to all the line items, even i checked the line item and header table & field both are same VBKD-BSTKD hence eventhough user manually change the Line item PO number you can't get the same into the output the of the report is this my understanding is correct or we can display the line item PO details into output of the report?
    thanks,

    Thank you DB49 for your above answer,also checked with business why they want to maintain the line item wise the PO details.
    The answer is recently they have implemented high sea sales process during the Post go live they could not complete the total cycle thorugh SAP, only sales order created in SAP but not Vendor invoice and customer invoice etc were manged manually.
    In sales order it contains more than one line items. Business has compelted upto customer invoice for some line items( sales order in SAP and remaining through manual).
    So now when the user is trying to pull the open sales order report system is pulliing the above compelted line items also, sytem is doing correct beacuse in SAP only sales order created and remaining process through manually. But actually the report is wrong.
    So now the business will enter manully some description for those line items which is completed until billing ( sales order in SAP+ remaing process through manual). so that in the output of the report they can understand which which are all the line items in sales order are completed the billing.
    Hence they want to disply the line item PO into the output the report so i think it makes sense to me now, do you think any other alternative for the above requreiement ?
    thanks,

  • Unable to find conditions in item level of STO PO

    Hi All ,
    The user raised Stock transfer PO(UB) between plant Xand Y in same company code  , doc type UB
    assigned to pricing schema XYZ.. in customizing . However conditions and pricing procedure are not picking in PO item .
    Please help us.
    Regards,
    Amar

    Hi,
    Please check the settings in 'Define Condition control at plant level' in the path IMG-MM-Purchasing-Conditions.
    Here, if you have maintained '+' against your plant then it is mandatory to create Inforecords specific to the plant....which you may not have created in your case as it is transfer within the same plant.
    This may be the reason why the conditions are not getting reflected......just see if you can blank that field in the above setting and test the PO creation.
    I hope the other configs (in particular the 'Determination of calculation schema in purchasing') are all properly done and defined.
    Regards,

  • Shipment cost - condition type item level

    hey all ,
    i have in 1 pricing procedure 4 condition types .
    3 of them at delivery level and 1 at shipment level .
    i created a requirement that activate the delivery level condition (3 conditions) OR the shipment
    condition ( 1 condition ) .
    the shipment cost document calculates the fright correctly but even if the condition  ( 3 or 1 ) is disabled
    by the requirement the other tab is still showing.
    for example if i disable the 3 condition ( delivery ) i have 2 tabs ,
    1 at delivery with 3 condition disables and another tab with active shipment level condition .
    how do i get it to open with only 1 tab ?
    Best Regards
    ASA
    Edited by: ASA MOKED on May 25, 2009 7:46 PM

    Hi
    Try to change the value of calculat.type in the defition of the condition (for instance, with A instead of B).
    I hope this helps you
    Regards
    Eduardo

  • New sales order and Change sales order in item level or delete at item leve

    I got one requirement. Daily i have to display one report on new sales orders created on that day and any sales order item is modified or any item is deleted or any item is added.
                      How to get the sales order numbers and position numbers which will follow above creteria. I found one function module but it is not giving position numbers and new sales order details.
             Is there any BAPI for this requirement.

    I am using "CHANGEDOCUMENT_READ" function module to get the new sales orders created and changed sales order items on a particular time. This function module is getting data from CDHDR and CDPOS tables. But only change sales orders is coming. New sales orders which is created on that time is not getting.
              One of my friend is telling like we have to activate one change pointer to retrive new sales orders also. Which is like there will be one check box.
    Is any body having idea on this. Please reply me on briefly with the code to retrive new sales orders and changed sales orders

Maybe you are looking for