CRM_REFOBJ_MAINTAIN_OW , CRM_SUBJECT_MAINTAIN_OW , CRMD_ORDER_MAINTAIN

Dear SAP Gurus,
I'm working with SAP CRM 7.0 and I'd need to understand where to put some code in order to otain the following thing:
When I'm creating a service order, I insert at header level a reference object and a multilevel categorization (for ex. REF001, CODE001) , then I insert an Item (using the autocomplete functionality)
I think the objects involoved are *REFOBJ and *SUBJECT_OS.
The reference object and the subject code inserted at header level (for ex. REF001, CODE001) are retrieved in the Item.
Now, after the insertion of the first Item, I need to specify at header level a different reference object & subject code (for ex. REF002, CODE002) and to insert a new Item.
The problem is that from the standard, the new reference object & subject code are replicated not only in the second Item, but also in the first one.
In which part of the CRMD_ORDER_MAINTAIN should I put ome code?
I've seen that the function modules CRM_REFOBJ_MAINTAIN_OW and CRM_SUBJECT_MAINTAIN_OW are involved, but I cannot find where to make the intervention.
Any suggestion?
Thanks and Regards,
Andrea Ricci

Hi,
You think of adding the reference objects first and then the item details. Or if you have an option to remove the reference of the 2nd reference object from the first item you may try that, however, its a standard functionality that the replication happens from header to item. Could you tell me which field at the item level stores the information about reference object? And does it store multiple reference objects?
Regards
Prasenjit

Similar Messages

  • Help with CRMD_ORDER_MAINTAIN

    HI all,
    I have a Z transaction based on CRMD_ORDER to manage the client and his contacts, when the user saves the changes made to to the ref_number and to the description i want to update those changes on the standard tables that the CRM_ORDER transaction uses. I can get the pos_number and the contact_number for the contact order to update it there
    Can anyone help me with some code on how to do it?
    Thanks in advance for any help given

    Thanks,
    i have done that and that code is kind of wierd. I also have another question, how do i know the process type ??
    I am trying to update the tables with the next piece of code, description is the variable that contains the new value that new_description should ahve in the standard CRMD_ORDER and new_p_contacto has the contact number where it should be updated at. I think in the code there is a guid created also
      ls_order_h-process_type = 'ZS01'.
      ls_order_h-mode = 'B'.
      ls_order_h-description = new_description.
      ls_order_h-descr_language = sy-langu.
      ls_order_h-object_id = new_p_contacto.
      ls_order_h-guid = guid_pos.
      ls_order_h-LOGICAL_SYSTEM = logical_key.
      INSERT ls_order_h INTO TABLE lt_order_h.
      ls_field-fieldname = 'DESCR_LANGUAGE'.
      INSERT ls_field INTO TABLE lt_field.
      ls_field-fieldname = 'DESCRIPTION'.
      INSERT ls_field INTO TABLE lt_field.
      ls_field-fieldname = 'MODE'.
      INSERT ls_field INTO TABLE lt_field.
      ls_field-fieldname = 'PROCESS_TYPE'.
      INSERT ls_field INTO TABLE lt_field.
      ls_input-ref_kind = 'B'.
      ls_input-objectname = 'ORDERADM_H'.
      ls_input-field_names = lt_field.
      INSERT ls_input INTO TABLE lt_input.
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        CHANGING
          ct_orderadm_h     = lt_order_h
          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.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                RAISING order_maintain_error.
      ENDIF.
      COMMIT WORK.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    What am i doing wrong? it is not updating my tables

  • Creation of Reference Object in Complaints

    Hi,
    I want to create Ibase component as reference object for Complaint . I debugged through the Order_maintain and tried to fill as like that.
    Please find the  code :
    DATA: lt_refobj_com TYPE  crmt_srv_refobj_comt.
    DATA: ls_refobj_com TYPE crmt_srv_refobj_com.
    DATA: lt_input_field  TYPE  crmt_input_field_tab.
    DATA: ls_input_field TYPE crmt_input_field.
    DATA: lt_field_names  TYPE crmt_input_field_names_tab.
    DATA: ls_field_names TYPE crmt_input_field_names.
    DATA: lt_service_os TYPE  crmt_srv_osset_comt,
          ls_service_os TYPE  crmt_srv_osset_com.
    DATA: lt_crmt_srv_osset_comt1 TYPE crmt_srv_osset_comt1,
          ls_crmt_srv_osset_com1 TYPE crmt_srv_osset_com1.
    DATA: lv_guid_16  TYPE  guid_16.
    **ls_refobj_com-ref_guid  =  '4C43086918AE56A9E1000000AC1447B6' .
    **ls_refobj_com-ref_kind  = 'A' .
    *ls_refobj_com-ib_instance = '566' .
    **ls_refobj_com-ext_refobj = '10000608'.
    **ls_refobj_com-profile_type = 'A'.
    *ls_refobj_com-product_id = '10000608'.
    **ls_refobj_com-guid =  '4C43086918AE56A9E1000000AC1447B6' .
    *ls_refobj_com-mode = 'A' .
    *APPEND ls_refobj_com TO lt_refobj_com.
    ls_service_os-ref_handle = '0000000000' .
    ls_service_os-ref_guid  =  '4C43086918AE56A9E1000000AC1447B6' . ....
    ls_service_os-ref_kind  = 'A' .
    *ls_service_os-mode = 'C' .
    ls_crmt_srv_osset_com1-ref_handle = '0000000000' .
    ls_crmt_srv_osset_com1-ref_guid = '4C4308AF18AE56A9E1000000AC1447B6'.........
    ls_crmt_srv_osset_com1-subject_profile = 'ZSRVCAL'.
    ls_crmt_srv_osset_com1-profile_type = 'A' .
    *ls_crmt_srv_osset_com1-mode = 'C' .
    CALL FUNCTION 'GUID_CREATE'   " *is it necessary? else what guid needs to giv here*
    IMPORTING
       ev_guid_16       = lv_guid_16
    *   EV_GUID_22       =
    *   EV_GUID_32       =
    ls_refobj_com-ref_handle = '0000000000' .
    ls_refobj_com-ref_guid  =  lv_guid_16 .  " 4C56A479560967D6E1000000AC1447B6' .
    *ls_refobj_com-ref_kind  = 'A' .
    ls_refobj_com-ib_instance = '566' .
    *ls_refobj_com-ext_refobj = '10000608'.
    *ls_refobj_com-profile_type = 'A'.
    *ls_refobj_com-product_id = '10000608'.
    *ls_refobj_com-guid =  '4C43086918AE56A9E1000000AC1447B6' .
    ls_refobj_com-mode = 'A' .
    ls_refobj_com-main_object = 'X' .
    APPEND ls_refobj_com TO lt_refobj_com.
    ls_crmt_srv_osset_com1-refobject  = lt_refobj_com.
    APPEND ls_crmt_srv_osset_com1 TO lt_crmt_srv_osset_comt1.
    ls_service_os-osset = lt_crmt_srv_osset_comt1.
    APPEND ls_service_os TO lt_service_os.
    ls_input_field-ref_handle = '0000000000' .
    ls_input_field-ref_guid   = '4C43086918AE56A9E1000000AC1447B6' .
    ls_input_field-ref_kind  = 'A' .
    ls_input_field-objectname = 'SERVICE_OS' .
    ls_field_names-fieldname = 'IB_INSTANCE' .
    APPEND ls_field_names TO lt_field_names.
    APPEND ls_input_field TO lt_input_field.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
      EXPORTING
        it_service_os   = lt_service_os
      CHANGING
        ct_input_fields = lt_input_field.
    *CALL FUNCTION 'CRM_REFOBJ_MAINTAIN_OW'
    *  EXPORTING
    *    it_refobj_com          = lt_refobj_com
    **   IV_EXTERNAL_CALL       = FALSE
    *  CHANGING
    *    ct_input_field         = lt_input_field
    ** EXCEPTIONS
    **   ERROR_OCCURRED         = 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.
    DATA: lt_obj TYPE crmt_object_guid_tab,
          lv_obj TYPE crmt_object_guid.
    lv_obj = '4C43086918AE56A9E1000000AC1447B6' .
    APPEND lv_obj TO lt_obj.
    CALL FUNCTION 'CRM_ORDER_SAVE'
      EXPORTING
        it_objects_to_save         = lt_obj
    *   IV_UPDATE_TASK_LOCAL       = FALSE
    *   IV_SAVE_FRAME_LOG          = FALSE
    *   IV_NO_BDOC_SEND            = FALSE
    *   IT_ACTIVE_SWITCH           =
    * IMPORTING
    *   ET_SAVED_OBJECTS           =
    *   ET_EXCEPTION               =
    *   ET_OBJECTS_NOT_SAVED       =
    * CHANGING
    *   CV_LOG_HANDLE              =
    * EXCEPTIONS
    *   DOCUMENT_NOT_SAVED         = 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.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    * EXPORTING
    *   WAIT          =
    * IMPORTING
    *   RETURN        =
    COMMIT WORK.
    Please let me know, where I made mistake?
    Sushant
    Edited by: Sushantbm on Aug 9, 2010 8:15 AM
    Edited by: Sushantbm on Aug 9, 2010 8:17 AM

    has anybody worked on adding referene objects to compliants programmatically?
    Thanks,
    Sushant

  • Getting an Error-Document is distributed while changing the status

    Hi Experts,
    The Scenario is to create a contract in CRM whose follow up document is call of order. When the Status under the general tab in the Contract changes to Approved, immediately the status of the follow up document (i.e. the Call of Order documents) should changed into an Approved state.
    I have implemented an immediate processing action for this but i am facing CRMD_ORDER_MAINTAIN and while executing the Error - 019 that 'Document cannot be saved as it is distributed'.
    Kindly Suggest me how to resolve the problem.

    Hi Shreeya,
    It is all because you are distributing your document (uploading document) to R/3.
    And system will not update the data till your document distribution is acknowledge successfully.
    Please try to fire the activity after some time to update the data in transaction,or may be you can use actions which would do all the activities prior to save and thus you will be able to achieve your scenario.
    If you need anymore details on how to proceed, plz breif me abt the scenario and post it back to me.
    Best Regards,
    Pratik Patel
    <b>Reward with Points!</b>

  • How to add attachments for Activity Header and for partners?

    Hi Consultants,
    I am new to CRM, My requirement is I have to add attachments as URL and File in activity or lead in Salespro. I have observed from CRMD_ORDER_MAINTAIN but no break-point triggers for this. I searched and found that cl_crm_documents->create_url or some methods in that. But it does not works for me.
    Any sample code expecting to reach my object.
    Thanks & Regards
    Mithuunn,

    Add attachment to Opportunity using Enterprise Services

  • Want to modify the partner in the fast entry tab of the trnx : crmd_order

    there r 4 partners in the fast entry tab.
    such as sold to party, ship to parth,
    service business partner and execution partner.
    in this i want to modify the execution partner with new value replacing the old one.
    i tried using crmd_order_maintain, but it only adds new partner in the transactino tab but not deleting the old one.
    if the execution partner field is blank then only it updates the execution partner with new one, otherwise it only adds the new execution partner in the transaction tab. leaving fast entry tab's execution partner unchanged...
    <b>ITS URGENT PLEASE... PLEASE HELP ASAP...</b>
    thanks in advance...
    sham deshmukh

    Hi,
    All these BP informations are stored in table CRMD_PARTER. So one way one is to Modify the table directly using MODIFY command. For that you need to understand table relationship between CRMD_ORDERADM_H CRMD_LINK and CRMD_PARTNER.
    Regards,
    Amit

  • Problem in copy routine while creating the follow up to Servcie Request

    Hi,
    I am creating Lead as follow up from Service Request. I have partner functiona called Reporter in Service Request. Now what ever the value is there in Reporter I need to copy it into Contact Person of Lead. However, I am not seeing any method to update the contact person in COPY ROUTINE BADI.
    Can you please help me.
    Thanks,
    Sandeep

    hello,  in the COPY ROUTINE BADI, you don't need the method special for partner.  You can set the parnter of new document by CRMD_ORDER_MAINTAIN.
    In the function, you only need the new document guid handle, and the partner guid which you want to set in the document, and partner type.

  • BAPI_OPPORTUNITY_CREATEMULTI - Partners problem

    Hello
    I am struggling with creation of opportunity with BAPI_OPPORTUNITY_CREATEMULTI.
    Can anyone give working example of implementation using input fields, header, opportunity and partner structures?
    I cannot create opp where partners would be filled.
    Regards
    Radek

    ok thank you, I used crmd_order_maintain to get right values.
    eg. structures for partner:
      ls_partner-ref_guid       = ls_header-guid.
      ls_partner-ref_handle       = '0000000001'.
      ls_partner-ref_kind       = 'A'.
      ls_partner-ref_partner_handle = '0001'.
      ls_partner-partner_no    = '0003000018'. "-> leading zeros
      ls_partner-partner_fct   = '00000021'.
      ls_partner-no_type       = 'BP'.
      ls_partner-display_type  = 'BP'.
      ls_partner-KIND_OF_ENTRY = 'C'.
      APPEND ls_partner to lt_partner.
    and for input fields:
    ls_input-REF_HANDLE = '0000000001'.
    ls_input-REF_GUID = ls_header-guid.
    ls_input-REF_KIND = 'A'.
    ls_input-OBJECTNAME = 'PARTNER'.
    ls_input-LOGICAL_KEY = '0001'.
    ls_input-FIELDNAME = 'PARTNER_NO'.
    APPEND ls_input to lt_input.
    ls_input-FIELDNAME = 'PARTNER_FCT'.
    APPEND ls_input to lt_input.
    ls_input-FIELDNAME = 'NO_TYPE'.
    APPEND ls_input to lt_input.
    ls_input-FIELDNAME = 'DISPLAY_TYPE'.
    APPEND ls_input to lt_input.
    ls_input-FIELDNAME = 'KIND_OF_ENTRY'.
    APPEND ls_input to lt_input.
    clear ls_input.
    Regards

  • Update only Actions in CRMD_ORDER for saving the updates

    Hi,
    i want to only save the action tab changes in the crmd_order and filter other changes when the order is saved
    or.
    disable all the input fields in the screen,  right now many fields in various tabs of Crmd_order is editable,  can any one guide me,  how to disable all the fields in the change mode.
    thanks & Regards
    DIneshsm

    hi,
    in the order_save badi i used the prepare method.  but,  how to use the crmd_order_maintain function module,  because,  i dont want any other changes except the action changes to get updated.
    how to procced can anyone explain.
    Thanks & Regards
    Dinesh

  • CRM_ORDER_MAINTAIN - Service_os

    Hi Friends,
    I have to update the result field in the Status scetion for the transaction code CRMD_ORDER.For this i am using FM CRMD_ORDER_MAINTAIN.
    In this i need to fill the service_os table.
    The result field is a combination of 3 fields.
    1. Catalog
    2. Code group.
    3. Code.
    I have the catalog & code with me. How do i find the respective code group for it.
    Thanks
    Kapil.

    Hi Friends,
    I have to update the result field in the Status scetion for the transaction code CRMD_ORDER.For this i am using FM CRMD_ORDER_MAINTAIN.
    In this i need to fill the service_os table.
    The result field is a combination of 3 fields.
    1. Catalog
    2. Code group.
    3. Code.
    I have the catalog & code with me. How do i find the respective code group for it.
    Thanks
    Kapil.

  • CRM Web Request : Setting XML data

    how to set the XML data (of fields, eg :- input box) in a business transaction that was created through a Web Request. I want to set it through a report.
    Is there any function module for the same ?
    Best Regards,
    Ashish Walke

    Hi,
    You can check with the FM CONVERT_XML_TO_SMOCOND here you can pass your XML and it will return you data in the table again which you can read and pass to the CRMD_ORDER_MAINTAIN which will fill the data into the tables and then again read it by FM CRMD_ORDER_READ to display the data.
    Reward if it helps.
    Thanks and regards
    Sandeep

Maybe you are looking for