CRM_ORDER_MAINTAIN and ACTIVE_SWITCH

Hi experts,
I am working as ABAP developers in CRM 5.0. We often use FM CRM_ORDER_MAINTAIN in our development, to create (or modify) several order types.
I have heard about the ACTIVE_SWITCH input parameter of CRM_ORDER_MAINTAIN. It seems this parameter can optimize execution time, by avoiding some checks or determination (?).
As anyone ever used the ACTIVE SWITCH or is there any documentation about it?
I have searched on SDN forums and even on Google, but could not find anything about that...
Thank you in advance.

Hi Thomas!
Never give up)
Now seriously:
if you are reading large amouts of data (10,000 orders or more, for example)
then 2 things can help to do your program faster:
1. Read orders by 100-200 GUIDS per one 'CRM_ORDER_READ' call.
2. Periodically run FM 'CRM_ORDER_INITIALIZE' with IV_INIT_WHOLE_BUFFER = 'X' (this will initialize whole data buffer). For example, before every 'CRM_ORDER_READ' call. This will help because all readed data are being placed by CRM_ORDER functionality into standard internal tables, so you can see how slower & slower system works while reading large amounts of orders data without 'CRM_ORDER_INITIALIZE' call (in debugger).
3. Call 'CRM_ORDER_READ' with IV_NO_AUTH_CHECK = 'X' if you are really do not need authorization checks.
4. If possible do some SELECTs instead of CRM_ORDER_READ segment retreive.
5. And the last but not least: periodically see SAP notes for 'CRM_ORDER_READ performance' because this one got lots of bugs yet.
Hope it helps.
Best regards,
Alexander Kirillov

Similar Messages

  • Dump in COMMIT WORK after CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE in SalesOrd

    Hi Experts,
    I am updating dates in Sales Order using CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE .
    I am able to update two dates at the start of the program.
    But then in the middle of code if I try to update the dates it gives dump on COMMIT WORK, saying duplicate entry exists, though I am updating a different date in different field.
    If I execute the program again it does not give any dump and updates all status and dates successfully.
    Please help.
    Thanks in advance.
    Regards,
    Vikas

    Hi Vikas,
    Can you try this:
    Before you use CRM_ORDER_MAINTAIN can you call FM CRM_DATES_TIMECONTEXT_DELETE, and check the result?
    Kind regards,
    Bruno

  • Usage of CRM_ORDER_MAINTAIN SAP Help Link and Suggestions Required

    This is regarding CRM_ORDER_MAINTAIN fm
    Currently we are using function module crm_order_maintain outside Loop i.e calling once for all the contracts as sap crm performance standard ,
    Is there any standard documentation where we can find that states CRM_ORDER_MAINTAIN should be only used outside loop,
    As some are telling us to use in Loop Endloop because of timeout error in background job with contract having 180 line items,Which i feel that this create unneccessary load on execution (Not Recommendable)
    Please share any comments and suggestion this and also provide me the SAP Help Link on this

    Hi,
    for example to you, look for FM CRM_LRP_APPOINTMENTS_GET_DIAG which using CRM_ORDER_MAINTAIN and parameter  it_appointment.
    Hope this helps.
    Regards, Kostya Khveshchenik

  • Problem in CRM_ORDER_MAINTAIN

    Dear Gurus,
                      I am trying to create a service order using CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE.
    I have observed the values from debuggin the actual order creation through CRMD_ORDER and i am passing those hardcoded values to the above mentioned FMs.
    But in my case,the header is not generated saying header GUID is not found and thats why it is not creating any order also.can u please look into the code and tell me where m going wrong??
       CALL FUNCTION '/CEM/CREATE_GUID'
        IMPORTING
          EV_GUID       = guid
           wa_sales-ref_handle = 1.
           wa_sales-ref_guid = 0.
           wa_sales-ref_kind = 'B'.
           append wa_sales to it_sales.
           wa_pricing-ref_handle = 1.
           wa_pricing-ref_guid = 0.
           wa_pricing-ref_kind = 'B'.
           append wa_pricing to it_pricing.
           wa_shipping-ref_handle = 1.
           wa_shipping-ref_guid = 0.
           wa_shipping-ref_kind = 'B'.
           append wa_shipping to it_shipping.
           wa_product_i-ref_handle = 1.
           append wa_product_i to it_product_i.
           wa_schedlines-QUANTITY = 3.
           append wa_schedlines to schedlines.
           wa_schedlin_i-ref_handle = 1.
           wa_schedlin_i-SCHEDLINES = schedlines.
           append wa_schedlin_i to it_schedlin_i.
           wa_partner-REF_GUID = guid.
           wa_partner-ref_handle = 1.
           wa_partner-ref_kind = 'A'.
           wa_partner-REF_PARTNER_HANDLE = 0001.
           wa_partner-KIND_OF_ENTRY = 'C'.
           wa_partner-PARTNER_FCT = 00000001.
           wa_partner-PARTNER_NO = 0000000171.
           wa_partner-DISPLAY_TYPE = 'BP'.
           wa_partner-NO_TYPE = 'BP'.
           append wa_partner to it_partner.
           wa_partner-REF_GUID = guid.
           wa_partner-ref_handle = 2.
           wa_partner-ref_kind = 'A'.
           wa_partner-REF_PARTNER_HANDLE = 0002.
           wa_partner-KIND_OF_ENTRY = 'C'.
           wa_partner-PARTNER_FCT = 00000002.
           wa_partner-PARTNER_NO = 0000000171.
           wa_partner-DISPLAY_TYPE = 'BP'.
           wa_partner-NO_TYPE = 'BP'.
           append wa_partner to it_partner.
           wa_field_name-fieldname = 'MODE'.
           append wa_field_name to field_name.
           wa_field_name-fieldname = 'ORDERED_PROD'.
           append wa_field_name to field_name.
           wa_input_fields-ref_handle = 1.
           wa_input_fields-ref_guid = 0.
           wa_input_fields-objectname = 'ORDERADM_I'.
           wa_input_fields-FIELD_NAMES = field_name.
           append wa_input_fields to ct_input_fields.
          clear field_name.
          refresh field_name.
           wa_field_name-fieldname = 'DISPLAY_TYPE'.
           append wa_field_name to field_name.
           wa_field_name-fieldname = 'KIND_OF_ENTRY'.
           append wa_field_name to field_name.
           wa_field_name-fieldname = 'NO_TYPE'.
           append wa_field_name to field_name.
           wa_field_name-fieldname = 'PARTNER_FCT'.
           append wa_field_name to field_name.
           wa_field_name-fieldname = 'PARTNER_NO'.
           append wa_field_name to field_name.
           wa_input_fields-ref_handle = 2.
           wa_input_fields-ref_guid = guid.
           wa_input_fields-ref_kind = 'A'.
           wa_input_fields-objectname = 'PARTNER'.
           wa_input_fields-FIELD_NAMES = field_name.
           wa_input_fields-logical_key = 001.
           append wa_input_fields to ct_input_fields.
          clear field_name.
          refresh field_name.
           wa_field_name-fieldname = 'DISPLAY_TYPE'.
           append wa_field_name to field_name.
           wa_field_name-fieldname = 'KIND_OF_ENTRY'.
           append wa_field_name to field_name.
           wa_field_name-fieldname = 'NO_TYPE'.
           append wa_field_name to field_name.
           wa_field_name-fieldname = 'PARTNER_FCT'.
           append wa_field_name to field_name.
           wa_field_name-fieldname = 'PARTNER_NO'.
           append wa_field_name to field_name.
           wa_input_fields-ref_handle = 3.
           wa_input_fields-ref_guid = guid.
           wa_input_fields-ref_kind = 'A'.
           wa_input_fields-objectname = 'PARTNER'.
           wa_input_fields-FIELD_NAMES = field_name.
           wa_input_fields-logical_key = 002.
           append wa_input_fields to ct_input_fields.
           clear field_name.
          refresh field_name.
           wa_field_name-fieldname = 'LOGICAL_KEY'.
           append wa_field_name to field_name.
           wa_field_name-fieldname = 'QUANTITY'.
           append wa_field_name to field_name.
           wa_input_fields-ref_handle = 4.
           wa_input_fields-ref_guid = 0.
           wa_input_fields-ref_kind = 'B'.
           wa_input_fields-objectname = 'SCHEDLIN'.
           wa_input_fields-FIELD_NAMES = field_name.
           wa_input_fields-logical_key = 0.
           append wa_input_fields to ct_input_fields.
           clear field_name.
           refresh field_name.
           wa_input_fields-ref_handle = 5.
           wa_input_fields-ref_guid = 0.
           wa_input_fields-ref_kind = 'B'.
           wa_input_fields-objectname = 'SCHEDLIN_I'.
           wa_input_fields-FIELD_NAMES = field_name.
           append wa_input_fields to ct_input_fields.
           wa_orderadm_i-handle = 1.
           wa_orderadm_i-header = guid.
           wa_orderadm_i-ORDERED_PROD = 'ZSH_ADDON'.
           wa_orderadm_i-MODE = 'A'.
           append wa_orderadm_i to ct_orderadm_i.
              CALL FUNCTION 'CRM_ORDER_MAINTAIN'
            EXPORTING
              IT_OPPORT_H                   = IT_OPPORT_H
              IT_LEAD_H                     = IT_LEAD_H
              IT_ACTIVITY_H                 = IT_ACTIVITY_H
              IT_SALES                      = IT_SALES
              IT_PRICING                    = IT_PRICING
              IT_PRICING_I                  = IT_PRICING_I
              IT_PRIDOC                     = IT_PRIDOC
              IT_ORGMAN                     = IT_ORGMAN
              IT_SHIPPING                   = IT_SHIPPING
              IT_ACTIVITY_I                 = IT_ACTIVITY_I
              IT_PRODUCT_I                  = IT_PRODUCT_I
              IT_BATCH                      = IT_BATCH
              IT_FINPROD_I                  = IT_FINPROD_I
              IT_STRUCT_I                   = IT_STRUCT_I
              IT_CONFIG                     = IT_CONFIG
              IT_PAYPLAN                    = IT_PAYPLAN
              IT_PAYPLAN_D                  = IT_PAYPLAN_D
              IT_CUSTOMER_H                 = IT_CUSTOMER_H
              IT_CUSTOMER_I                 = IT_CUSTOMER_I
              IT_SERVICE_H                  = IT_SERVICE_H
              IT_SERVICE_I                  = IT_SERVICE_I
              IT_SERVICE_ASSIGN             = IT_SERVICE_ASSIGN
              IT_QUALIF                     = IT_QUALIF
              IT_APPOINTMENT                = IT_APPOINTMENT
              IT_TEXT                       = IT_TEXT
              IT_SCHEDLIN_I                 = IT_SCHEDLIN_I
              IT_PARTNER                    = IT_PARTNER
              IT_SERVICE_OS                 = IT_SERVICE_OS
              IT_REFOBJ                     = IT_REFOBJ
              IT_SUBJECT                    = IT_SUBJECT
              IT_CANCEL                     = IT_CANCEL
              IT_CANCEL_IR                  = IT_CANCEL_IR
              IT_CANCEL_DATES               = IT_CANCEL_DATES
              IT_STATUS                     = IT_STATUS
              IT_BILLPLAN                   = IT_BILLPLAN
              IT_BILLING                    = IT_BILLING
              IT_ORDPRP_I                   = IT_ORDPRP_I
              IT_ORDPRP_I_D                 = IT_ORDPRP_I_D
              IT_ORDPRP_OBJL_I_D            = IT_ORDPRP_OBJL_I_D
              IT_CUMULATED_I                = IT_CUMULATED_I
              IT_SERVICEPLAN_I              = IT_SERVICEPLAN_I
              IT_SERVICEPLAN_IE             = IT_SERVICEPLAN_IE
              IT_PRICE_AGREEMENTS_BBP       = IT_PRICE_AGREEMENTS_BBP
              IT_PRICE_AGREEMENTS_CRM       = IT_PRICE_AGREEMENTS_CRM
              IT_CONFIG_FILTER              = IT_CONFIG_FILTER
              IT_AC_ASSIGN                  = IT_AC_ASSIGN
              IT_SURVEY                     = IT_SURVEY
              IT_EXTENSION                  = IT_EXTENSION
              IT_ACTIVE_SWITCH              = IT_ACTIVE_SWITCH
              IT_UBB_CTR_I                  = IT_UBB_CTR_I
              IT_UBB_CR_I                   = IT_UBB_CR_I
              IT_UBB_VOL_I                  = IT_UBB_VOL_I
              IT_APO_I                      = IT_APO_I
              IT_CHNGPROC_I                 = IT_CHNGPROC_I
              IT_EXT_REF                    = IT_EXT_REF
              IT_DOC_FLOW_PNT               = IT_DOC_FLOW_PNT
              IT_CHNGPROC_H                 = IT_CHNGPROC_H
              IT_FUND_H                     = IT_FUND_H
              IT_CLA_H                      = IT_CLA_H
            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_PARTNER_ATTRIBUTES
              CT_DOC_FLOW                   = 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.
           ENDIF.
         read table ct_orderadm_i into wa_orderadm_i index 1.
           guid = wa_orderadm_i-header.
           wa_objects_to_save = guid.
           append wa_objects_to_save to it_objects_to_save.
           iv_update_task_local = 'X'.
           CALL FUNCTION 'CRM_ORDER_SAVE'
             EXPORTING
               IT_OBJECTS_TO_SAVE         = it_objects_to_save
              IV_UPDATE_TASK_LOCAL       = iv_update_task_local
             IV_SAVE_FRAME_LOG          = FALSE
             IV_NO_BDOC_SEND            = FALSE
            IMPORTING
              ET_SAVED_OBJECTS           = ET_SAVED_OBJECTS
              ET_EXCEPTION               =  ET_EXCEPTION
              ET_OBJECTS_NOT_SAVED       = ET_OBJECTS_NOT_SAVED
            CHANGING
              CV_LOG_HANDLE              =  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.
    commit work.
       CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT          =
        IMPORTING
          RETURN        =

    Hello Deepthee,
    I don't have code available here, but I builted before using this strategy:
    Put a session break-point to CRM_ORDER_MAINTAIN function.
    Then go to CRMD_ORDER transaction and make the change you want to reflect in your code. Press enter or save it.
    The session debug will be launched and you may observe the internal table associated (for example: IT_PARTNER or IT_PRODUCT_I) and the internal table for input fields.
    Observing that will help you to fill the necessary fields for your new document.
    If you face difficulties, write back with your code and I'll try to help you.
    Regards,
    Bruno

  • CRM_ORDER_MAINTAIN - Appointments

    Hi all
    A client is using the CRM interaction centre (trxn. CIC0). When a date is set in a transaction within CIC0, they want that date copied to all the follow up activities as well when the user saves.
    We've already used BADI ORDER_SAVE and FM's CRM_ORDER_READ, CRM_ORDER_MAINTAIN, and CRM_ORDER_SAVE to achieve this for some customer fields that were added in on a customer screen within CIC0 but cannot seem to achieve the same thing for the standard dates (appointments). When testing, the dates don't get copied through and don't appear on the Bdoc's (getting them onto the Bdoc's is the main priority).
    Any guidance from ABAP developer's experienced with this area of CRM would be greatly appreciated.
    The relevant coding from within the BADI is below:- (for ease of reading I've removed the coding going through the document flow and building up the internal table of GUID's that need to have the date maintained)
    METHOD if_ex_order_save~prepare .
    TYPES: BEGIN OF t_guids,
    guid TYPE crmt_doc_flow_wrk-objkey_a,
    END OF t_guids.
    * Header GUID's.
    DATA: lt_header_guid TYPE crmt_object_guid_tab,
    ls_header_guid TYPE crmt_object_guid,
    * Read appointments.
    lt_appointment_wrk TYPE crmt_appointment_wrkt,
    ls_appointment_wrk TYPE crmt_appointment_wrk,
    * Update appointments.
    lt_appointment_com TYPE crmt_appointment_comt,
    ls_appointment_com TYPE crmt_appointment_com,
    * GUID's
    lt_guids TYPE TABLE OF t_guids,
    ls_guids TYPE t_guids,
    * Update fields.
    ls_input_fields TYPE crmt_input_field,
    lt_input_fields TYPE crmt_input_field_tab,
    ls_input_field_names TYPE crmt_input_field_names,
    lt_input_field_names TYPE crmt_input_field_names_tab,
    * Order header data.
    lt_orderadm_h TYPE crmt_orderadm_h_comt,
    * Objects to be updated.
    lt_objects_to_save TYPE crmt_object_guid_tab,
    * Exceptions.
    lt_exception TYPE crmt_exception_t,
    * Updated documents.
    lt_saved_objects TYPE crmt_return_objects,
    lt_objects_not_saved TYPE crmt_object_guid_tab,
    * Local update task.
    lv_update_task_local TYPE boolean.
    * Use a global variable to ensure this method is only called once per user save.
    IF gv_first IS INITIAL.
    gv_first = 'X'.
    * Get the dates for the current activity.
    ls_header_guid = iv_guid.
    INSERT ls_header_guid INTO TABLE lt_header_guid.
    CALL FUNCTION 'CRM_ORDER_READ'
    EXPORTING
    it_header_guid = lt_header_guid
    IMPORTING
    et_appointment = lt_appointment_wrk
    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.
    EXIT.
    ENDIF.
    DELETE lt_appointment_wrk WHERE appt_type <> 'ZLSC00003'
    OR timestamp_from IS INITIAL.
    * Check if the conclusion date has been set (appointment type ZLSC00003).
    READ TABLE lt_appointment_wrk
    INTO ls_appointment_wrk
    WITH KEY appt_type = 'ZLSC00003'.
    IF sy-subrc = 0.
    * Coding removed here, build up the follow up GUID's from the document flow.
    * lt_header_guid now contains the parent GUID and the follow up activty GUID's
    * Get all of the date details for all of the documents.
    CALL FUNCTION 'CRM_ORDER_READ'
    EXPORTING
    it_header_guid = lt_header_guid
    IMPORTING
    et_appointment = lt_appointment_wrk
    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.
    EXIT.
    ENDIF.
    * Get rid of date entries which aren't conclusion dates or aren't the same conclusion date.
    DELETE lt_appointment_wrk WHERE appt_type <> 'ZLSC00003'
    OR timestamp_from <> ls_appointment_wrk-timestamp_from.
    * Process each of the documents and, if they don't have a conclusion date with the same value,
    * set up the internal tables to update the document.
    LOOP AT lt_header_guid INTO ls_header_guid.
    * Check if it has a conclusion date with the correct value already.
    READ TABLE lt_appointment_wrk
    WITH KEY ref_guid = ls_header_guid
    TRANSPORTING NO FIELDS.
    IF sy-subrc = 0.
    DELETE lt_header_guid.
    CONTINUE.
    ENDIF.
    * Set up the fields to be updated.
    CLEAR lt_input_field_names.
    ls_input_field_names-fieldname = 'REF_KIND'.
    INSERT ls_input_field_names INTO TABLE lt_input_field_names.
    ls_input_field_names-fieldname = 'APPT_TYPE'.
    INSERT ls_input_field_names INTO TABLE lt_input_field_names.
    ls_input_field_names-fieldname = 'TIMESTAMP_FROM'.
    INSERT ls_input_field_names INTO TABLE lt_input_field_names.
    ls_input_field_names-fieldname = 'TIMEZONE_FROM'.
    INSERT ls_input_field_names INTO TABLE lt_input_field_names.
    ls_input_field_names-fieldname = 'TIMESTAMP_TO'.
    INSERT ls_input_field_names INTO TABLE lt_input_field_names.
    ls_input_field_names-fieldname = 'TIMEZONE_TO'.
    INSERT ls_input_field_names INTO TABLE lt_input_field_names.
    ls_input_field_names-fieldname = 'TIME_UNIT'.
    INSERT ls_input_field_names INTO TABLE lt_input_field_names.
    ls_input_fields-ref_handle = '0000000000'.
    ls_input_fields-ref_guid = ls_header_guid.
    ls_input_fields-objectname = 'APPOINTMENT'.
    ls_input_fields-field_names = lt_input_field_names.
    INSERT ls_input_fields INTO TABLE lt_input_fields.
    * Set up the values for the fields to be updated.
    ls_appointment_com-ref_handle = '0000000000'.
    ls_appointment_com-ref_guid = ls_header_guid.
    ls_appointment_com-ref_kind = 'A'.
    ls_appointment_com-appt_type = 'ZLSC00003'.
    ls_appointment_com-timestamp_from = ls_appointment_wrk-timestamp_from.
    ls_appointment_com-timezone_from = ls_appointment_wrk-timezone_from.
    ls_appointment_com-timestamp_to = ls_appointment_wrk-timestamp_to.
    ls_appointment_com-timezone_to = ls_appointment_wrk-timezone_to.
    ls_appointment_com-time_unit = ls_appointment_wrk-time_unit.
    INSERT ls_appointment_com INTO TABLE lt_appointment_com.
    * Create an entry in the internal table used to determine which documents will be updated.
    INSERT ls_header_guid INTO TABLE lt_objects_to_save.
    ENDLOOP.
    * Change the values in the documents
    IF NOT lt_appointment_com IS INITIAL.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
    it_appointment = lt_appointment_com
    IMPORTING
    et_exception = lt_exception
    CHANGING
    ct_orderadm_h = lt_orderadm_h
    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 <> 0.
    EXIT.
    ENDIF.
    ENDIF.
    * Save the changed date values.
    IF NOT lt_objects_to_save IS INITIAL.
    CALL FUNCTION 'CRM_ORDER_SAVE'
    EXPORTING
    it_objects_to_save = lt_objects_to_save
    iv_update_task_local = lv_update_task_local
    IMPORTING
    et_saved_objects = lt_saved_objects
    et_exception = lt_exception
    et_objects_not_saved = lt_objects_not_saved
    EXCEPTIONS
    document_not_saved = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    ENDIF.
    ENDIF.
    CLEAR gv_first.
    ENDIF.
    ENDMETHOD.

    Hi All,
    I am currently trying to insert a date into DATE TYPE(APPT_TYPE) in Item Level. There are no errors in the code but the transaction is not updated. Can somebody help me out ? Thanx a lot...
    MOVE: gw_service_item_guid_ubb TO gw_appointment-       
          ref_guid,         
          'B' TO gw_appointment ref_kind,                         
          'CONTDISMAN' TO gw_appointment-appt_type,               
          '20060901220000' TO gw_appointment-timestamp_from,
          '20060901220000' TO gw_appointment-timestamp_to,
          'CET' TO gw_appointment-timezone_from,
          'CET' TO gw_appointment-timezone_to,
          'B' TO gw_appointment-mode.
    APPEND gw_appointment TO gt_appointment_ubb.
    gw_fname-fieldname = 'APPT_TYPE'.
    gw_fname-changeable = 'X'.
    insert gw_fname into table gt_fname.
    gw_fname-fieldname = 'TIMESTAMP_FROM'.
    gw_fname-changeable = 'X'.
    INSERT gw_fname INTO TABLE gt_fname.
    gw_fname-fieldname = 'TIMESTAMP_TO'.
    gw_fname-changeable = 'X'.
    INSERT gw_fname INTO TABLE gt_fname.
    gw_fname-fieldname = 'TIMEZONE_FROM'.
    gw_fname-changeable = 'X'.
    INSERT gw_fname INTO TABLE gt_fname.
    gw_fname-fieldname = 'TIMEZONE_TO'.
    gw_fname-changeable = 'X'.
    INSERT gw_fname INTO TABLE gt_fname.
    gw_input-ref_guid = gw_service_item_guid_ubb.
    gw_input-ref_kind = 'B'.
    gw_input-objectname = 'APPOINTMENT'.
    gw_input-logical_key = '0000'.
    gw_input-ref_handle = '0000000000'.
    gw_input-field_names = gt_fname.
    APPEND gw_input TO gt_input_fields.
    gw_item-guid = gw_service_item_guid_ubb.
    gw_item-header = '39CF8B702B8B334F90AF4B23CA991925'.
    gw_item-ITM_TYPE = gw_orderadm_i_ubb-itm_type.
    gw_item-mode = 'B'.
    APPEND gw_item TO gt_item.
    CALL FUNCTION 'DIALOG_SET_NO_DIALOG'.
    CALL FUNCTION 'CRM_ORDER_INITIALIZE'
      EXPORTING
        iv_initialize_whole_buffer = true
      EXCEPTIONS
        OTHERS           = 2.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
      EXPORTING
        it_appointment                = gt_appointment_ubb
        it_status                     = gt_status_maint
      CHANGING
        CT_ORDERADM_I                 = gt_item
        ct_input_fields               = gt_input_fields
    EXCEPTIONS
       error_occurred                = 1
       document_locked               = 2
       no_change_allowed             = 3
       no_authority                  = 4
       OTHERS                        = 5.
    CALL FUNCTION 'DIALOG_SET_WITH_DIALOG'.
    CALL FUNCTION 'CRM_ORDER_SAVE'
      EXPORTING
        it_objects_to_save   = gt_obj_guids
      IMPORTING
        et_saved_objects     = gt_saved_objects
        et_objects_not_saved = gt_objects_not_saved
      EXCEPTIONS
        document_not_saved   = 1
        OTHERS               = 2.
    IF sy-subrc EQ 0.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    ENDIF.
    COMMIT WORK.
    Useful help will be awarded. : )

  • CRM - CRM_ORDER_MAINTAIN - Appointments

    Hi all
      A client is using the CRM interaction centre (trxn. CIC0). When a date is set in a transaction within CIC0, they want that date copied to all the follow up activities as well when the user saves.
      We've already used BADI ORDER_SAVE and FM's CRM_ORDER_READ, CRM_ORDER_MAINTAIN, and CRM_ORDER_SAVE to achieve this for some customer fields that were added in on a customer screen within CIC0 but cannot seem to achieve the same thing for the standard dates (appointments). When testing, the dates don't get copied through and don't appear on the Bdoc's (getting them onto the Bdoc's is the main priority).
      Any guidance from ABAP developer's experienced with this area of CRM would be greatly appreciated.
      The relevant coding from within the BADI is below:- (for ease of reading I've removed the coding going through the document flow and building up the internal table of GUID's that need to have the date maintained)
    METHOD if_ex_order_save~prepare .
      TYPES: BEGIN OF t_guids,
               guid TYPE crmt_doc_flow_wrk-objkey_a,
             END OF t_guids.
    Header GUID's.
      DATA: lt_header_guid       TYPE crmt_object_guid_tab,
            ls_header_guid       TYPE crmt_object_guid,
    Read appointments.
            lt_appointment_wrk   TYPE crmt_appointment_wrkt,
            ls_appointment_wrk   TYPE crmt_appointment_wrk,
    Update appointments.
            lt_appointment_com   TYPE crmt_appointment_comt,
            ls_appointment_com   TYPE crmt_appointment_com,
    GUID's
            lt_guids             TYPE TABLE OF t_guids,
            ls_guids             TYPE t_guids,
    Update fields.
            ls_input_fields      TYPE crmt_input_field,
            lt_input_fields      TYPE crmt_input_field_tab,
            ls_input_field_names TYPE crmt_input_field_names,
            lt_input_field_names TYPE crmt_input_field_names_tab,
    Order header data.
            lt_orderadm_h        TYPE crmt_orderadm_h_comt,
    Objects to be updated.
            lt_objects_to_save   TYPE crmt_object_guid_tab,
    Exceptions.
            lt_exception         TYPE crmt_exception_t,
    Updated documents.
            lt_saved_objects     TYPE crmt_return_objects,
            lt_objects_not_saved TYPE crmt_object_guid_tab,
    Local update task.
            lv_update_task_local TYPE boolean.
    Use a global variable to ensure this method is only called once per user save.
      IF gv_first IS INITIAL.
        gv_first = 'X'.
    Get the dates for the current activity.
        ls_header_guid = iv_guid.
        INSERT ls_header_guid INTO TABLE lt_header_guid.
        CALL FUNCTION 'CRM_ORDER_READ'
          EXPORTING
            it_header_guid       = lt_header_guid
          IMPORTING
            et_appointment       = lt_appointment_wrk
          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.
          EXIT.
        ENDIF.
        DELETE lt_appointment_wrk WHERE appt_type      <> 'ZLSC00003'
                                     OR timestamp_from IS INITIAL.
    Check if the conclusion date has been set (appointment type ZLSC00003).
        READ TABLE lt_appointment_wrk
          INTO ls_appointment_wrk
          WITH KEY appt_type = 'ZLSC00003'.
        IF sy-subrc = 0.
    Coding removed here, build up the follow up GUID's from the document flow.
    lt_header_guid now contains the parent GUID and the follow up activty GUID's
    Get all of the date details for all of the documents.
          CALL FUNCTION 'CRM_ORDER_READ'
            EXPORTING
              it_header_guid       = lt_header_guid
            IMPORTING
              et_appointment       = lt_appointment_wrk
            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.
            EXIT.
          ENDIF.
    Get rid of date entries which aren't conclusion dates or aren't the same conclusion date.
          DELETE lt_appointment_wrk WHERE appt_type      <> 'ZLSC00003'
                                       OR timestamp_from <> ls_appointment_wrk-timestamp_from.
    Process each of the documents and, if they don't have a conclusion date with the same value,
    set up the internal tables to update the document.
          LOOP AT lt_header_guid INTO ls_header_guid.
    Check if it has a conclusion date with the correct value already.
            READ TABLE lt_appointment_wrk
              WITH KEY ref_guid = ls_header_guid
              TRANSPORTING NO FIELDS.
            IF sy-subrc = 0.
              DELETE lt_header_guid.
              CONTINUE.
            ENDIF.
    Set up the fields to be updated.
            CLEAR lt_input_field_names.
            ls_input_field_names-fieldname = 'REF_KIND'.
            INSERT ls_input_field_names INTO TABLE lt_input_field_names.
            ls_input_field_names-fieldname = 'APPT_TYPE'.
            INSERT ls_input_field_names INTO TABLE lt_input_field_names.
            ls_input_field_names-fieldname = 'TIMESTAMP_FROM'.
            INSERT ls_input_field_names INTO TABLE lt_input_field_names.
            ls_input_field_names-fieldname = 'TIMEZONE_FROM'.
            INSERT ls_input_field_names INTO TABLE lt_input_field_names.
            ls_input_field_names-fieldname = 'TIMESTAMP_TO'.
            INSERT ls_input_field_names INTO TABLE lt_input_field_names.
            ls_input_field_names-fieldname = 'TIMEZONE_TO'.
            INSERT ls_input_field_names INTO TABLE lt_input_field_names.
            ls_input_field_names-fieldname = 'TIME_UNIT'.
            INSERT ls_input_field_names INTO TABLE lt_input_field_names.
            ls_input_fields-ref_handle  = '0000000000'.
            ls_input_fields-ref_guid    = ls_header_guid.
            ls_input_fields-objectname  = 'APPOINTMENT'.
            ls_input_fields-field_names = lt_input_field_names.
            INSERT ls_input_fields INTO TABLE lt_input_fields.
    Set up the values for the fields to be updated.
            ls_appointment_com-ref_handle     = '0000000000'.
            ls_appointment_com-ref_guid       = ls_header_guid.
            ls_appointment_com-ref_kind       = 'A'.
            ls_appointment_com-appt_type      = 'ZLSC00003'.
            ls_appointment_com-timestamp_from = ls_appointment_wrk-timestamp_from.
            ls_appointment_com-timezone_from  = ls_appointment_wrk-timezone_from.
            ls_appointment_com-timestamp_to   = ls_appointment_wrk-timestamp_to.
            ls_appointment_com-timezone_to    = ls_appointment_wrk-timezone_to.
            ls_appointment_com-time_unit      = ls_appointment_wrk-time_unit.
            INSERT ls_appointment_com INTO TABLE lt_appointment_com.
    Create an entry in the internal table used to determine which documents will be updated.
            INSERT ls_header_guid INTO TABLE lt_objects_to_save.
          ENDLOOP.
    Change the values in the documents
          IF NOT lt_appointment_com IS INITIAL.
            CALL FUNCTION 'CRM_ORDER_MAINTAIN'
              EXPORTING
                it_appointment    = lt_appointment_com
              IMPORTING
                et_exception      = lt_exception
              CHANGING
                ct_orderadm_h     = lt_orderadm_h
                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 <> 0.
              EXIT.
            ENDIF.
          ENDIF.
    Save the changed date values.
          IF NOT lt_objects_to_save IS INITIAL.
            CALL FUNCTION 'CRM_ORDER_SAVE'
              EXPORTING
                it_objects_to_save   = lt_objects_to_save
                iv_update_task_local = lv_update_task_local
              IMPORTING
                et_saved_objects     = lt_saved_objects
                et_exception         = lt_exception
                et_objects_not_saved = lt_objects_not_saved
              EXCEPTIONS
                document_not_saved   = 1
                OTHERS               = 2.
            IF sy-subrc <> 0.
              EXIT.
            ENDIF.
          ENDIF.
        ENDIF.
        CLEAR gv_first.
      ENDIF.
    ENDMETHOD.

    Hello Mark,
    did you know that there is also a Forum for SAP CRM: Webclient UI - Framework?
    Regards
    Gregor

  • Adding item data in Product tab for sales contract (crm_order_maintain)

    Hi, can I use crm_order_maintain to add line items under the product tab for a sales contract while creating or modifying an order. Is there any sample code to add the line items, I could look at.  I tried calling this FM from my custom tab and then called CRM_ORDER_SAVE but that did not add the line item. I guess I need to call it from the order_save badi and then call the crm_order_save FM as well from within the BADI. If someone could send me some sample code then I can double check if I am missing something.Am I on the right track to be using this FM for adding a line item under the product tab for the sales contract? Please help. thanks

    Hi, I've encountered the same problem while I was creating a Sub-Contract from a Master Contract.
    In my case the solution was:
    first create the Sub-Contract,
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
          CHANGING
            ct_orderadm_h     = i_ctorderadm_h
            ct_input_fields   = i_ctinput_fields
            ct_doc_flow       = i_ctdoc_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.
        ENDIF.
        READ TABLE i_ctorderadm_h INTO wa_ctorderadm_h INDEX 1.
        APPEND wa_ctorderadm_h-guid TO i_objects_to_save.
    in wa_ctorderadm_h-guid now we have the guid of the newly created Sub-Contract.
    SELECT SINGLE it_type_to
                 INTO  v_it_type_to    " --> target item type
                 FROM  crmc_it_copy_ma
                 WHERE it_type_from = wa_out_orderadm_i-itm_type.
         Prepare tables
            wa_ctorderadm_i-header =
            wa_out_orderadm_i-header.   "Retrieved from CRM_ORDER_READ
            wa_ctorderadm_i-handle = '0000000001'.
            wa_ctorderadm_i-number_int = '0000000001'.
            wa_ctorderadm_i-product = wa_out_orderadm_i-product.
            wa_ctorderadm_i-ordered_prod =
            wa_out_orderadm_i-ordered_prod.
            wa_ctorderadm_i-description = wa_out_orderadm_i-description.
            wa_ctorderadm_i-itm_type = v_it_type_to.
            wa_ctorderadm_i-order_date   = sy-datum.
            wa_ctorderadm_i-itm_language = sy-langu.
            wa_ctorderadm_i-mode = c_a.   "c_a = 'A'
            wa_ctorderadm_i-header = wa_ctorderadm_h-guid.
            APPEND wa_ctorderadm_i TO i_ctorderadm_i.
            wa_input_fields-ref_handle = '0000000001'.
            wa_input_fields-objectname = 'ORDERADM_I'.
            REFRESH i_input_field_names.
            wa_input_field_names-fieldname = 'DESCRIPTION'.
            APPEND wa_input_field_names TO i_input_field_names.
            wa_input_field_names-fieldname = 'HEADER'.
            APPEND wa_input_field_names TO i_input_field_names.
            wa_input_field_names-fieldname = 'ITM_TYPE'.
            APPEND wa_input_field_names TO i_input_field_names.
            wa_input_field_names-fieldname = 'MODE'.
            APPEND wa_input_field_names TO i_input_field_names.
            wa_input_field_names-fieldname = 'NUMBER_INT'.
            APPEND wa_input_field_names TO i_input_field_names.
            wa_input_field_names-fieldname = 'ORDERED_PROD'.
            APPEND wa_input_field_names TO i_input_field_names.
            wa_input_field_names-fieldname = 'ORDER_DATE'.
            APPEND wa_input_field_names TO i_input_field_names.
            wa_input_field_names-fieldname = 'PRODUCT'.
            APPEND wa_input_field_names TO i_input_field_names.
            wa_input_fields-field_names = i_input_field_names.
            APPEND wa_input_fields TO i_ctinput_fields.
    After that I've called function 'CRM_ORDER_MAINTAIN', to copy the Items from the Master Contract.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
            EXPORTING
              it_sales          = i_sales
              it_schedlin_i     = i_schedlin_i
            CHANGING
              ct_orderadm_i     = i_ctorderadm_i
              ct_input_fields   = i_ctinput_fields
            EXCEPTIONS
              error_occurred    = 1
              document_locked   = 2
              no_change_allowed = 3
              no_authority      = 4
              OTHERS            = 5.
    Maybe if you're not working with Contracts, the procedure is not properly correct.
    I suggest to put a break-point into crm_order_maintain and try to add the Item manually.
    If you reproduce exactly the standard, I'm shure it will work.
    Lorenzo

  • Difference between Reports in normal ABAP and Reports in CRM

    Hi Experts,
    I am new to CRM. Can someone tell me the Difference between Reports in normal ABAP and Reports in CRM.
    It will be very useful if someone explains with example.
    Some where in SDN i read in CRM we should not select statment. Then how to fetch data?
    Please give me more basic concepts about CRM programming.
    Thanks,
    RAGU

    Hi Ragu,
    You can find much information at http://service.sap.com/crm-inst.
    Go to Installation & Upgrade Guides -> SAP Business Suite Applications -> SAP CRM
    Check the CRM version in which you are working and get the documents.
    FMs are specific to the requirement. Like all Business Partner related FMs generally start with BUPA* or BAPI_BUPA*.
    For CRM transaction data you can get info using FM CRM_ORDER_READ. To create a new transaction use CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE.
    More information can be fetched by surfing through the SDN threads and checking in SE37 t-code.
    Hope this helps!
    Regards,
    Saumya

  • CRM_ORDER_MAINTAIN not working

    Hi Expert !!!!!!
    I am using FM CRM_ORDER_MAINTAIN to create activity. I am not getting any error but activity fails to create.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
       EXPORTING
         it_activity_h                 = it_activity_h
         it_activity_i                 = it_mat_com
         it_product_i                  = it_product
         it_appointment                = it_appointment
         it_partner                    = it_partner_com
    *   IMPORTING
    *     ET_EXCEPTION                  = et_exception1
       CHANGING
         ct_orderadm_h                 = it_orderadm_h
         ct_orderadm_i                 = it_orderadm_i
       EXCEPTIONS
         error_occurred                = 1
         document_locked               = 2
         no_change_allowed             = 3
         no_authority                  = 4
         OTHERS                        = 5
      ls_objects_to_save = iv_guid.
      APPEND ls_objects_to_save TO lt_objects_to_save.
      CLEAR ls_objects_to_save.
      CALL FUNCTION 'CRM_ORDER_SAVE'
        EXPORTING
          it_objects_to_save = lt_objects_to_save
        IMPORTING
          et_saved_objects   = lt_saved_objects
          et_exception       = et_exception
        EXCEPTIONS
          document_not_saved = 1
          OTHERS             = 2.
      IF sy-subrc IS INITIAL.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
      ENDIF.
    both FM's  CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE are not throwing any exceptions.
    Regards,
    Rushikesh

    You have forgotten about CT_INPUT_FIELDS, which is used for informing which fields you want to maintain.
    Fill it also.
    Regards

  • CRM_ORDER_MAINTAIN problems

    Hello.
    I'm trying to insert new partner entries to the activity in a badi ORDER_SAVE (pf 00000026). How can I add these entries without loosing other entries with different partner functions?
    I have tried to call fm CRM_ORDER_MAINTAIN and I'm able to insert new entries by following logic introduced in test program CRM_TEST_ORDER_MAINTAIN. When calling this fm all other entries are deleted.
    What am I missing here?
    Br, Johannes
    Message was edited by: Johannes Mitronen

    Hello Frederic!
    Thank you for your answer. I finally managed to accomplish my goals. Other entries were deleted because I used an another fm with obviously wasn't the right one. Everything started to work when I also delete unwanted entries using fm CRM_ORDER_MAINTAIN.
    Here's how I do it (if somebody else is struggling with similar kind of problems):
    <b>1. Add new entries</b>
    LOOP AT lt_entries INTO ls_entries.
        ADD 1 TO counter.
        CLEAR ls_new_partners.
        ls_new_partners-ref_guid = ls_orderadm_h-guid.
        ls_new_partners-ref_kind = ls_entries-ref_kind. "A
        ls_new_partners-kind_of_entry = 'C'.
        ls_new_partners-ref_partner_handle = counter.
        ls_new_partners-partner_fct = ls_entries-partner_fct.
        ls_new_partners-partner_no  = ls_entries-partner.
        ls_new_partners-display_type = 'BP'.
        ls_new_partners-no_type = 'BP'.
        INSERT ls_new_partners INTO TABLE lt_new_partners.
        CLEAR ls_input_fields.
        REFRESH ls_input_fields-field_names.
        ls_input_fields-ref_guid  = ls_new_partners-ref_guid.
        ls_input_fields-ref_kind = ls_new_partners-ref_kind. "A
        ls_input_fields-objectname = 'PARTNER'.
        MOVE-CORRESPONDING ls_new_partners TO ls_logical_key.
        ls_input_fields-logical_key = ls_logical_key.
        ls_input_field_name-fieldname = 'PARTNER_FCT'.
        INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
        ls_input_field_name-fieldname = 'NO_TYPE'.
        INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
        ls_input_field_name-fieldname = 'DISPLAY_TYPE'.
        INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
        ls_input_field_name-fieldname = 'PARTNER_NO'.
        INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
        ls_input_field_name-fieldname = 'KIND_OF_ENTRY'.
        INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
        INSERT ls_input_fields INTO TABLE lt_input_fields.
      ENDLOOP.
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        EXPORTING
          it_partner        = lt_new_partners
        CHANGING
          ct_input_fields   = lt_input_fields
        EXCEPTIONS
          error_occurred    = 1
          document_locked   = 2
          no_change_allowed = 3
          no_authority      = 4
          OTHERS            = 5.
    <b>2. Delete entries</b>
    LOOP AT lt_partner INTO ls_partner.
          MOVE-CORRESPONDING ls_partner TO ls_new_partners.
    *     clear some fields for delete operation
          CLEAR ls_new_partners-ref_partner_handle.
          CLEAR ls_new_partners-partner_fct.
          INSERT ls_new_partners INTO TABLE lt_new_partners.
          CLEAR ls_input_fields.
          REFRESH ls_input_fields-field_names.
          ls_input_fields-ref_guid  = ls_new_partners-ref_guid.
          ls_input_fields-ref_kind = ls_new_partners-ref_kind.
          ls_input_fields-objectname = 'PARTNER'.
    *     create logical key for delete operation
          CONCATENATE '0000' ls_partner-partner_fct ls_partner-partner_no INTO ls_input_fields-logical_key.
          CONCATENATE ls_partner-ref_no_type ls_partner-ref_no_type INTO id.
          WRITE id TO ls_input_fields-logical_key+28.
          ls_input_field_name-fieldname = 'PARTNER_FCT'.
          INSERT ls_input_field_name INTO TABLE ls_input_fields-field_names.
          INSERT ls_input_fields INTO TABLE lt_input_fields.
        ENDLOOP.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        EXPORTING
          it_partner        = lt_new_partners
        CHANGING
          ct_input_fields   = lt_input_fields
        EXCEPTIONS
          error_occurred    = 1
          document_locked   = 2
          no_change_allowed = 3
          no_authority      = 4
          OTHERS            = 5.
    Enjoy!
    - Johannes

  • CRM_ORDER_MAINTAIN - Add Partners

    Dear Experts,
    I try to create the tasks with CRM_ORDER_MAINTAIN and was successful. However the Partners are not being updated properly. I have 2 partners for the task. Employee responsible & Sold-to-party. Though I debugged the tx: CRMD_ORDER & passed the right set of parameters, I could not find any success.
    Best Regards, Murugesh

    Hi,
    My requirement is as follows:
    I have to develop a FM which has transaction id, Ship to, Bill to and Payer as import parameters. For this transaction id I have to update the partners that I receive. I was using the FM CRM_ORDER_MAINTAIN but unsuccessfully. Looking forward for your help..
    Thanks in advance...
    Susanth Kumar

  • CRM_ORDER_MAINTAIN - parameter data discarded - where is this happening?

    Hello All,
    I'm having trouble with CRM_ORDER_MAINTAIN - many threads suggested break-pointing it while using the on-line transaction CRMD_ORDER and that has got me through a few problems.  However it's not a possible strategy for a few remaining issues.  It doesn't seem to me that CRM_ORDER_MAINTAIN provides any sort of return messages.  BAPI_BUSPROCESSND_CREATEMULTI calls this FM and has a returned Application Log handle, but that's coming back empty too.
    Does anyone know where I might set a break-point inside of CRM_ORDER_MAINTAIN to find out why some of my parameter data isn't posting?  Or does anyone know how to get return messages from this FM?
    Any help would be greatly appreciated.  Keith.

    Thanks Christoph.
    You are right about the PPF actions. I did not know what it was called until after I talked to my colleague who works with the solution manager system. After some more search, I found function module CRM_ORDER_POSTPROCESSING which I now call between CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE. The actions are then performed.
    Thanks for your input.
    Lande

  • Create orders in CRM with repetitive CRM_ORDER_MAINTAIN remote calls

    Dear All,
    Though we all must have done a lot of playing around with CRM but I am sure that a lot of us would find this as a tricky one. We know that CRM Web-UI framework at the back-end is actually a repetitive, Remote call framework to CRM APIs and SICFs.
    Now I have a requirement to create a sales order for example; I shall provide custom screens on HTML or UI5 and I have to provide a similar experience to user where in the user will add values to fields on the screen and press enter etc. Hence I will initially REMOTELY( Through custom RFC ) call CRM_ORDER_MAINTAIN and create a blank sales order( as done on crm ui framework ) and then on each subsequent enter I want to call CRM_ORDER_MAINTAIN FM with the guid I already have from first call.
    I will call ORDER_SAVE in the end only, to prevent wastage of memory. Also I want to avoid generating new GUIDS at each enter or round trip, hence want to continue with the guid/buffer values of the first call till the save.
    My doubt is in case I remotely call CRM_ORDER_MAINTAIN the second time with the GUID I got in the first call, will the system still have all those buffered values( order_header / guid ) of the first call in the second call or simply saying : will CRM_ORDER_MAINTAIN work in this case even if I pass the guid in subsequent calls?
    P.S : Please don't provide alternate solutions of saving on each enter / new guid generation on each enter.
    /Hasan

    Absolutely my dear friend, I am happy that someone is surely taking interest .
    We have long understood that a jazzy/intuitive UI is always welcomed over a slow/dull UI.
    Wasted guids is a case when you create a new transaction through MAINTAIN but then don't save it, then in the same session you again send a create command( for the same transaction ), new guids are requested from the system when you call MAINTAIN for header, items, partner links etc. and this cycle continues until you save.
    The best practice is not to waste this because a create has a lot of overheads over a change like : create new guids , create time checks etc. Hence CRM architecture is also based on a single create per transaction per session. CRM UI runs on a statefull HTTP session , which is the reason behind the buffers being retained even on repeated RFC/HTTP calls.
    /Hasan

  • How to set standart fields in SHIPPING and SALES tables in items?

    Hello SDN!
    I need to fill some standart fields in CT_SHIPPING and CT_SALES tables (sorry, I don't know their real names, written names used commonly in BADI) for items. I've got a BADI for header (extends IF_EX_CRM_ISA_BASKET_HEAD) and item (extends IF_EX_CRM_ISA_BASKET_ITEM) with methods CHANGEHEAD_BEFORE_ORDER and CHANGEITEMS_BEFORE_ORDER correspondenly. In these methods I try to fill required fields. These fields filled OK for header, but when I tried to fill fields for item it still saved to header. In these tables REF_KIND sets 'B' for item, REF_GUID also sets properly... Can anybody give rules for filling these fields? What main fields (such as REF_KIND) must be set and which values must they have?
    version of subject is CRM 5.0 SP 11
    Help will be appreciated.
    Regards, Lev
    Edited by: Lev Kulaev on Sep 8, 2008 9:24 AM
    give a version of CRM and give more detailed description of problem

    Hello Lev,
    Yes, if you have a "fully loaded" order - I mean some good order that has all the business data (such as shipping, sales ord, schedline etc. available. Usually an order that has been created in CRM or downloaded from R/3 should do to understand the data structures.
    To start with, just give the Transaction Number as the onl;y input and execute. And read through the output - each set (ET_SHIPPING) etc you are interested in. The several GUID and REF_GUID and REF_KINDs can be better understood with an example than me providing the explanation and code.
    An equivalent counterpart to this report program is the CRM_ORDER_READ, which does the same thing but does not let you play with the maintain part. CRM_ORDER_MAINTAIN program allows you to try the ipdate / change / maintain.
    Well here is the help text  for CRM_ORDER_MAINTAIN
    <h5>Short text</h5>
    Test program for function module CRM_ORDER_MAINTAIN
    <h5>Purpose</h5>
    This program replaces the missing option to execute a single test for the function module CRM_ORDER_MAINTAIN.
    The usual single test function in transaction SE37 is not possible as sorted tables are used as import parameters. The module RS_COMPLEX_OBJECT_EDIT used from Basis for maintaining import parameters is only able to process standard tables.
    <h5>Features</h5>
    The report executes a test call of the function module CRM_ORDER_MAINTAIN and displays the result (the export parameters).
    In addition, it is possible to
    <li>Save the changed data on the database,
    <li>Delete the buffer afterwards,
    <li>And, by calling CRM_ORDER_READ, to read it again.
    <h5>Selection</h5>
    <li>Specify the transaction number, the transaction GUID or the item GUID for changing an existing transaction.
    <li>Specify how many headers or items are to be created for creating new transactions or items.
    <li>Select "Subobject to be maintained" for the subobjects that you wish to change or enter.
    <li>After, enter "Maintain input values", and maintain the interface for CRM_ORDER_MAINTAIN. This means you make an entery for the IT_X_COM parameter for subobject X, and make the required entries in the CT_INPUT_FIELDS table.
    <li>If you wish to save and initialize after the change, specify this.
    <li>If the transaction should be re-read in the buffer afterwards, specify this.
    <h5>Standard Variants</h5>
    You can save your entries as a variant. All entered data is then stored under a GUID in the INDX table, and can be recovered again by calling this variant.
    <h5>Output</h5>
    The output parameter for CRM_ORDER_MAINTAIN and, if necessary, for CRM_ORDER_SAVE, CRM_ORDER_INITIALIZE and CRM_ORDER_READ are issued.
    Easwar Ram
    http://www.parxlns.com

  • CRMXIF_ORDER_SAVE_M and attachment links

    Hi Guys,
    I'm using LSMW to migrate business activities (BUS2000126) using idoc CRMXIF_ORDER_SAVE_M02 into CRM4.0 and have been struggling to link attachments to the business activity. The LSMW load creates the business activities but without the attachment. I've tried various ways of populating the segments E101CRMXIF_ATTACHMENT_LINK and E103CRMXIF_ATTACHMENT_LINK but to no avail and searches on OSS and SDN have not yielded any documentation and no idoc errors are generated. Can anyone help?
    Thanks,
      Pete

    Hello Peter,
    As I have never had to link attachments, the only thing I can suggest is a way to debug the standard.
    All the documents in CRM are created and changed by function CRM_ORDER_MAINTAIN. Also this IDoc uses this function inside its code.
    What I think that might be the problem is the way you are filling the parameters.
    So, to find out how to fill them, insert a break point inside function CRM_ORDER_MAINTAIN and link the attachment inside the standard transaction. Almost every time a change is made inside the standard transaction to create the activities, this function is called to manipulate only the last thing you changed.
    So you will be able to see wich tables the standard fills and how it is filling.
    I hope it works.
    Good luck!
    Regards,
    Mauricio

Maybe you are looking for

  • IPad 2 is acting crazy!

    Bought it in July 2012 and over the last month, the screen sensitivity has gradually gotten worse with these problems:  1.  When I type something on the touchscreen keyboard, it will either type too many letters (like 10 of them) after touching it on

  • How can I get CS4 tools to work in Open GL?

    Facts--Bought CS4--installed fine--problem noted with pop up that my video card needed upgrading--looked on Adobe site for suitable video cards, talked with Dell--installed nVidia G9500 which I was told should solve all problems--reinstalled PHOTOSHO

  • Dynamic NAT parameters

    Hi, I have an application that is unhappy running via dynamic NAT. The app developers are asking me if I can turn on sticky sessions in BM's dynamic NAT. Are there any options for tuning dynamic NAT in BM that could help? Cheers, Devon

  • MSI Registration for XPOWER mobo Grrrrrr !

    Hi all ...     Im stuck in a loop when trying to set up an account to register this Xpower motherboard....fill in all the details needed on completion says "wha heeey " your done, then when I try to do anything within my account it changes page then

  • No camera detected on OSX 10.8.5 running on MacBook Air 2013

    No camera detected after update to OSX 10.8.5  on MacBook Air 2013