Show TOC

Business Add-In for User-Defined Messages

Using this Business Add-in you can specify the type of a user-defined message depending on various criteria and hence override the setting for user-defined error management in Customizing.

You can use all of the existing data in the SAP system as criteria. For example, you can define the message type depending on

Example:

If for a costing a cost component split with a value of zero is determined then the system issues an error message (Type E) and the costing receives the status KF (Costed with errors). It is not possible for you to transfer the results of standard cost estimates which have errors to the material master.

By using this Business Add-In you can now specify that an error message is issued only for standard cost estimates, but for other cost estimates (for example modified standard cost estimates or current cost estimates) only an information or warning message is generated. This means that these cost estimates receive the status KA (costed without errors), and you can transfer the results of these costings to the material master, for example as other planned prices.

You are notified which costing variant was used in the cost estimate from the internal memory using function module CK_F_GET_KLVAR_FOR_PRODUCTCOST. By using function module CK_F_TCK03_HIERARCHY_READING you can then for example access all of the Customizing settings, including the costing type.

Sample coding:

METHOD IF_EX_COPCMESSAGECONTROL~MODIFY_CONTROLLABLE_MESSAGE.

DATA: COSTINGVARIANT TYPE CK_KLVAR,

F_TCK03 TYPE TCK03,

F_TCK01 TYPE TCK01.

IF APLID EQ 'CK'.

IF ARBGB EQ 'CK' AND MSGNR EQ '240'.

* Cost component split costed with value of zero

* get Costing Variant from the Costing-procedure...

CALL FUNCTION 'CK_F_GET_KLVAR_FOR_PRODUCTCOST'

IMPORTING

KLVAR_EXP = COSTINGVARIANT.

* determine Costingtype...

CALL FUNCTION 'CK_F_TCK03_HIERARCHY_READING'

EXPORTING

P_KLVAR = COSTINGVARIANT

IMPORTING

F_TCK03 = F_TCK03

F_TCK01 = F_TCK01.

IF F_TCK01-UPDTM NE '1'.

* The Costing Variant is determined for updating the standard price

* in the material master (marking/releasing-procedure).

* send Errormessage to the message-log

MSGTY = 'E'.

ELSE.

* The Costing Variant is determined for updating the standard price

* in the material master (marking/releasing-procedure).

* send Infomessage to the message-log

MSGTY = 'I'.

ENDIF.

ENDIF.

ENDIF.

ENDMETHOD.