SAP Service and Asset Manager Archives - ERP Q&A https://www.erpqna.com/category/sap-service-and-asset-manager/ Trending SAP Career News and Guidelines Tue, 05 Dec 2023 12:24:33 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.1 https://www.erpqna.com/wp-content/uploads/2021/11/cropped-erpqna-32x32.png SAP Service and Asset Manager Archives - ERP Q&A https://www.erpqna.com/category/sap-service-and-asset-manager/ 32 32 Influence Resource Related Billing through AVC (Advanced Variant Configuration) https://www.erpqna.com/influence-resource-related-billing-through-avc-advanced-variant-configuration/ Thu, 16 Nov 2023 09:11:03 +0000 https://www.erpqna.com/?p=79318 Overview: Resource Related billing is useful when the price for customer-specific services is not defined in a service contract as a fixed price and can’t be determined using standard pricing. One of the examples of such service could be consulting. In resource-related billing, the system creates dynamic items from the expenditure information on the service […]

The post Influence Resource Related Billing through AVC (Advanced Variant Configuration) appeared first on ERP Q&A.

]]>
Overview: Resource Related billing is useful when the price for customer-specific services is not defined in a service contract as a fixed price and can’t be determined using standard pricing. One of the examples of such service could be consulting.

In resource-related billing, the system creates dynamic items from the expenditure information on the service order. Here we will consider scenario of Itemized billing and summarized billing. They are identified with the billing relevance field attribute in the advanced execution order item.

Using AVC material, the billing can be influence through the pricing of the Advanced execution order Item (AEO) as a direct linkage between Price condition and variant characteristics can be established.

The statistical item billing (Summarized) is directly influenced by the variant characteristics whereas the dynamic item billing (Itemized) is indirectly Influenced by the main item variant characteristics.

Value Addition: In order to offer better transparency in billing process, this capability is offered from Service.

Process Flow:

Creation of DIP profile is not part of this blog. At first, the service order needs to be created with AVC material. Once released, the Plant maintenance order needs to be released and confirmation needs to be posted. Next step is to create Debit Memo Request through DP92 transaction and last step is to create Debit memo using the debit memo request.

Majorly below are the 3 steps to achieve this.

  1. Setting material with AVC characteristic.
  2. Set up the pricing for AVC characteristic in Service order.
  3. Setting Item categories for advanced execution order Item, DMR and DM

1. Setting the Material for AVC.

I am considering a scenario where one of the spare parts of an equipment requires troubleshoot. Hence I am taking the characteristic of this Service as Location based, hence the price for the troubleshooting job needs to be calculated based on location.

a) First we need to create some characteristics create the characteristics please use Transaction code CT04.

Similarly create second characteristics YCOND. This is the characteristics which will Influence the pricing condition directly.

As this characteristic needs to directly mapped to the pricing condition, let’s define the variant condition with Variant KEY T code :VK30.

Now We need to create the class and use the class in Material master. T code : CL02, choose class type as Variants(300). Class name ZCONF_AVC.

In the class, Open Characteristic tab and enter two characteristic which were created earlier.

Now we need to add dependencies to influence pricing on characteristics. Hence select the first condition and Click on the” Overwrite values” button.

It takes to the Change characteristic screen. Please choose “Editor “ from the “Extras” in menu bar.

add meaningful condition.

In my example, the price of the service is High if the location of the Service is Onsite.

$SELF.YCOND = ‘HIGH’ if YLOCATION = ‘ONSITE’.

Similarly add another condition for REMOTE.

$SELF.YCOND = ‘LOW’ if YLOCATION = ‘REMOTE’

Now the change the status of the class is “released”, class is ready to be used in Material Master for the desired Material.

Let’s configure the material in material master (MM01) for AVC. The AVC Material Needs to have Configurable material as checked.

In the classification tab of the material insert the variant class which was created in earlier steps.

Enter the Gen Item category group, in my case it is 0002 as in service order item category determination Configuration, this is being considered.

Next Step is to create the variant Profile, unless we assign the Profile to the material, the Service order Item would not get the configuration button on the web ui. T-Code CU41.

Have Chosen the priority as 00 as the highest priority and status needs to be set to “Released”.

2. Set up the pricing for avc characteristic in Service order

Next let’s identify the pricing procedure which needs to be used. Use Tcode OVKK.

In the pricing procedure, identify the condition record which will hold the price of the of the Variant condition needs to be added. For our example it is VA00.

We need to create price condition record for this material using the identified condition VA00. T-code VK11.

3. Setting Item categories for Service order, DMR and DM.

To set up service order Item category, please use below path.

Service-> Transactions-> Basic Settings-> Define Item Category Determination

For mapping between product and plant/task list and WorkCentre-T code: OISD

SPRO->Sales and Distribution->Sales->Sales Documents->Sales Document Item->Define Item Categories.

One item category for summarized billing and one for Itemized billing(Statistical ).

SPRO->Sales and Distribution->Sales->Sales Documents->Sales Document Item-> Assign Item Categories. Here item categories for debit memo request are assigned.

SPRO->Sales and Distribution-> Billing -> Billing Documents-> Copying Control for Billing Documents-> Maintain Copying Control for Billing Documents.

This is the copy control between Debit memo request and Debit memo.

Now, let’s use this product in a service order and explore how these variant characteristics are influencing pricing.

Create a service order with two advanced execution order items and configure those items.

Next item configuration.

Now release the service order to generate plant maintenance order. Once PM order is released (t code: Iw32) next step is to posting of confirmation.

Once the confirmation is posted, technical completion is needed for the PM orders.

Let’s execute the billing using transaction code DP92.

Let’s create the DMR for second item and verify the configuration and price condition.

Next step is to create debit memo for these items using VF01.

Once Debit memo is created, the configuration is captured and accessible.

We can see the respective configurations are present in item level in Debit memo.

Debit memo pricing is influenced by variant item condition. Also the configuration is captured in Debit memo.

Rating: 0 / 5 (0 votes)

The post Influence Resource Related Billing through AVC (Advanced Variant Configuration) appeared first on ERP Q&A.

]]>
Integration of SAP Service and Asset Manager (SAM) with SAP Field Service Management (FSM) using the FSM Cloud Connector (proaxia) https://www.erpqna.com/integration-of-sap-service-and-asset-manager-sam-with-sap-field-service-management-fsm-using-the-fsm-cloud-connector-proaxia/ Thu, 02 Mar 2023 10:08:52 +0000 https://www.erpqna.com/?p=72466 SAP Service and Asset Manager (SAM) Mobile Application integrates with SAP Field Service Management (FSM) as part of Field Service Technician persona using Proaxia connector. SAM integrates with SAP FSM planning board to set the current status of the Activity and the Technician location data. Also, updates Mileage and Expense related data captured from the […]

The post Integration of SAP Service and Asset Manager (SAM) with SAP Field Service Management (FSM) using the FSM Cloud Connector (proaxia) appeared first on ERP Q&A.

]]>
SAP Service and Asset Manager (SAM) Mobile Application integrates with SAP Field Service Management (FSM) as part of Field Service Technician persona using Proaxia connector. SAM integrates with SAP FSM planning board to set the current status of the Activity and the Technician location data. Also, updates Mileage and Expense related data captured from the SAM mobile application into FSM cloud system. As part of this Integration, SAM also supports FSM Smartforms and allows the SAM mobile application to download, modify and upload Smartforms assigned to an activity/operation.

Process flow for SAM Integration with FSM

SAP SAM integrated directly with SAP FSM using the Service and Data APIs provided by SAP FSM. However, the underlying objects that need to be updated, (e.g. Service Orders (Service Calls in FSM), Operations (Activities in FSM), Employees (Persons in FSM) are created by the Proaxia connector. Therefore, the following pre-requisites must be implemented for the end-to-end scenarios to work.

Prerequisites:

To execute the supported integration scenarios between SAP SAM and SAP FSM, the following prerequisites must to be met for the integration to work properly:

  1. Enable ‘External Id’ flag under FSM connector Company definition section.
  2. Implement BAdi methods to provide ID mapping between SAM & FSM.

Implementation Details:

The following sections will explain the details on how to implement these prerequisites.

Enable ‘External Id’ flag under FSM connector Company definition settings

From SAP backend system, use menu option of FSM Connector, Customizing –> Objects –> Company –> Company Definition (Transaction Code: /PACG/ECM_COMP).

FSM Connector Company Definition

By enabling the External Id flag, you can switch on sending the External Id from the FSM connector to FSM.

Enable External Id from FSM Connector settings

Implement BAdi methods to provide ID mapping between SAM & FSM:

Mobile Application Integration Framework (MAIF), which supports SAM backend integration features, provides different BAdi options to determine cross-referencing of key fields between FSM Connector and FSM Cloud system. The Badi /MERP/CA_FSM_CROSSREF_BADI is delivered for both ERP & S/4HANA system to support this feature with following interface methods.

BAdi Interface for FSM Id mapping

The following code samples are an example, you may need to make additional adjustments for your environment.

1. Add local method GET_COMPID to determine the FSM company Id. This method required for the GET_EMPLOYEE_IDS BADI method in Step2.

This method returns the following data:

Import Parameter: iv_account TYPE /pacg/ecm_cloudaccount.

Return Parameter: rv_compid TYPE /pacg/ecm_compid.

METHOD get_compid. 
 
    DATA: lv_string1    TYPE string, 
          lv_string2    TYPE string, 
          lv_account    TYPE string, 
          lv_fsmaccount TYPE /pacg/ecm_cloudaccount, 
          lv_fsmcompany TYPE /pacg/ecm_cloudid, 
          lv_compid     TYPE /pacg/ecm_compid, 
          ls_cacc       TYPE /pacg/ecm_cacc. 
 
    lv_account = iv_account. 
 
    SPLIT lv_account AT '&account=' INTO lv_string1 lv_string2. 
    SPLIT lv_string2 AT '&company=' INTO lv_string1 lv_string2. 
 
    lv_fsmaccount = lv_string1. 
    lv_fsmcompany = lv_string2. 
 
 
    ls_cacc = /pacg/ecm_cl_d_access=>get_cloudcomp_definition(  

iv_cloudaccount = lv_fsmaccount 
iv_cloudid      = lv_fsmcompany ). 
 
rv_compid = ls_cacc-compid. 
 
ENDMETHOD.

2. Implement BAdi method /MERP/IF_CA_FSM_CROSSREF_BADI~GET_EMPLOYEE_IDS:

This method is a prerequisite for saving geolocations captured from SAP SAM to the SAP FSM planning and scheduling board.The method must return the FSM internal Employee ID(s) (Field id of the Field Service Management Person entity) based on the personnel number(s) provided.Use the importing parameter IO_ACI_SERVICE to execute a service call to Field Service Management for retrieving the id based on the code in the following code example.

METHOD /merp/if_ca_fsm_crossref_badi~get_employee_ids. 
 
    TYPES: BEGIN OF ty_error, 
             error TYPE string, 
           END OF ty_error. 
 
    TYPES: BEGIN OF ty_fsmitem, 
             id         TYPE string, 
             externalid TYPE string, 
             username   TYPE string, 
           END OF ty_fsmitem. 
 
    TYPES: BEGIN OF ty_persondata, 
             person TYPE ty_fsmitem, 
           END OF ty_persondata. 
 
    DATA: 
      lv_pernr_query TYPE string, 
      ls_oblnk       TYPE /smfnd/sync_d_oblnk_h_upd_str, 
      lv_id          TYPE /smfnd/sync_object_key_dte, 
      lv_url         TYPE string, 
      lv_char_code   TYPE n LENGTH 3, 
      lt_persondata  TYPE STANDARD TABLE OF ty_persondata, 
      ls_persondata  LIKE LINE OF lt_persondata, 
      lt_error       TYPE STANDARD TABLE OF ty_error, 
      ls_error       LIKE LINE OF lt_error, 
      lv_status_code TYPE i, 
      lv_reason      TYPE string, 
      lv_result      TYPE string, 
      lv_raw_data    TYPE xstring, 
      lv_compid      TYPE /pacg/ecm_compid, 
      lv_cloud_uname TYPE /pacg/ecm_cloud_uname, 
      ls_pernr       LIKE LINE OF it_pernr. 
 
    TYPES: BEGIN OF ty_personresp, 
             data LIKE lt_persondata, 
           END OF ty_personresp. 
 
    DATA: ls_personresp TYPE ty_personresp. 
 
    IF io_aci_service IS BOUND. 
      IF it_pernr IS INITIAL. 
        RETURN. 
      ENDIF. 
 
      lv_compid = get_compid( iv_account ). 
 
      LOOP AT it_pernr INTO ls_pernr. 
 
        CLEAR lv_pernr_query. 
 
        IF ls_pernr-low IS NOT INITIAL. 
          TRY. 
              lv_cloud_uname = /pacg/ecm_cl_x_util=>build_cloud_uname( iv_pernr       = ls_pernr-low 
                                                                       iv_compid      = lv_compid ). 
            CATCH /pacg/ecm_cx_main. 
              "No FSM user exists 
              CONTINUE. 
          ENDTRY. 
          CONCATENATE lv_pernr_query 'externalId="' ls_pernr-low '"' INTO lv_pernr_query. 
        ENDIF. 
 
        IF lv_pernr_query IS NOT INITIAL. 
          CONCATENATE '/api/data/v4/Person?dtos=Person.24' '&query=' lv_pernr_query 
                     '&fields=id,externalId,userName' iv_account INTO lv_url. 
 
          CALL METHOD io_aci_service->call_service 
            EXPORTING 
              iv_request_uri    = lv_url 
              iv_request_method = 'GET' 
              it_headers        = it_headers 
            IMPORTING 
              ev_status_code    = lv_status_code 
              ev_reason         = lv_reason 
              ev_result         = lv_result 
              ev_raw_data       = lv_raw_data. 
 
          lv_char_code = lv_status_code. 
          IF lv_char_code CP '4*'. 
            ls_error-error = lv_result. 
            APPEND ls_error TO lt_error. 
          ELSE. 
            /aci/cl_util_json_handler=>deserialize(  EXPORTING json =  lv_result 
                                                     CHANGING  data =  ls_personresp  ). 
            LOOP AT ls_personresp-data INTO ls_persondata. 
              lv_id = ls_persondata-person-id. 
              ls_oblnk-object_type  = 'EMPLOYEE'. 
              ls_oblnk-object_key  = ls_pernr-low. 
              ls_oblnk-ext_object_type  = 'PERSON'. 
              ls_oblnk-ext_object_key  = lv_id. 
              ls_oblnk-sys_comp = 'SAP_FSM'. 
              ls_oblnk-mobile_app = iv_mapp. 
              APPEND ls_oblnk TO et_oblnk. 
              CLEAR ls_oblnk. 
            ENDLOOP. 
          ENDIF. 
        ENDIF. 
      ENDLOOP. 
    ENDIF. 
  ENDMETHOD.

3. Implement the method /MERP/IF_CA_FSM_CROSSREF_BADI~GET_ACTIVITY_ID:

This method is a prerequisite for implementing the relevant status updates from SAP SAM to the SAP FSM planning and scheduling board. This method must return the Field Service Management internal activity ID (the id field of the Field Service Management Activity entity) based on the order and operation number provided.

Use the importing parameter IO_ACI_SERVICE to execute a service call to Field Service Management for retrieving the ID based on the code. See the following code example for more details.

METHOD /merp/if_ca_fsm_crossref_badi~get_activity_id. 
 
    TYPES: BEGIN OF ty_fsmitem, 
             id         TYPE string, 
             externalid TYPE string, 
           END OF ty_fsmitem. 
 
    TYPES: BEGIN OF ty_error, 
             error TYPE string, 
           END OF ty_error. 
 
    TYPES: BEGIN OF ty_actdata, 
             activity TYPE ty_fsmitem, 
           END OF ty_actdata. 
 
    DATA: 
      lv_act_query   TYPE string, 
      lv_id          TYPE /smfnd/sync_object_key_dte, 
      lv_url         TYPE string, 
      lv_char_code   TYPE n LENGTH 3, 
      lt_actnr       TYPE STANDARD TABLE OF /pacg/ecm_actnr, 
      lv_actnr       TYPE /pacg/ecm_actnr, 
      lv_object_key  TYPE /smfnd/sync_object_key_dte, 
      lt_error       TYPE STANDARD TABLE OF ty_error, 
      ls_error       LIKE LINE OF lt_error, 
      lt_actdata     TYPE STANDARD TABLE OF ty_actdata, 
      ls_actdata     LIKE LINE OF lt_actdata, 
      lv_status_code TYPE i, 
      lv_reason      TYPE string, 
      lv_result      TYPE string, 
      lv_raw_data    TYPE xstring, 
      lv_aufnr_len   TYPE i, 
      lo_descr       TYPE REF TO cl_abap_elemdescr, 
      ls_aufnr_dfies TYPE dfies. 
 
    TYPES: BEGIN OF ty_actresp, 
             data LIKE lt_actdata, 
           END OF ty_actresp. 
 
    DATA: ls_actresp TYPE ty_actresp. 
 
    IF io_aci_service IS BOUND. 
      IF iv_aufnr IS INITIAL OR iv_vornr IS INITIAL. 
        RETURN. 
      ENDIF. 
 
      lv_object_key = iv_aufnr. 
      lo_descr ?= cl_abap_elemdescr=>describe_by_data( iv_aufnr ). 
      ls_aufnr_dfies = lo_descr->get_ddic_field( ). 
      lv_aufnr_len = ls_aufnr_dfies-leng. 
      lv_object_key+lv_aufnr_len = iv_vornr. 
 
      "Get all activitties for order operation 
      SELECT actnr INTO TABLE lt_actnr FROM /pacg/ecm_acti WHERE aufnr = iv_aufnr AND vornr = iv_vornr. 
 
      "Get the newest activity 
      SORT lt_actnr DESCENDING. 
      READ TABLE lt_actnr INTO lv_actnr INDEX 1. 
      IF sy-subrc IS NOT INITIAL. 
        RETURN. 
      ENDIF. 
 
      CONCATENATE lv_act_query 'externalId="' lv_actnr '"' INTO lv_act_query. 
 
      IF lv_actnr IS NOT INITIAL. 
        CONCATENATE '/api/data/v4/Activity?dtos=Activity.39' '&query=' lv_act_query '&fields=id,externalId' iv_account INTO lv_url. 
 
        CALL METHOD io_aci_service->call_service 
          EXPORTING 
            iv_request_uri    = lv_url 
            iv_request_method = 'GET' 
            it_headers        = it_headers 
          IMPORTING 
            ev_status_code    = lv_status_code 
            ev_reason         = lv_reason 
            ev_result         = lv_result 
            ev_raw_data       = lv_raw_data. 
 
        lv_char_code = lv_status_code. 
        IF lv_char_code CP '4*'. 
          ls_error-error = lv_result. 
          APPEND ls_error TO lt_error. 
        ELSE. 
          /aci/cl_util_json_handler=>deserialize(  EXPORTING json =  lv_result 
                                                   CHANGING  data =  ls_actresp  ). 
          LOOP AT ls_actresp-data INTO ls_actdata. 
            lv_id = ls_actdata-activity-id. 
            es_oblnk-object_type  = 'OPERATION'. 
            es_oblnk-object_key  = lv_object_key. 
            es_oblnk-ext_object_type  = 'ACTIVITY'. 
            es_oblnk-ext_object_key  = lv_id. 
            es_oblnk-sys_comp = 'SAP_FSM'. 
            es_oblnk-mobile_app = iv_mapp. 

      ev_id = ls_actdata-activity-id. 
            EXIT. 
          ENDLOOP. 
        ENDIF. 
      ENDIF. 
    ENDIF. 
 
  ENDMETHOD.

4. Implement the method /MERP/IF_CA_FSM_CROSSREF_BADI~GET_SERV_ASSIGN_ID:

This method is a prerequisite for implementing relevant status updates from SAP SAM to the SAP FSM planning and scheduling board. The method must return the FSM internal activity ID (the idfield of the Field Service Management Activity entry) based on the order and operation number provided.Use the QUERY_FSM_SERVICEASSIGN method from the /MERP/CL_CA_FSM_INTEGRATION class to get this value based on the following code example.

METHOD /merp/if_ca_fsm_crossref_badi~get_serv_assign_id. 
    DATA lref_fsm_integration TYPE REF TO /merp/cl_ca_fsm_integration. 
 
    TRY. 
        " Create FSM object 
        CREATE OBJECT lref_fsm_integration 
          EXPORTING 
            iv_mapp = iv_mapp. 
      CATCH /merp/cx_core_exception_gen INTO DATA(lref_badi_exception). 
        RETURN. 
    ENDTRY. 
    " Fetch Service Assignment from FSM if it exists 
    lref_fsm_integration->query_fsm_serviceassign( 
      EXPORTING 
        iv_aufnr       = iv_aufnr 
        iv_vornr       = iv_vornr 
        iv_activity_id = iv_activity_id 
      IMPORTING 
        ev_id          = ev_id 
        ev_activity_id = ev_activity_id 
        es_oblnk       = es_oblnk 
        ). 
  ENDMETHOD.

5. Implement the method /MERP/IF_CA_FSM_CROSSREF_BADI~GET~GET_SERV_ASSIGN_STATUS_ID:

This method is a prerequisite for implementing relevant status updates from SAP SAM to the SAP FSM planning and scheduling board. Use the QUERY_FSM_SERVICEASSIGNSTATUS method from the /MERP/CL_CA_FSM_INTEGRATION class to get this value based on the following code example.

METHOD /merp/if_ca_fsm_crossref_badi~get_serv_assign_status_id. 
    DATA lref_fsm_integration TYPE REF TO /merp/cl_ca_fsm_integration. 
 
    TRY. 
        " Create FSM object 
        CREATE OBJECT lref_fsm_integration 
          EXPORTING 
            iv_mapp = iv_mapp. 
      CATCH /merp/cx_core_exception_gen INTO DATA(lref_badi_exception). 
        RETURN. 
    ENDTRY. 
 
    lref_fsm_integration->query_fsm_serviceassignstatus( 
        EXPORTING 
          iv_aufnr       = iv_aufnr 
          iv_vornr       = iv_vornr 
          iv_activity_id = iv_activity_id 
        IMPORTING 
          ev_id          = ev_id 
          es_oblnk       = es_oblnk 
          ). 
ENDMETHOD.
Rating: 0 / 5 (0 votes)

The post Integration of SAP Service and Asset Manager (SAM) with SAP Field Service Management (FSM) using the FSM Cloud Connector (proaxia) appeared first on ERP Q&A.

]]>