cancel
Showing results for 
Search instead for 
Did you mean: 

How to use CRM_ISX_BTX_API_CONT_CHANGE?

Former Member

Anyone can tell me how to use FM CRM_ISX_BTX_API_CONT_CHANGE?

I want to change technical resource from an order.

Thank you

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Anyone can help me how to use FM CRM_ISX_BTX_API_CONT_CHANGE, example to Cancel a Provider Contract with Reason that inputed by user?

stefan_kiene
Advisor
Advisor
0 Kudos

Hi Agus,

your requirement can be accomplished by adding some more code into your/standard proces classes according to the following principle:


Taken from help.sap.com:

Change process: You have to setup the BTMF framework as required. You
have to define and implement the relevant BTMF process. A process capable to be
used by API has to assure, that all required input data is provided by
API-interface. For this purpose a generic collection of name value pairs is
available. This data is accessible from within process via a global data
container (BTMF container).

You need to:

  • Fill the required container values (e.g. the requested contract end date) before calling CRM_ISX_BTX_API_CONT_CHANGE e.g. like

    call method cl_crm_btmf_container=>set_container_value

      exporting

        item_guid = ir_api_data->gs_change_data-item_guid

        process   = ir_api_data->gs_change_data-process

        name      = <fs_process_attributes>-name

        value     = <value>.

  • Within your BTMF class you can access these parameters e.g. during the START() method allowing to pass the fields to your change order. The change order is automatically created by the change process framework before calling the start method.
    Doing so you have the option to fill the same values during start() or finish() methods of the process implementation class that would be captured on the screen while executing the process via the UI
    Example (for sure not complete from a business perspective):

* first wheter data is available in container - e.g. provided by mass run

    lv_contract_item = cl_crm_isx_order_info=>get_previous_item( lv_item ).

    " party

    cl_crm_btmf_container=>get_container_value(

                                                EXPORTING

                                                  item_guid = lv_contract_item

                                                  process = me->if_crm_btmf~process

                                                  name = me->gc_attrname_canc_party

                                                IMPORTING

                                                  value = ls_cancel-cancparty ).

    IF ls_cancel-cancparty IS INITIAL.

      ls_cancel-cancparty   = me->party. "use default value of class attribute

    ELSE.

      me->party = ls_cancel-cancparty. "set value of class attibute

    ENDIF.

    "procedure

    cl_crm_btmf_container=>get_container_value(

                                                EXPORTING

                                                  item_guid = lv_contract_item

                                                  process = me->if_crm_btmf~process

                                                  name = me->gc_attrname_canc_proc

                                                IMPORTING

                                                  value = ls_cancel-cancproc ).

    IF ls_cancel-cancproc IS INITIAL.

      ls_cancel-cancproc    = me->procedure.

    ELSE.

      me->procedure = ls_cancel-cancproc.

    ENDIF.

    "reason

    cl_crm_btmf_container=>get_container_value(

                                                 EXPORTING

                                                  item_guid = lv_contract_item

                                                  process = me->if_crm_btmf~process

                                                  name = me->gc_attrname_canc_reason

                                                 IMPORTING

                                                   value = ls_cancel-canc_reason ).

    IF ls_cancel-canc_reason IS INITIAL.

      ls_cancel-canc_reason = me->reason.

    ELSE.

      me->reason = ls_cancel-canc_reason.

    ENDIF.

    "mode

    ls_cancel-canc_mode   = gc_mode.

*       fill input fields

    ls_input_field-ref_guid       = lv_item.

    ls_input_field-ref_kind       = gc_object_kind-orderadm_i.

    ls_input_field-objectname     = gc_object_name-cancel.

    ls_input_field_name-fieldname = 'CANCPARTY'.

    INSERT ls_input_field_name INTO TABLE ls_input_field-field_names.

    ls_input_field_name-fieldname = 'CANCPROC'.

    INSERT ls_input_field_name INTO TABLE ls_input_field-field_names.

    ls_input_field_name-fieldname = 'CANC_REASON'.

    INSERT ls_input_field_name INTO TABLE ls_input_field-field_names.

    INSERT ls_input_field INTO TABLE lt_input_fields.

    INSERT ls_cancel INTO TABLE lt_cancel.

CALL FUNCTION 'CRM_ORDER_MAINTAIN'

      EXPORTING

        it_appointment    = lt_appointment

        it_cancel         = lt_cancel

        it_extension      = lt_extension

        it_status         = lt_status

      CHANGING

        ct_input_fields   = lt_input_fields

      EXCEPTIONS

        error_occurred    = 1

        document_locked   = 2

        no_change_allowed = 3

        no_authority      = 4

        OTHERS            = 5.

Best regards

Stefan

former_member196467
Active Contributor
0 Kudos

Hi Agus,

Am not familiar with this FM but can you please consider note 1851030 which mentions that you should import the relevant support package to get the documentation.

Or may be you have the right patch and can use the help button for the FM.

Best regards - Christophe

Former Member
0 Kudos

Hi Chris,

Thank you for your response. I already read the documentation, but I still confuse how to use this FM, especially field "PROCESS_ATTRIBUTES". Any other advice?

Below is the documentation:

FU CRM_ISX_BTX_API_CONT_CHANGE

____________________________________________________

Short Text

Remote Function Module for API "Contract Change"

Functionality

The provider Application Programming Interface (API) provides additional functionalities in provider order and contract maintenance in addition to the interaction center UI and back office. The main use cases are:

  • Order capturing in the pre-system, for example external CRM, mobile client, WebChannel

  • Migration

With this function module, you can execute a change process on a provider contract like in IC WebClient or back office.

Notes

Before you can execute a change process, maintain the following data in the system:

  • Define your change processes for BTMF Framework in customizing under Customer Relationship Management  -> Cross-Industry Functions -> Provider Order and Contract Management -> Transactions -> Define Provider-Contract-Specific Process Profiles

  • Implement the classes for these change processes

Parameters

IS_CHANGE_DATA
  IS_CONTROL
  ET_RETURN
  ES_CHANGE_ORDER

Exceptions

Function Group

CRM_ISX_BTX_API

IS_CHANGE_DATA

Data for Provider Contract Change RFC

Description

This Parameter with the structure CRMT_ISX_CONTRACT_CHANGE_RFC contains the following fields:

  • ITEM_GUID: item GUID for a provider contract.

  • PROCESS: name of the change process as defined in customizing for BTMF framework.

  • ACTIVATION_DATE: time stamp for activating the changes.

  • TIMEZONE: timezone for activation date.

  • PROCESS_ATTRIBUTES: table of name or value pairs for passing to process implementation.

Note

To get attribut values from the table PROCESS_ATTRIBUTES, you can call the following method in the process implementation:

cl_crm_btmf_container=>get_container_value( EXPORTING item_guid = <Contract Item GUID>  process = me->if_crm_btmf~process  name = <NAME> IMPORTING value = <VALUE>).
 

IS_CONTROL

Control Flags for Provider Contract Change API

Description

Control indicators are used to control the change process. For example, if the change order has to be saved to the database, you must set the Save and Commit indicators.

The control structure CRMT_ISX_CONTROL_CHANGE_API has the following indicators:

  • SAVE_ORDER: called to save the change order (test mode, if not requested).

  • RELEASE_ORDER:  releases the change order (BTMF method RELEASE is called).

  • COMMIT_AFTER_SAVE: called in the API. Choose this checkbox to save the changes to the database.

  • NO_INIT: check this field to keep the order in WebUI.

Note:

You can only save the order or contract to the database when the fields SAVE_ORDER and COMMIT_AFTER_SAVE are defined.

ET_RETURN

Table with BAPI Return Information

Description

This table includes the list of errors that come up during process execution.

ES_CHANGE_ORDER

Return Structure: Saved Objects

Description

This structure includes the GUID and the transaction ID of change order document.

former_member196467
Active Contributor
0 Kudos

Hi Agus,

I realize the FM is used in component CRM-IT-BTX which is the component for Telecommunications transactions.   Could you let me know the specific context and system in which you want to use this FM?

Thank you

Best regards - Christophe

Former Member
0 Kudos

Hi Chris,

Component version: EHP2 FOR SAP CRM 7.0

Component information:

Context: In provider contract, I create custom change process that is "Change Service Number".

Previously I use technical resource to save the number, and then I want to change the technical resource by "Change Service Number" change process.

I hope my explanation is clear enough.

Thank you

Regards - Agus Eryanta