Social Service Plan,
What is social service plan?
Technically, Social Service Plan (often called as "SSP") is another business transaction of one order frame work. Like typical SAP CRM transactions such as Service order, sales Order etc., SSP is also tightly integrated with SAP ECC system.
Whenever an SSP is created in SAP CRM system, the same will be replicated to ECC (PSCD) system as SXP through CRM middleware.
Social Service plan involves several phases as illustrated below.
Unlike other CRM transactions, several RFC calls will be made from CRM to ECC while performing Gross Entitlement Calculation, Gross Payment Determination, and Net Calculation and so on. System status plays vital role in controlling the entire process of SSP.
This article aims to provide guidance in creating SSP through ABAP program.
1. SSP CREATION.
We can create an SSP like a normal one order transaction, Use the FM “CRM_ORDER_MAINTAIN” to maintain the values in the buffer.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_partner = lt_partner
it_appointment = lt_appointment
it_status = lt_status
CHANGING
ct_orderadm_h = lt_orderadm_h
ct_orderadm_i = lt_orderadm_i
ct_input_fields = lt_input_fields
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
1. ELIGIBILITY DETERMINATION.
· Before doing any Eligibility determination do the eligibility check by setting the system S09S.
CALL FUNCTION 'CRM_STATUS_CHANGE_FOR_ACTIV_OW'
EXPORTING
objnr = lv_guid_head
vrgng = gc_process-ps_eligibility_det_check
iv_ref_kind = gc_object_kind-orderadm_h
iv_force_1o_maintain = abap_true
EXCEPTIONS
object_not_found = 2
status_inconsistent = 3
status_not_allowed = 4
OTHERS = 5.
· Set the System status S08S to do the eligibility determination.
CALL FUNCTION 'CRM_STATUS_CHANGE_FOR_ACTIV_OW'
EXPORTING
objnr = lv_guid_head
vrgng = gc_process-ps_eligibility_determination
iv_ref_kind = gc_object_kind-orderadm_h
iv_force_1o_maintain = abap_true
EXCEPTIONS
object_not_found = 2
status_inconsistent = 3
status_not_allowed = 4
OTHERS = 5.
· Already we have maintained the SSP item through order maintain, But that will not be available in PSCD system with the amount. To update the all the line item in SXP.
cl_crm_ps_4s_erp_api=>read_erpitem( EXPORTING is_erpitem_key = ls_key
IMPORTING es_erpitem = ls_item = et_message = lt_errors ).
· For updating the line item amount in PSCD.
cl_crm_ps_4s_erp_api=>update_erpitem( EXPORTING is_erpitem_key = is_erpitem = ls_item
IMPORTING et_message = lt_errors ).
2. ENTITLEMENT DETERMINATION
· During the entitlement determination the PSCD system will do the gross entitlement determination and entitlement calculation.
· To do the entitlement calculation in PSCD system
cl_crm_ps_4s_erp_api=>calculate_ge(
EXPORTING
iv_ssp_guid = lv_guid_head
IMPORTING
et_message = lt_messages
ev_success = lv_success
).
· For entitlement determination check in CRM system set the system status S09D.
CALL FUNCTION 'CRM_STATUS_CHANGE_FOR_ACTIV_OW'
EXPORTING
objnr = lv_guid_head
vrgng = 'S09D'
iv_ref_kind = 'A'
iv_no_1o_maintain = abap_true
EXCEPTIONS
object_not_found = 2
status_inconsistent = 3
status_not_allowed = 4
OTHERS = 5.
· For entitlement determination set the status S09S.
CALL FUNCTION 'CRM_STATUS_CHANGE_FOR_ACTIV_OW'
EXPORTING
objnr = lv_guid_head
vrgng = 'S09S'
iv_ref_kind = 'A'
iv_no_1o_maintain = abap_true
EXCEPTIONS
object_not_found = 2
status_inconsistent = 3
status_not_allowed = 4
OTHERS = 5.
3. Entitlement calculation.
· Entitlement calculation gross payment calculation will be happen in PSCD system.
CALL METHOD cl_crm_ps_4s_erp_api=>calculate_gp
EXPORTING
iv_ssp_guid = lv_guid_head
IMPORTING
et_message = lt_messages
ev_success = lv_success
ev_latest_date = lv_latest_date.
· For updating the gross payment details in SXP
cl_crm_ps_4s_erp_api=>read_erpheader( EXPORTING iv_btorder_guid = lv_guid_head
IMPORTING es_erpheader = lv_header_guid et_message = lt_errors
).
· Entitlement calculation in SAP CRM.
CALL FUNCTION 'CRM_STATUS_CHANGE_FOR_ACTIV_OW'
EXPORTING
objnr = lv_guid_head
vrgng = 'S03S'
iv_ref_kind = 'A'
iv_force_1o_maintain = abap_true
EXCEPTIONS
object_not_found = 2
status_inconsistent = 3
status_not_allowed = 4
OTHERS = 5.
4. Decision Assessment.
· Decision assessment will happen in SAP CRM. So just maintain the system status S04S.
CALL FUNCTION 'CRM_STATUS_CHANGE_FOR_ACTIV_OW'
EXPORTING
objnr = lv_guid_head
vrgng = 'S04S'
iv_ref_kind = 'A'
iv_force_1o_maintain = abap_true
EXCEPTIONS
object_not_found = 2
status_inconsistent = 3
status_not_allowed = 4
OTHERS = 5.
5. Finally the Approval.
· Once the approval is done all the calculation for the SSP is done, Net calculation document (NCD) will be created in PSCD. From the NCD only the payment will be determined.
CALL FUNCTION 'CRM_STATUS_CHANGE_FOR_ACTIV_OW'
EXPORTING
objnr = lv_guid_head
vrgng = 'FAPP'
iv_ref_kind = 'A'
iv_force_1o_maintain = abap_true
EXCEPTIONS
object_not_found = 2
status_inconsistent = 3
status_not_allowed = 4
OTHERS = 5.
6. Save the transaction.
· Save the SSP in CRM use the FM “CRM_ORDER_SAVE_OW”.
· To save the SXP in PSCD system.
cl_crm_ps_4s_erp_api=>save( EXPORTING iv_btorder_guid = ls_key-btorder_guid
IMPORTING ev_success = lv_success
et_message = lt_erp_error ).