Update of a field in CRMD_ORDERADM_H not working.

Hi
I am writing a executable report to update a field ZZORDERADM_H0201 in the table "crmd_orderadm_h"( header structure)
But the value does not get updated in the table!!
I wrote the below report.
lt_input_data has the OBJECT_ID and a flag( either C or W).i got it into this table from flat file.
When i see the output of CRM_ORDER_SAVE , * lt_saved_obj * is 0.
CRM_ORDER_READ gets me the structure for the object_id. Somewhere in ORDER MAINTAIN or ORDER SAVE there is a problem.
Can you please help me out and indicate what am i doing wrong!
Please help.
REPORT----
LOOP AT lt_input_data into wa_input_data.
SELECT SINGLE * FROM crmd_orderadm_h
INTO ls_orderadm
WHERE object_id EQ wa_input_data-object_id.
REFRESH: lt_orderadm_h_comt,lt_input_fields,lt_field,lt_header_guid.
SELECT guid from crmd_orderadm_h
INTO table lt_header_guid
WHERE object_id EQ wa_input_data-object_id.
IF sy-subrc NE 0.
CONCATENATE 'This transaction number ' wa_input_data-object_id
'does not exist' INTO lv_var.
WRITE lv_var.
CLEAR lv_var.
CONTINUE.
ENDIF.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = lt_header_guid
IMPORTING
ET_ORDERADM_H = lt_orderadm_h
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 EQ 0.
CLEAR :ls_orderadm_h.
LOOP AT lt_orderadm_h INTO ls_orderadm_h.
if ls_orderadm_h-object_id is INITIAL.
continue.
endif.
IF wa_input_data-ZZORDERADM_H0201 EQ 'C'.
ls_orderadm_h-ZZORDERADM_H0201 = 'CLE'.*
ELSEIF wa_input_data-ZZORDERADM_H0201 EQ 'W'.
ls_orderadm_h-ZZORDERADM_H0201 = 'WAS'.
ENDIF.
MOVE-CORRESPONDING ls_orderadm_h TO ls_orderadm_h_comt.
APPEND ls_orderadm_h_comt TO lt_orderadm_h_comt.
Prepare the input fields.
ls_field-fieldname = 'ZZORDERADM_H0201'.
INSERT ls_field INTO TABLE lt_field.
READ TABLE lt_header_guid into ls_header_guid INDEX 1.
CLEAR: ls_input_fields.
ls_input_fields-ref_guid = ls_header_guid.
ls_input_fields-objectname = 'ORDERADM_H'.
ls_input_fields-field_names = lt_field.
INSERT ls_input_fields INTO TABLE lt_input_fields.
CLEAR : ls_orderadm_h_comt.
ENDLOOP.
IF lt_orderadm_h_comt IS NOT INITIAL.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
CHANGING
CT_ORDERADM_H = lt_orderadm_h_comt
ct_input_fields = lt_input_fields
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
IF sy-subrc NE 0.
WRITE /.
WRITE 'Data is not valid'.
CONTINUE.
ENDIF.
INSERT ls_header_guid into table lt_objects_to_save.
IF lt_objects_to_save is not INITIAL.
CALL FUNCTION 'CRM_ORDER_SAVE'
EXPORTING
it_objects_to_save = lt_objects_to_save
IMPORTING
et_saved_objects = lt_saved_obj
et_exception = lt_exception
et_objects_not_saved = lt_not_saved
EXCEPTIONS
document_not_saved = 1
OTHERS = 2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
DESCRIBE TABLE lt_saved_obj LINES lv_total.
end loop.

Hi,
Use badi order_save.
Best regards,
Caíque Escaler

Similar Messages

  • Publishing HTML(Page content) field required field validation is not working

    The required field validation is not working on Site Column of type "Full HTML content with formatting and constraints for publishing". I found a link i.e.
    https://social.msdn.microsoft.com/Forums/office/en-US/7b544aae-2562-4b8e-8e5b-36a1d47a4d14/publishing-htmlpage-content-field-required-field-validation-is-not-working?forum=sharepointdevelopment
    which tells this is a hot fix in July 2014 CU . Can anyone help me with what all Fixes are there in July 2014 CU. So that I can update only if it required!
    Or any other alternative where I can use the required field validator on "Full HTML content with formatting and constraints for publishing" column type?

    You could add a scripteditor webpart on the newform.aspx page and add client side validation using jQuery.
    $(document).ready(function()
     var fname = document.getElementById('fname').val();
     var lname = document.getElementById('lname').val();
     var age = document.getElementById('age').val();
     /*Do not know how to get element by class and that too, two different type. Have to check if user chose anything or not*/
      $("#submit").click(function()
       if(fname.length === 0)
        alert("Please input a first name");
       else if(lname.length === 0)
        alert("Please input a last name");
       else if(age.length === 0)
        alert("Please input an age");

  • When the user press the button Calculate Tax (see attached doc) and click on Tax details then this should be updated automatically. But it does not work it is empty and the user has to update manually.

    When the user press the button Calculate Tax  and click on Tax details then this should be updated automatically. But it does not work it is empty and the user has to update manually.
    All setup looks fine.
    Please let me know what can be done on this?
    Regards,
    Peu

    HarryAustralia wrote:
    I recently updated my ipad wifi only to the new ios 6.1.2 and initially I had the auto cover lock option which can be seen in the Generals tab, but then it stoped working!! Before the update, the auto cover lock worked fine. So after trying all the options, I then did a complete reset on the ipad and now its gone all together from the General tab!! I can no longer see the "auto cover lock" option.
    The iPad cover lock is for when you use a cover with magnets in it to lock and unlock the iPad when you close the cover or open it. Try running a refrigerator magnet along the sides of the iPad and see if that trips the iPad Cover Lock back into the settings.
    That is not the same thing as the iPad Auto Lock setting which allows you to set an allotted time before the iPad goes to sleep.
    You can try resetting all settings to see if the Auto Lock feature retinrs to the iPad.
    Settings>General>Reset>Reset All Settings. You will have to enter all of your device settings again.... All of the settings in the settings app will have to be re-entered. This can be a little time consuming re-entering all of the device settings again.

  • I re- start my ipad2 into a new one,to update into i0s7, why it is not working of loading?

    I re- start my ipad2 into a new one,to update into i0s7, why it is not working of loading? please help!!!

    The [c:set|http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html] tag is used to set a scoped attribute not request parameter. So when you write
    <sql:param value="${param.userid}" />You get null as there is no parameter named userid in the request. Try this
    <sql:param value="${userid}" />I would recommend you not to do database connectivity stuff in JSP, JSPs are the view layer of an application and they aren't supposed to be for doing business logic. Also since you are using a random userid, you might end up with multiple users with the same ID and IDs are generally supposed to be unique...

  • Iphone 5.1 update messed up sound. Audio not working in youtube, music and video apps. Phone is not muted! nor is volume turned down

    Iphone 5.1 update messed up sound. Audio not working in youtube, music and video apps. Phone is not muted! nor is volume turned down

    Basics from the User Guide are restart, reset, restore from backup, restore as NEW.  Unless you've tried ALL of these, you're not done troubleshooting.

  • I have updating my Apple TV and now not working

    HI I have updating my Apple TV but now not working.
    what can i do?

    I also had the same issue - Apple TV is pointing to connect to iTunes - when I did it iTunes did not recognize the AppleTv - not sure what is the trouble here.

  • Unix Command install updates for 10.9 Mavericks does not work

    Unix Command install updates for 10.9 Mavericks does not work
    These commands no longer work with 10.9
    softwareupdate -i -a
    softwareupdate -d
    Are there new unix commands for 10.9 to install updates?

    Now that Safari 7.0.3 is out there is actually something to update, here is the results:
    SYSTEM2 (192.168.1.6)
    Software Update Tool
    Copyright 2002-2012 Apple Inc.
    Finding available software
    Downloading Safari
    Downloaded Safari
    Installing Safari
    Done with Safari
    Done.
    Get Info on the system shows:
    Modified: Today 10:15
    Version: 7.0.3, Copyright © 2003-2014 Apple Inc.
    Regards,
    Shawn

  • Field Exits are not working in ECC6

    Hi Friends,
    We upgraded our 4.6C system to ECC6 but after upgradation field exits are not working. What could be the reason.
    We are using GUI version-7.1 and SP-10,Release-6.
    Rewarded,
    Steve

    Hi there,
    Try this link ... it could help you.
    [http://www.sap-img.com/abap/field-exits-smod-cmod-questions-and-answers.htm|http://www.sap-img.com/abap/field-exits-smod-cmod-questions-and-answers.htm]
    If not, give an example.
    I did the same upgrade without problems.
    Best regards.
    Valter Oliveira.

  • I downloaded the latest firefox 4 and updated my file, firefox 4 will not work with my version of Mac OS X, how do I get my old firefox back?

    I downloaded the latest firefox 4 and updated my file, firefox 4 will not work with my version of Mac OS X, how do I get my old firefox back?

    You can get Firefox 3.6 from http://www.mozilla.com/en-US/firefox/all-older.html

  • I have updated ITunes and now it does not work

    I have updated ITunes and now it does not work. It worked before the update was installed, now it doesn't. I cannot un install it either...

    Use this application to uninstall iTunes and all related components
    http://support.microsoft.com/mats/program_install_and_uninstall/en-us

  • HT201401 cant watch any videos neither on safari nor on any video application, it used to work but after i updated to 5.1.1 its not working

    cant watch any videos neither on safari nor on any video application, it used to work but after i updated to 5.1.1 its not working, any help ?

    Hi..
    From your Safari menu bar click Safari > Preferences then select the Privacy tab.
    Click:  Remove All Website Data
    Now back to the menu bar, click Safari > Empty Cache
    Quit then relaunch Safari.
    Try one of the sites you had trouble accessing...

  • Hi I am using MAC OS Yosemite10.10.3 and I have a problem to update my photoshopCC cause of error U43M1D204 eventhough I have deleted AAm Updater/1.0/ but It still not worked.  How can I fix it.

    Hi, I am using MAc OS 10.10.3 and I have a problem to update my photoshopCC because of error U43M1D204.  I have deleted AAm Updater/1.0/ but it still not worked.  How can I fix it please help.

    I too have only recently encountered this problem. I have been able to burn disks before but it keeps making all these weird sounds. It might be a hardware problem but the fact that everything else that uses a disk works I doubt it.

  • Ok so I use an hdmi connector on my iPhone 4S to watch netflix. But after I updated to iOS 7 it will not work my tv doesn't receive a signal. Does anyone have any insure to this please help .!.!.

    Ok so I use an hdmi connector on my iPhone 4S to watch netflix. But after I updated to iOS 7 it will not work my tv doesn't receive a signal. Does anyone have any insure to this please help .!.!.

    The 8 pin Lightning connector can only output 720p and lacks all iPod Out functionality unlike the full iPod Out functionality and 1080p that the 30 pin connector has and I suspect that they are coding iOS 7 specifically for the new devices which have severely reduced abilities and perhaps skipping adding the code needed for 30 pin devices to use their functionality with HDMI, etc.

  • After i update my mobile sim card its not working i got message from apple to change the sim card and i cant change it please i want fix the problem

    after i update my mobile sim card its not working i got message from apple to change the sim card and i cant change it please i want fix the problem

    Yes, the message is self-explanatory. You need a carrier who supports Apple's activation policy for an iPhone.
    iPhone: Wireless carrier support and features - Support - Apple

  • HT204308 Did software update today and now iPhoto is not working.  I have OS X Yosemite 10.10.3

    Did software update today and now IPhoto is not working.  Operating system is OS X Yosemite 10.10.3

    What OS X version did you upgrade from? What iPhoto version did you have before upgrading? You cannot upgrade a version of iPhoto from a pre-10.10.2 OS X version installation. You needed iPhoto 9.6.1.

Maybe you are looking for

  • DB2Exception PLEASE HELP!!!!!!

    im facing a problem regarding with downloading of file... after i download my file from my database the file that i have generated is empty, i dnt know what else to do can someone help me with this problem. here's my code.. any help is greatly apprec

  • FCPX 10.0.6 - why is the files transcoded as .m4v instead of .mp4 ?

    Hi there, In 10.0.4, after clicking share, the files are transcoded im mp4 format. But now in FCPX 10.0.6 - why are the files transcoded as .m4v instead of .mp4 ? In both instances I selected Apple devices. I noticed both the filesize are about the s

  • Error in VO extension

    Hi, I have a requirement to extend a VO, i need to add 3 columns in the Select list of the Seeded VO Query. when i try to extend the VO in JDev(10g) using VO wizards, i m getting the following error - "Each Row in the query result columns must be map

  • Iphone as a broadband wireless card for laptop

    I'm interested to find out if we Iphone owners will be able to use it as a broadband device here we can't get Wi-Fi on our Laptops?

  • VF03 / Output type

    Step1      Transaction VF02 Step 2     Enter billing document number say N1 Step 3     Pricing conditions header (CtrlShifF9) Step 4     Output (Shift+F8) Step 5     Add new entry for N1 Step 6    Save (Ctrl+S) I have several billing documents N1, N2