New fields update with CRM_ORDER_SAVE BAdI - not working

Dear Experts,
I ask your help in connection updating custom generated fields in Opportunity. In the Webclient UI i added a new field to Opportunity - Total Expected Value, and a Currency for it automatically generated.
The enhancement ID is YEXT00001 and the field name is YYFLD000002 and YYFLD000003 for the currency. I do not added these fields for the opportunity details view, I only want to use them to extend the search criteria for opportunities.
Now the fields are available in the search criteria, and I implemented the BADI CRM_ORDER_SAVE and in it I update these new fields with the value of the original fields of Total Expected Value, but unfortunately my BADI is not updating the field.
Here is my code:
METHOD if_ex_order_save~change_before_update.
  DATA lt_header_guid TYPE crmt_object_guid_tab.
  DATA lt_cumulat_h TYPE crmt_cumulat_h_wrkt.
  DATA ls_cumulat_h TYPE crmt_cumulat_h_wrk.
  DATA lt_orderadm_h TYPE crmt_orderadm_h_wrkt.
  DATA ls_orderadm_h TYPE crmt_orderadm_h_wrk.
  DATA lt_pricing TYPE crmt_pricing_wrkt.
  DATA ls_pricing TYPE crmt_pricing_wrk.
  DATA lt_opport_h TYPE crmt_opport_h_wrkt.
  DATA ls_opport_h TYPE crmt_opport_h_wrk.
  DATA lv_log_handle TYPE balloghndl.
  DATA ls_req_obj TYPE crmt_object_name.
  DATA lt_req_obj TYPE crmt_object_name_tab.
  DATA lt_opport_h_m   TYPE crmt_opport_h_comt.
  DATA ls_opport_h_m   TYPE crmt_opport_h_com.
  DATA ls_field_names TYPE crmt_input_field_names.
  DATA ls_input_fields TYPE crmt_input_field.
  DATA lt_input_fields TYPE crmt_input_field_tab.
  DATA lt_saved_objects TYPE crmt_return_objects.
  APPEND iv_guid TO lt_header_guid.
  ls_req_obj = 'CUMULAT_H'.
  INSERT ls_req_obj INTO TABLE lt_req_obj.
  ls_req_obj = 'OPPORT_H'.
  INSERT ls_req_obj INTO TABLE lt_req_obj.
  ls_req_obj = 'ORDERADM_H'.
  INSERT ls_req_obj INTO TABLE lt_req_obj.
  ls_req_obj = 'PRICING'.
  INSERT ls_req_obj INTO TABLE lt_req_obj.
  CALL FUNCTION 'CRM_ORDER_READ_OW'
   EXPORTING
     it_header_guid                    = lt_header_guid
*   IT_ITEM_GUID                      =
*   IV_MODE                           =
*   IV_ONLY_SPEC_ITEMS                =
     it_requested_objects              = lt_req_obj
*   IV_NO_AUTH_CHECK                  = FALSE
*   IV_COLLECT_EXCEPTIONS             = FALSE
*   IT_ITEM_USAGE_RANGE               =
*   IV_SUBITEM_DEPTH                  = -1
*   IT_OBJECT_FILTER                  =
*   IV_ONLY_CHANGED_OBJ               = FALSE
*   IV_STATUS_H_CHECK_RELEVANCE       = FALSE
   IMPORTING
     et_pricing                        = lt_pricing
     et_orderadm_h                     = lt_orderadm_h
     et_cumulat_h                      = lt_cumulat_h
     et_opport_h                       = lt_opport_h
    CHANGING
      cv_log_handle                     = lv_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
  READ TABLE lt_orderadm_h INTO ls_orderadm_h INDEX 1.
  READ TABLE lt_opport_h INTO ls_opport_h INDEX 1.
  READ TABLE lt_pricing INTO ls_pricing INDEX 1.
  CHECK ls_orderadm_h-process_type = 'Y002' OR ls_orderadm_h-process_type = 'YH02'.
  READ TABLE lt_cumulat_h INTO ls_cumulat_h INDEX 1.
  SELECT SINGLE currency FROM crmd_pricing
    INTO ls_opport_h_m-yyfld000003
    WHERE guid = ls_pricing-guid.
  ls_opport_h_m-yyfld000002 = ls_cumulat_h-net_value_man.
  ls_opport_h_m-ref_guid = ls_opport_h-guid.
  APPEND ls_opport_h_m TO lt_opport_h_m.
  ls_input_fields-ref_guid = iv_guid.
  ls_input_fields-ref_kind = 'A'.
  ls_input_fields-objectname = 'OPPORT_H'.
  ls_field_names-fieldname = 'YYFLD000002'.
  APPEND ls_field_names TO ls_input_fields-field_names.
  ls_field_names-fieldname = 'YYFLD000003'.
  APPEND ls_field_names TO ls_input_fields-field_names.
  APPEND ls_input_fields TO lt_input_fields.
  CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
      it_opport_h       = lt_opport_h_m
    CHANGING
      ct_input_fields   = lt_input_fields
      cv_log_handle     = lv_log_handle
    EXCEPTIONS
      error_occurred    = 1
      document_locked   = 2
      no_change_allowed = 3
      no_authority      = 4
      OTHERS            = 5.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
ENDMETHOD.
Edited by: Gabor Antal on Jun 17, 2010 3:48 PM

Hi,
Put the code in method PREPARE or CHECK_BEFORE_SAVE. CRM_ORDER_MAINTAIN iwill throw an exceptionNO_CHANGE_ALLOWED when used in metho CHANGE_BEFORE_UPDATE.
Check this recent thread,
Re: Updating Order in ORDER_SAVE using BOL
Regards,
Arun

Similar Messages

  • HT4623 Updated with iTunes, iPhone not working! What to do?

    I updated my Iphone 4s with Itunes and then a few minutes after it went completly black, i can hear siri trying to work but it does't !! I tried to charge the battery but nothing happens. Help please.!!

    Try resetting your iPhone.  Hold the power on/off and the home buttons together for 6 or 7 seconds till the Apple logo appears.  Then see what happens.  Hopefully things will be better.

  • Problem with new version 4.3.2 apps not working " after update to the new version "

    Problem with new version 4.3.2 apps not working " after update to the new version "
    i was in 4.3.1 then i do the update , but now after update i face this problem , so what i Supposed to do ?!!

    Hi There
    Had the same problem as you. App would terminate when launched.
    Solution to working You Tube app:
    -Go to playstore
    - Uninstall app (it doesn't remove the app, only removes the update)
    - "Et Voila", working again.
    This doesn't correct the problem, it's just a workaround for you to be able to use youtube app again.
    Hope it helped.
    Best Regards

  • I have iPhone 3G with ios 4 but now i update new version and my phone is not working.it is not activating..when i tried it says please insert sim and try again..any one plez hepl.

    i have iPhone 3G with ios 4 but now i update new version and my phone is not working.it is not activating..when i tried it says please insert sim and try again..any one plez help

    Try this article if you haven't already
    This is the only possibility that came to my mind when reading about your issue:
    "If an iPhone, iPad, or iPod touch is not recognized in iTunes on Windows, the Apple Mobile Device Service (AMDS) may need to be restarted"

  • BP new field update is not possible

    Hi Experts,
    I work in CRM 4.0 which is connected to R/3. I have created a new BP field with EEWB. I would like to replicate this field into a standard R/3 field.
    Without any enhancement the new field is replicated in "Insert" mode but in "Update" the replication does not work.
    I discovered two problems in R/3. The exchange structure does not contain the new field and the BP does not exist in R/3 BUT000 after creation.
    In "Update" mode the system searches for BP in R/3 BUT000.
    Finally I extended the exchange structure in R/3 and if I create a new BP it will be created in R/3 even in R/3 BUT000 and during "Update" the new field value will be updated.
    My only problem is that I have 100.000 BP's in the systems which were created without the enhanced R/3 structure and the update of the new field content is not possible. The R/3 BUT000 does not contains these 100.000 BP's.
    Do you have any idea how to solve this issue?
    Thanks in advance!
    Regards,
    Tom

    Hi Thomas,
    I would have liked to reply you back earlier on, but  I was able to see my points only today.
    1 How to manipulate Bapi to load it. Please select your Bapi which refer to the proper object in trx CODE Bapi. Then talk to your developper to create the right program to load the missing data, supposedly able to manage files (better a txt file).
    Next monday if you wish I may send you documentation concerning Bapi, if you give me your e-mail
    2. How to upload to your backend the changes of Bps. There is an envent you need to associate to your object Bupa in administration CONSOLE - DATA EXCHANGE. It is explained in the Best practise manual called Replication.
    Please refer to my attached thread to find out the manual in the Best Practise Crm for your version:
    Re: Download Conditions from R3
    Then, if this doesn't work, check if the function module in charge of uploading the changes is working, by putting a Breakpoint in the FM associate to your object Bupa in Business object in administration console.
    <b>Please reward with points if it helps.</b>
    AndreA

  • Hi, I have iPad 2, when I buy it it has old iOS. Then I update it now it has 5.1.1 iOS and modern firmware 4.12.01. After update my wifi is not working. Only searching for wifi. 3G working well. But wifi olso worked with old iOS. So what can do ? Pls

    Hi, I have iPad 2, when I buy it it has old iOS. Then I update it now it has 5.1.1 iOS and modern firmware 4.12.01. After update my wifi is not working. Only searching for wifi. 3G working well. But wifi olso worked with old iOS. So what can do ? Pls

    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    Additional things to try.
    Try this first. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    Another thing to try - Go into your router security settings and change from WEP to WPA with AES.
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • Brand new Mac user help please! How do you connect a 17" monitor to the MacBook? I have the monitor plugged into the Mac, but the F8 that I am used to with PC does not work. Please help. Thanks.

    Brand new Mac user help please! How do you connect a 17" monitor to the MacBook? I have the monitor plugged into the Mac, but the F8 that I am used to with PC does not work. Please help. I am getting lots of spelling errors as the MacBook laptop screen is too small. Thank you so much! .

    Contentmom6 wrote:
    Brand new Mac user help please! How do you connect a 17" monitor to the MacBook? I have the monitor plugged into the Mac, but the F8 that I am used to with PC does not work.
    Normally, you just connect the monitor to the MacBook using a VGA adaptor that you can buy from an Apple Store.  Now try System Preferences > Displays > Detect Displays.  You should now be able to select a display mode for the monitor.  If it still doesn't work, then I'd check that everything is properly connected.  I've had problems with colours disappearing due to a faulty connection in the VGA adaptor.
    Bob

  • HT202853 I have many project made in move HD that are not updating to the new iMovie 10 on my new iMac.  Why is this not working as stated?  How do I get my projects back from backup after old iMac crashed?

    I have many projects made in imovie HD that are not updating to iMovie 10 on my new iMac.  Why is this not working as stated on the article HT202853?  How do I get my projects back from backup after old iMac crashed?

    According to:
    Update projects and events from previous versions of iMovie in iMovie (2014) - Apple Support
    you can update from iMovie versions 7, 8 and 9, but iMovie HD is iMovie 6.
    Maybe you can update in two steps, first from iMovie 6 to iMovie 7, 8 or 9 then to iMovie 10. 
    Geoff.

  • CS3 Updates cause programs to not work with Windows 7?

    Has anyone else had their programs stop working after an Adobe update was installed?  Although I have been told by 5 different Adobe staff members that CS3 is "not at all compatible" with Windows 7...it somehow worked on two machines for 6 months.  Then a recent Adobe update caused it to not work.  I could understand if it never worked with Windows 7, but it stopped working after Adobe's update.  I am sure that Adobe has the resources to test their updates on Windows 7 machines and would have found this problem.  What would make them proceed with giving their customers this update...hmmm maybe the release of CS5???
    I also asked if they could send me a CD (since I chose a download) of the original CS3 suite without the updates and they told me that they don't have any.  Really??? Adobe doesn't have any copies of a program that is only 3 years old?

    Try this page to download a copy of the original...

  • After the OS 6 update my speaker does not work. My music plays but no sound comes out. Can someone help me with this issue? I currently have the 4S.

    After the OS 6 update my speaker does not work. Volume control on the side does not adjust the volume either. My music plays but no sound comes out. Can someone help me with this issue? I've tried rebooting my phone but still no sound comes out. I currently have the 4S.

    try to activate and desactivate the airplne switch a couple of time

  • My iPhone has been badly damaged and I cannot get the screen to work. I want to do a backup to transfer to my new phone but the backup will not work because the phone is locked. Can I input my lock code to the phone via the computer to allow a backup?

    My iPhone has been badly damaged and I cannot get the screen to work. I want to do a backup to transfer to my new phone but the backup will not work because the phone is locked. Can I input my lock code to the phone via the computer to allow a backup?

    Sorry, no.

  • 'Get All New Data Request by Request' option not working Between DSO n Cube

    Hi BI's..
             Could anyone please tell me why the option ' Get one Request only' and  'Get All New Data Request by Request' is not working in DTP between Standard DSO and InfoCube.
    Scenario:
    I have done the data load by Yearwise say FY 2000 to FY 2009 in Infopackage and load it to Write-optimised DSO (10 requests) and again load Request by request to Standard DSO and activate each request. I have selected the option in DTP's to  'Get All New Data Request by Request' and its working fine between WDSO and SDSO. But not working between Cube and SDSO. While Execute DTP its taking as a single request from SDSO to Cube.( 10 request to single request).
    Regards,
    Sari.

    Hi,
    How does your DTP setting looks like from below options ? It should be change log, assuming you are not deleting change log data.
    Delta Init. Extraction from...
    - Active Table (with archive)
    - Active Table (without archive)
    - Archive ( full extraction only)
    - Change Log
    Also if you want to enable deltas, please do not delete change log. That could create issue while further update from DSO.
    Hope that helps.
    Regards
    Mr Kapadia
    *Assigning points is the way to say thanks*

  • I am trying to setup my new time capsule but it is not working. after entering the airport utility and locating the TC, after I tell the program to continue, the unit just disappear and the setup menu says there is an error. Any idea of what is happening?

    I am trying to setup my new time capsule but it is not working. after entering the airport utility and locating the TC, after I tell the program to continue, the unit just disappear from the menu and the setup menu says there is an error. I tried using the wireless connection, and also the cable, but none worked. Any idea of what could be happening?

    What are you setting it up as.. join wireless network .. the very worst setup, it will disappear.. reboot the whole network in order modem. router TC.. clients and it will likely reappear.
    Tell us what network setup you are using..
    If you setup with cable to a computer completely isolated from the network with TC also isolated.. finish the setup of everything you want. .before update.. then plug it into the network. .then restart everything in correct order.. it will work most of the time.

  • The head phone jack on my brand new iPod touch 5th generation is not working properly

    The head phone jack on my brand new iPod touch 5th generation is not working properly. It has sound without the headphones in but when I plug them in it has no sound, it's low, or poppy. I had only used my apple supplied headphones once before and it worked fine. I know it's not the headphones because I tried them on my girlfriends phone and they worked fine.

    - Try cleaning out/blowing out the headphone jack. Try inserting/removing the plug a dozen times or so. There is a little switch in the headphone jack that disconnects the speaker when the headphone jack is inserted.
    Try the following to rule out a software problem
    - Reset the iOS device. Nothing will be lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup
    - Restore to factory settings/new iOS device.
    - Make an appointment at the Genius Bar of an Apple store. Seems you have a bad headphone jack.
    Apple Retail Store - Genius Bar

  • I am trying to log on to iwork but it keeps saying that my password is incorrect. I have already reset it and entered my new password and it still is not working. what should i do?

    I am trying to log on to iwork but it keeps saying that my password is incorrect. I have already reset it and entered my new password and it still is not working. what should i do?

    I really can't comprehend the logic that leads to believe that password for old apple id will come to e-mail for new id. Buy may be I just misunderstood something. Contact Apple for assist with password retrieval. If you can verify yourself as account owner they may be able to help you.

Maybe you are looking for