BADI ORDER_SAVE

Hi,
Before saving an activity in CRM Web client we want to to some check of
input data. If the data is not right we do not want the user to be able
to save the activity. I have found a BADI for this that I think we
could use BADI: ORDER_SAVE. I can see that it already exists an
implementaion done by SAP for this BADI.
If I want to add code in method CHECK_BEFORE_SAVE should I then use
this implementation done by SAP or is it possible to create a new
implemenation for my changes and have two active implementations of the
same BADI?
Best Regards
Annika Alsé

Hi Annika
      Yes,you guys can create new one for activity and perform it when save activity.
      and you can set do_not_save parameter value to control if save it.
Best Regards,
Jason

Similar Messages

  • Message log is not getting deleted in WEBUI (BADI ORDER_SAVE)

    Hi,
    I am displaying an error message based on certain conditions in BADI: ORDER_SAVE (CHECK_BEFORE_SAVE). On getting error, I am correcting that error.
    Using CRM_MESSAGE_DELETE, I am deleting error message before displaying new error message. However, my error log is not going away. It is still displaying in the log in WEBUI.
    Could you please help me out, how can I delete error message, and error log from WEBUI.
    Thanks,
    Sandeep

    I  have the same question as you .
       I  have use folleing code to display message in web ui:
          if (conditions).
          CV_OWN_MESSAGE = 'X'.
          MESSAGE '商机描述已经存在,请修改后再保存!' type 'E' RAISING DO_NOT_SAVE .
        endif.
    but when i have edit the description , the Message log is not getting deleted in WEBUI .
    who can tell me , thanks for all your help !

  • Display error message in WEBUI using BADI - ORDER_SAVE-CHECK_BEFORE_SAVE

    Hi,
    I am trying to display error message using BADI - ORDER_SAVE (Method-CHECK_BEFORE_SAVE) based on certain conditions when the document is saved from WEB UI.
    I have written it like below:
    If (some conditions).
    Message E000 with 'Error in SAVE' RAISING DO_NOT_SAVE.
    endif.
    I mentioned my message class everything in class, and it is fine.
    However, it is not displaying my error message. It is displaying standard information message saying "Document Could not be saved'.
    Could you please help me out, how can I display my custom message.
    Thanks,
    Sandeep

    Hi Sandeep,
    U can use FM to raise a message from order save badi.
    Inside the if condition, u can raise do_not_save.
    If (some conditions)
          CALL FUNCTION 'CRM_MESSAGE_COLLECT'
            EXPORTING
              iv_caller_name = 'ORDERADM_H'
              iv_ref_object  = iv_guid
              iv_ref_kind    = 'A'
              iv_msgno       = '000'
              iv_msgid       = 'zcrm'
              iv_msgty       = 'A'
              iv_msgv1       = c_text1
              iv_msgv2       = c_text2
              iv_msgv3       = c_text3
            EXCEPTIONS
              not_found      = 1
              appl_log_error = 2
              OTHERS         = 3.
          IF sy-subrc NE 0.
          ENDIF.
          RAISE do_not_save.
    ENDIF.

  • Z_implementation of Badi ORDER_SAVE not showing up in WEB UI.

    Hi CRM Expert, I did a Z implementation of BADI ORDER_SAVE to auto populate the date , when status changes. The Status is llinkd to the Z_ Date type .We have al the Z_date types in the WEb UI.. but the code is not being triggered ..
    The code works fine in GUI but not in WEb UI.
    What could be the reason...???

    Hi ,
    Fetching the current Transaction GUID .
      CALL FUNCTION 'CRM_INTLAY_GET_HEADER_GUID'
        IMPORTING
          ev_header_guid = lv_ref_guid.
    Fetching the Process type for which the Badi will trigger .
      CALL FUNCTION 'CRM_INTLAY_GET_PROCESS_TYPE'
        EXPORTING
          iv_orderadm_h_guid  = lv_ref_guid
        IMPORTING
          ev_process_type     = lv_process_type
        EXCEPTIONS
          proc_type_not_found = 1
          OTHERS              = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    CHECK lv_ref_guid IS NOT INITIAL.
      CHECK lv_process_type EQ 'ZDL'.
    *Inserting the required fieldname for data into it_requested_objects.
      INSERT gc_object_name-orderadm_h
      INTO TABLE it_requested_objects.
      INSERT gc_object_name-status
      INTO TABLE it_requested_objects.
      INSERT gc_object_name-status_h
      INTO TABLE it_requested_objects.
      INSERT gc_object_name-appointment
      INTO TABLE it_requested_objects.
      INSERT lv_ref_guid INTO TABLE it_header_guid.
    Fetching all the Transaction relevent data using FM .
      CALL FUNCTION 'CRM_ORDER_READ'
        EXPORTING
          it_header_guid       = it_header_guid
          iv_only_spec_items   = true
          it_requested_objects = it_requested_objects
        IMPORTING
          et_orderadm_h        = it_orderadm_h
          et_status            = it_status
          et_status_h          = it_status_h
          et_appointment       = it_appointment
        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.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.
      READ TABLE it_orderadm_h INTO wa_orderadm_h INDEX 1.
      READ TABLE it_status INTO wa_status
      WITH KEY status = 'E0006'.
      IF sy-subrc = 0.
    Entering data for structure ls_input_fields
        ls_input_fields-ref_handle  = '0000000000'.
        ls_input_fields-ref_guid    = lv_ref_guid.
        ls_input_fields-ref_kind    = 'A'.
        ls_input_fields-objectname  = 'APPOINTMENT'.
        ls_input_fields-logical_key = 'ZMAINASSI'.
    *Entering data for deep structure
        ls_fielname-fieldname = 'DOMINANT'.
        INSERT ls_fielname INTO TABLE ls_input_fields-field_names.
        ls_fielname-fieldname = 'DURATION'.
        INSERT ls_fielname INTO TABLE ls_input_fields-field_names.
        ls_fielname-fieldname = 'RULE_NAME'.
        INSERT ls_fielname INTO TABLE ls_input_fields-field_names.
        ls_fielname-fieldname = 'SHOW_LOCAL'.
        INSERT ls_fielname INTO TABLE ls_input_fields-field_names.
        ls_fielname-fieldname = 'TIMESTAMP_FROM'.
        INSERT ls_fielname INTO TABLE ls_input_fields-field_names.
        ls_fielname-fieldname = 'TIMESTAMP_TO'.
        INSERT ls_fielname INTO TABLE ls_input_fields-field_names.
        ls_fielname-fieldname = 'TIMEZONE_FROM'.
        INSERT ls_fielname INTO TABLE ls_input_fields-field_names.
        ls_fielname-fieldname = 'TIMEZONE_TO'.
        INSERT ls_fielname INTO TABLE ls_input_fields-field_names.
        ls_fielname-fieldname = 'TIME_UNIT'.
        INSERT ls_fielname INTO TABLE ls_input_fields-field_names.
        INSERT ls_input_fields INTO TABLE lt_input_fields.
        GET TIME STAMP FIELD lv_timestamp.
    Entering new data for appointment table
        ls_appointment_com-ref_guid       = lv_ref_guid.
        ls_appointment_com-ref_kind       = 'A'.
        ls_appointment_com-timezone_from  = 'INDIA'.
        ls_appointment_com-timestamp_to   = '0'.
        ls_appointment_com-timezone_to    = 'INDIA'.
        ls_appointment_com-appt_type      = 'ZMAINASSI'.
        ls_appointment_com-timestamp_from = lv_timestamp.
        APPEND ls_appointment_com TO it_appointment_com .
    Now add the new date i.e.
        CALL FUNCTION 'CRM_APPT_MAINTAIN_SINGLE_OW'
          EXPORTING
            is_appointment_com     = ls_appointment_com
          CHANGING
            ct_input_fields        = lt_input_fields
          EXCEPTIONS
            precondition_violation = 1
            invariant_violation    = 2
            OTHERS                 = 3.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          EXIT.
        ENDIF.
      ENDIF.

  • Using BADI ORDER_SAVE to implement order split?

    I'm working in a CRM 4.0 system in which I need to create an order split based on sales organizations. My initial idea was to create an implementation of the BADI ORDER_SAVE in which I call the method CHANGE_BEFORE_UPDATE where I want to read the available sales order data and perform the split.
    The scenario could be that a sales order comes in from internet sales or is generated directly in CRM with one line from sales organization X and one from sales organization Y. I want to read the available line item data and split the order in two orders. One for each sales organization.
    I have been looking through the functions in function group CRM_ORDER_API and through the available methods for business object BUS2000115, but I cannot seem to find anything that works at the point in time where my BADI is called.
    In my system one order containing two different sales organizations will fail, so an alternative might be to have a batch job running that reads the failed orders after they have been saved in CRM and splits them according to my requirements using the function module CRM_ORDER_MAINTAIN.
    Would any of you CRM gurus have a suggestion to how I can implement the first scenario as I find this solution a bit more elegant than the second?
    Best regards,
    Anders

    Anders,
    Another approach is the following:  Save the order generated by ISA as a different document type from the target split order.  The next step is to use the SPPFCADM action configuration to build a scheduled action that is kicked off when your document is saved(I believe you can make the order save as a triggering condition).  Then in the new action class read the document determine whether it needs to be split and generate the subsequent sales documents as needed.
    The problem with splitting out the original document is that you lose track of the "logical" orginal order, and you face the issue of deleting the items from the original document.  The benefit of creating subsequent documents is that you maintain the document flow, and only have to create new orders which is much simpler.
    Good luck,
    Stephen

  • BADI ORDER_SAVE CHARM

    Dear all,
    I want to implement following:
    It exist a change request and the CR-Manager has approved it. Also a subsequent document as a copy of the CR exist (e.g. Normal Correction). Now, the CR-Manager change the priority in the CR-Document. In case of this, the priority of the subsequent document should also updated.
    Know my questions:
    - is the BADI ORDER_SAVE the right one?
    - which method should I use? (CHANGE_BEFORE_UPDATE, PREPARE, CHECK_BEFORE_SAVE)
    - Any experiences in using the BADI ORDER_SAVE_CHARM?
    Best regards
    Marc

    Hey Marc,
    Here the the answers to your queries ?
    Know my questions:
    1) is the BADI ORDER_SAVE the right one?
    Anand:Yes, there are other Badi's as well, but BADI order_save will also do.....
    2) which method should I use? (CHANGE_BEFORE_UPDATE, PREPARE, CHECK_BEFORE_SAVE)
    Anand: Use Prepare Method and update the follow up document by calling Appropiate FM.
    3) Any experiences in using the BADI ORDER_SAVE_CHARM?
    This Badi does not exit in my system... Which SP level you are on currently !!
    Inspire by rewarding !!
    Regards,
    Anand..

  • BADI or User Exit that executes after BADI ORDER_SAVE

    Hi.  I am trying to find a BADI or user-exit that occurs after the BADI ORDER_SAVE has executed completely and saved the values to database.  This is because ORDER_SAVE only gives the item GUID not the header GUID and it appears the header data is only created when the save has taken place.  I am trying to use the function CRM_ORDER_MAINTAIN but I need the header data to manipulate it.
    Thanx in advance
    Martin

    I will tell you four methods to find a BADI,
    Method 1. If you think that it is a simple requirement then got SE18 and click on F4 and Iformation Systems. In the short description enter the short text and search.
    Method2. Another simple method is to search with Package.
    Method3. Put a break point in the FM SXV_GET_CLIF_BY_NAME and then run your transaction---> your requirement may satisfy here after when you press the SAVE Button. There are two more BADIs that will be triggered in general.
    a) Before Update
    b) In Update.
    Method4. Put a break point in the class CL_EXITHANDLER for METHOD get_instance. and then run your transaction.
    Hope this material helps.
    Bhargav.

  • How to Change Schedule line Quantity in BADI 'ORDER_SAVE'

    Hi,
    I need to change the Schedule line quantity While Order saving. I am writing the code in ORDER_SAVE BADI. Using the Header guid i am reading the details and changing the quantity in Schedule line structure. How can i pass those values in to Memory so that order quantity will change. I try to Use CRM_ORDER_MAINTAIN but not able to change the quantity. Can an

    Hi,
    You need the One Order Function Module - CRM_ORDER_MAINTAIN to update the Schedule line value. So, you need to have a look at all the fields that are necessary to fill using the Tables and Structures. If you have the header guid, then you can probably pass the guid to CRM_ORDER_READ to read the values and then fill in the entries necessary to make the changes.
    You can also debug the order code to get a feel of the necessary changes.
    Hope this helps.
    Thanks,
    Samantak.

  • How to add sales office and sales group code in Badi Order_Save?

    Hi,
    i have a requirement .
    the concept is like this ,we have S>D>G lay out.
    initially the sales office and sales group were fetching  values from "G".
    But my requirement is the sales office and sales group should fetch values from "D"..when the transacion is "ZGRW"..
    This is in CRM platform...So how shud i assign values of D to sales office and sales area??
    how to code this...
    help me out
    Edited by: VARUN VADNALA on Jun 25, 2009 1:35 PM

    Hi Sangeeta,
    As per your statement, my understanding is that the Organization Attributes are not maintained in the Customization. If all the values are properly maintained then based on the Organization Data determination, the system would have picked up the data. You can first check the Organization Structure and see all the attributes are properly maintained or not and then check whether the Object Permitted in determination checkbox is checked. Then create a Transaction and see that all the Organization data are getting filled properly.
    Have a look at the following link for a complete guide to the Organization data determination customization.
    http://help.sap.com/saphelp_crm70/helpdata/en/6d/5c1738453fde16e10000009b38f8cf/frameset.htm
    If the Organization data customization is not meeting your requirements then you can have a second look at the development approach. Then we can have a look at the available Objects to get the desired functionality.
    Hope this helps.
    Thanks,
    Samantak.

  • How to update Sold-To Party (In ORDER_SAVE BADI)

    Hi,
    I have a requirement as follows:
    In for a Sales Order, In ORDER_SAVE BADI, I have to do validation for Sold-to Party. If validation fails, I need to display an error message and I need to clear the Sold-to Party field, hence user has to select another sold-to party.
    Could you please let me know, how can I clear the sold-to party, in ORDER_SAVE BadI. Any FM's to do that?
    Thanks,
    Sandeep

    Hello Sandeep,
    why you want to delete the sold-to ? I think its just easier to give a error message in the log, so the users  could enter a new sold-to. Within the badi order_save you can prvent saving with exception do_not_save  - see note 1519171 for detailed information.
    Best regards
    Rene

  • CRM_ORDER_MAINTAIN - in order_save BADI

    Hi Experts,
    I want to update my order. I have to add the account assignment group to my service order when the order is saved. How do I pass this value in the badi order_save. I want to use the function module crm_order_maintain. Can anyone please suggest how do I go about it.
    Warm Regards,
    Abdullah

    Hi Experts,
    This is how I code after I use CRM_ORDER_READ in the badi method change_before_update.
      select single *
        from zco003
        into wa_zco003
        where service_org_shor = v_sorg and
              process_type     = v_process_type.
      if sy-subrc = 0.
        iw_ac_assign-ref_guid = iv_guid.
        iw_ac_assign-ref_kind = 'A'.
        iw_ac_assign-ac_object_type = '01'.
        iw_ac_assign-ac_assignment = wa_zco003-aufnr.
        iw_ac_assign-ac_percentage = '0.00'.
        iw_ac_assign-mode = 'C'.
        append iw_ac_assign to it_ac_assign.
        cw_orderadm_h-guid = iv_guid.
        append cw_orderadm_h to ct_orderadm_h.
        cw_input_fields-ref_guid = iv_guid.
        cw_input_fields-ref_kind = 'A'.
        cw_input_fields-objectname = 'AC_ASSIGN'.
        cw_field_name-fieldname = 'AC_ASSIGNMENT'.
        cw_field_name-changeable = 'X'.
        append cw_field_name to ct_field_name.
        cw_field_name-fieldname = 'AC_OBJECT_TYPE'.
        cw_field_name-changeable = 'X'.
        append cw_field_name to ct_field_name.
        cw_field_name-fieldname = 'AC_PERCENTAGE'.
        cw_field_name-changeable = 'X'.
        append cw_field_name to ct_field_name.
        cw_field_name-fieldname = 'AC_TYPE_T'.
        cw_field_name-changeable = 'X'.
        append cw_field_name to ct_field_name.
        cw_field_name-fieldname = 'MODE'.
        cw_field_name-changeable = 'X'.
        append cw_field_name to ct_field_name.
        cw_input_fields-field_names[] = ct_field_name[].
        append cw_input_fields to ct_input_fields.
        loop at et_orderadm_i into ew_orderadm_i.
          clear cw_input_fields.
          cw_input_fields-ref_guid = ew_orderadm_i-guid.
          cw_input_fields-ref_kind = 'B'.
          cw_input_fields-objectname = 'AC_ASSIGN'.
          append cw_input_fields to ct_input_fields.
        endloop.
        clear cw_input_fields.
        cw_input_fields-ref_guid = iv_guid.
        cw_input_fields-ref_kind = 'A'.
        cw_input_fields-objectname = 'ORDERADM_H'.
        append cw_input_fields to ct_input_fields.
        loop at et_orderadm_i into ew_orderadm_i.
          cw_orderadm_i-guid = ew_orderadm_i-guid.
          append cw_orderadm_i to ct_orderadm_i.
          clear cw_orderadm_i.
        endloop.
        loop at et_orderadm_i into ew_orderadm_i.
          clear cw_input_fields.
          cw_input_fields-ref_guid = ew_orderadm_i-guid.
          cw_input_fields-ref_kind = 'B'.
          cw_input_fields-objectname = 'ORDERADM_I'.
          append cw_input_fields to ct_input_fields.
        endloop.
        call function 'CRM_ORDER_MAINTAIN'
         exporting
           it_ac_assign                  = it_ac_assign
         importing
           et_exception                  =  et_exception
         changing
    *       ct_orderadm_h                 = ct_orderadm_h
    *       ct_orderadm_i                 = ct_orderadm_i
           ct_input_fields               = ct_input_fields
           cv_log_handle                 = cv_log_handle
    *       ct_partner_attributes         =
    *       ct_doc_flow                   =
         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.
          message 'error in updating' type 'e'.
        endif.
    Can anyone please suggest what am I doing wrong
    Regards,
    Abdullah

  • Error while implemention ORDER_SAVE in CRM 2007

    Hi,
    At present we are experiencing an error while implementing badi ORDER_SAVE for sending CRM (2007)sales order data to PI (7.1) through ABAP proxy. In the BadI implementation we have created the Proxy Object through class (generated while defining the Proxy object in PI) and pass the SO details through the method available.
    Error ' Administration header not Found' while saving the CRM sales Order.
    Please let me know is any changes done in CRM 2007 for BadI implementation. Also suggest the best way to go forward to resolve this problem.
    Thanks & Regards
    Deb

    U can do it.. But what i suggest is.. create a Z Function Module that will trigger in background in seperate task by passing the GUID.
    In this Z FM write all your code related to the Proxy...

  • BaDI for quotation transaction in SAP CRM

    As per our business process, we need to release quotations from CRM to R/3. Before this is done, the partner functions on the quotation screen have to be updated with new number series.
    In order to prevent wrong release of quotations, we are develping a badi which would check all partners functions with respect to their required number series once user clicks on Save button.
    For this we are implementing badi ORDER_SAVE BUT in this there is one method CHECK_BEFORE_SAVE but in this only GUID is available so how can i check partner function(Sold to Party,Ship To Party) values which user has entered?.Or some other BADI is Available for this CAn anybody help me out.
    CRM Transaction Code is CRMD_BUS2000115.

    Hi Ravi,
    I worked on the same requirement but from a service perspective. So below are the activities I maintained to achieve this.
    1. Create a service order template type (copy of std).
    2. Maintain the copy control settings for both header and items to the service order quotation.
    3. Create Service Order Templates and enter the commonly used items in the template. Release the service order template.
    4. When creating a service order quote - at the item level, you can see the button "Copy from Template". Click on this
    5. This opens up a pop-up where in you can search for all released service order templates.
    6. Select the one you need, the items maintained in that order template is copied over to the service order quote.
    So the user does not need to enter all the items manually. This is how you user order templates. Please note that it copied only the items, not the header details of the service order template.
    Regards,
    Siraj

  • How to change the reason in a ICWC-followup-process with the copying-BAdI?

    Hi all,
    I want to use the followup- and docflow-functionality in ICWC to copy most of the information from one process to another.
    I made the definition of a copying control in the customizing -> working with a new BAdI and the copying routine. Everything works fine so far: I can get/change the description in the BAdIs ORDERADM_H method or the ibase information REFOBJ method for examples.
    The question is now how to get/change the reason of the process?
    Working with the genil_model_browser the reason is located in BTOrderHeader->BTHeaderBOSSet->BTSubjectSet_F->BTSubject_A1. Where can I find the reason in the BAdI methods?
    Thanks for your help.
    Regards,
    Benjamin

    Hi
    Put a break point in crm_order_maintain to see what structures and fields you need to fill out.  Then change the reason code in crm online, you will have all the data you need.
    Here is some code I used in the he badi order_save, method prepare.
      data:
        IV_REF_HANDLE     TYPE     CRMT_HANDLE,
        IV_REF_GUID     TYPE     CRMT_OBJECT_GUID,
        IV_REF_KIND     TYPE     CRMT_OBJECT_KIND,
        IS_SRV_OSSET_COM     TYPE     CRMT_SRV_OSSET_COM2,
        IT_SRV_REFOBJ_COM     TYPE     CRMT_SRV_REFOBJ_COMT,
        IT_SRV_SUBJECT_COM     TYPE     CRMT_SRV_SUBJECT_COMT,
        is_srv_subject_com type CRMT_SRV_SUBJECT_COM,
        ET_SRV_OSSET_COMT     TYPE     CRMT_SRV_OSSET_COMT,
        LT_SRV_OSSET_COMT     TYPE     CRMT_SRV_OSSET_COMT,
        ET_INPUT_FIELDS     TYPE      CRMT_INPUT_FIELD_TAB,
        ET_EXCEPTION TYPE  CRMT_EXCEPTION_T,
        tab_osset type CRMT_SRV_OSSET_COMT1,
        wa_osset like line of tab_osset,
        wa_srv like line of ET_SRV_OSSET_COMT,
        new_srv type CRMT_SRV_OSSET_COMT,
        call_list_name type char50,
        query_text(80).
      refresh: ET_INPUT_FIELDS,
                       IT_SRV_SUBJECT_COM.
              clear: is_srv_subject_com,
                     IS_SRV_OSSET_COM.
              IV_REF_KIND = 'A'.
              iv_ref_guid = iv_guid.
              IS_SRV_OSSET_COM-SUBJECT_PROFILE = 'Z00000002'.
              IS_SRV_OSSET_COM-PROFILE_TYPE = 'F'.
              is_srv_subject_com-ref_handle = '0000000002'.
              is_srv_subject_com-KATALOGART = 'A1'.
              is_srv_subject_com-CODEGRUPPE = 'Z0000002'.
              is_srv_subject_com-CODE = 'ZAA'.
              is_srv_subject_com-DEFQUANTITY = 0.
              is_srv_subject_com-MODE = 'A'.
              append is_srv_subject_com to IT_SRV_SUBJECT_COM.
              CALL FUNCTION 'CRM_SERVICE_OS_SET_DATA'
                EXPORTING
                  IV_REF_GUID        = iv_ref_guid
                  IV_REF_KIND        = 'A'
                  IS_SRV_OSSET_COM   = IS_SRV_OSSET_COM
                  IT_SRV_SUBJECT_COM = IT_SRV_SUBJECT_COM
                IMPORTING
                  ET_SRV_OSSET_COMT  = et_srv_osset_comt
                EXCEPTIONS
                  ERROR_OCCURRED     = 1
                  INVALID_GUID       = 2
                  NO_RECORD_EXIST    = 3
                  OTHERS             = 4.
              IF SY-SUBRC <> 0.
              ENDIF.
              CALL FUNCTION 'CRM_SERVICE_OS_PUT_DATA'
                IMPORTING
                  ET_SRV_OSSET_COM = et_srv_osset_comt
                  ET_INPUT_FIELDS  = ET_INPUT_FIELDS.
              read table LT_SRV_OSSET_COMT index 1 into wa_srv.
              if sy-subrc = 0.
                tab_osset[] = wa_SRV-osset[].
              endif.
              loop at ET_SRV_OSSET_COMT into wa_srv.
                append lines of tab_osset to wa_srv-osset.
              endloop.
              append wa_srv to new_srv.
            else.
              new_srv[] = LT_SRV_OSSET_COMT[].
            endif.
            CALL FUNCTION 'CRM_ORDER_MAINTAIN'
              EXPORTING
                IT_SERVICE_OS     = new_srv
              IMPORTING
                ET_EXCEPTION      = et_exception
              CHANGING
                CT_INPUT_FIELDS   = ET_INPUT_FIELDS
              EXCEPTIONS
                ERROR_OCCURRED    = 1
                DOCUMENT_LOCKED   = 2
                NO_CHANGE_ALLOWED = 3
                NO_AUTHORITY      = 4
                OTHERS            = 5.

  • BAdi while saving in CRM_DNO_MONITOR

    Hi Experts,
       In CRM_DNO_MONITOR  transaction, I am processing a ticket / transaction number. There when I save a ticket number
    I want to have some restrictions on the fields "Category"  and  "Ext.Reference.No.". Is there any BAdi to imply this
    while Saving. I am unable to find out. Kindly help me.
    Thanks and regards,
    Venkat.

    Hello Venkat,
    transaction CRM_DNO_MONITOR is just a report of CRM documents (ChaRM & SD on Solman). The transaction that you re actualling using in order to modify tickets is CRMD_ORDER.
    When saving a ticket CRMD_ORDER check if implementation of badi ORDER_SAVE exists.This Badi can be used in order to implement different checks and to cancel saving by raising error 'DO_NOT_SAVE'
    Hope this helps,
    Regards,
    Khalil

Maybe you are looking for