cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Profit Center Determination in Service Order (SRVO/S4CRM)

tprekel
Explorer
0 Kudos
2,568

Hello everyone,


I want to use Accounting Indicator in substitution rules for Profit Center or change the Profit Center manually in service orders. Therefore I enhanced the PCASUB structure by adding the field "BEMOT" (accounting indicator) using the following SAP note:

111271 - Add new field to condition list in PCA substitution

I am also using the SAP enhancement "PCACRM01" to fill the PCASUB structure. The following SAP note forms the basis for this procedure:

386391 - CRM: Determination of profit center

But filling the "PCASUB" structure with "BEMOT" content hasn't been that successful yet, since "BEMOT" is item based and additionally the User-Exit happens before save event. Therefore accessing the local variable "BEMOT" content from items in SRVO is an issue (see half pseudo-code):

*&---------------------------------------------------------------------*
*& Include          ZXKECRM40PCAU01
*&---------------------------------------------------------------------*

DATA: ls_service TYPE crms4d_serv_i,
      it_chartab TYPE TABLE OF iaom_object_attribute WITH HEADER LINE,
      wa_chartab TYPE iaom_object_attribute.

LOOP AT t_chartab[] INTO it_chartab
  WHERE data_element = 'CRMT_OBJECT_ID_CO'.
ENDLOOP.

LOOP AT it_chartab INTO wa_chartab.
ENDLOOP.

SELECT object_id, ac_indicator
  FROM crms4d_serv_i
  INTO @ls_service
  WHERE object_id = @it_chartab-value.
ENDSELECT.

ch_pcasub-bemot = ls_service-ac_indicator.

Alternatively changing the profit Center manually would be a perfectly fine solution. So I enhanced the WebClient-View of Service Order Items to display the field Profit Center. But eventhough the field settings allow editing the field is greyed out (see screenshot).


So do you have any ideas how to either change the Profit Center manually or how to fill "BEMOT" in "PCASUB" to use this in further substitution rules?

Thanks a lot!


Best regards
Thomas

Accepted Solutions (1)

Accepted Solutions (1)

Silvia_Ventura
Product and Topic Expert
Product and Topic Expert

Hello Thomas

field profit center is not manually changeable even in the latest version 2022. I don't know the technical reasons of this restriction in S/4HANA On Premise .

I'd create a custom field Z-PROFIT ( header ) and I'd use to update the profit center as characteristic in IAOM0001 adding this z-field to BAPI_CO_SERVICE_CUSTOMER...

I didn't check it. Simply I think that it would be easier

Best regards

Silvia

tprekel
Explorer
0 Kudos

Hello Silvia,

thanks a lot! In that case we might go the custom field way. Do you have any suggestions how to fill our Z-PROFIT in BAPI_CO_SERVICE_CUSTOMER?

Is a BADI CRM_UPLOAD_CO implementation with method CHARACTERISTICS_SERVICE_FILL necessary?

Best regards

Thomas

Answers (1)

Answers (1)

Silvia_Ventura
Product and Topic Expert
Product and Topic Expert

Hi Thomas

nein nein nein :-)...I didn't remember that S/4HANA doesn't use BADIs like the old ones SRV_CONF_MOVE_TYPE or CRM_UPLOAD_CO . They are not longer called so the only way to add some custom code is to redefine the standard handler classes, some methods are private/protected.

In this case, you could redefine some method of class

CL_CRMS4_PROC_ACCOUNTING_FWD → Called for data exchange of service orders, transfers service characteristics to S/4 core to be posted on internal order and substitute this standard class by your own subclass in

I'm not sure if I'm being really useful in this case. I understand that is quite complicated to help with this kind of things in a Community.

Well, let me know if you find the light at the end of the tunnel

Best regards

Silvia Ventura

tprekel
Explorer
0 Kudos

Hi Silvia,

thanks for your input. That worked perfectly fine! Now I can update the profit center manually in service orders and send the respective PC to internal order 🙂

Best regards and special thanks again for your quick responses.

Thomas

0 Kudos

Hi Thomas,

Did you mange to pass also the accounting indicator to the internal order?

Best regards,

Octavian

tprekel
Explorer

Hi Octavian,

the accounting indicator was initially planned to be used for profit center determination (which works perfectly fine but we are assigning profit center manually now). Therefore I never tried to pass the accounting indicator itself to an internal order. I pass the manually assigned profit center as custom field to the internal order. So it should be possible to do the same with accounting indicator.

Best regards,

Thomas