on 04-14-2014 7:36 AM
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
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>.
* 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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
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:
Parameters
IS_CHANGE_DATA
IS_CONTROL
ET_RETURN
ES_CHANGE_ORDER
Exceptions
Function Group
CRM_ISX_BTX_API
Data for Provider Contract Change RFC
Description
This Parameter with the structure CRMT_ISX_CONTRACT_CHANGE_RFC contains the following fields:
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>).
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:
Note:
You can only save the order or contract to the database when the fields SAVE_ORDER and COMMIT_AFTER_SAVE are defined.
Table with BAPI Return Information
Description
This table includes the list of errors that come up during process execution.
Return Structure: Saved Objects
Description
This structure includes the GUID and the transaction ID of change order document.
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
User | Count |
---|---|
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.