ADD_MESSAGE2 SAP Method Generate Message and Add to Message Log
Below is documentation, parameters and attributes of ABAP Method ADD_MESSAGE2 within SAP class /SCMB/IF_SP_MESSAGE_HANDLER. There is also a number of example ABAP code snipts to help you use the functionality of this method.
This method is available within SAP systems depending on your version and release level, you can view further information by entering the class name /SCMB/IF_SP_MESSAGE_HANDLER into the relevant SAP transactions such as SE24 or SE80, and then selecting the method you are interested in.
Method Type - Instance
This is an Instance Method so needs to be instantiated first before you can access any of the methods. I.e. you need to create a local variable of TYPE ref to the class.The following technical details of method ADD_MESSAGE2 can also be found below:
- Importing parameters
- Exporting parameters
- Changing parameters
- Returning parameters
- Exceptions
- Coding Examples
Parameters of Method ADD_MESSAGE2
.| Name | Type | Data Type | Description | Default Value |
| ASPECT | Importing | TYPE STRING | Aspect in Which the Error Occurred | |
| ASPECT_FIELD | Importing | TYPE STRING | Field in Which the Error Occurred | |
| ASPECT_KEY | Importing | TYPE ANY | Aspect Key | |
| MESSAGE_TEXT | Importing | TYPE STRING | Structure of Message Variables | |
| MESSAGE_TYPE | Importing | TYPE /SCMB/SP_MESSAGE_TYPE | Message Type |
Exceptions of Method ADD_MESSAGE2
INVALID_ASPECT_KEY - Value for ASPECT_KEY Is Not of the Key Aspect TypeExample ABAP coding
DATA: lo_class TYPE REF TO /SCMB/IF_SP_MESSAGE_HANDLER.
DATA: lv_ASPECT TYPE STRING,
lv_ASPECT_FIELD TYPE STRING,
lv_ASPECT_KEY TYPE ANY,
lv_MESSAGE_TEXT TYPE STRING,
lv_MESSAGE_TYPE TYPE /SCMB/SP_MESSAGE_TYPE,
lv_other TYPE c.
CALL METHOD lo_class=>ADD_MESSAGE2(
EXPORTING
ASPECT = lv_ASPECT
ASPECT_FIELD = lv_ASPECT_FIELD
ASPECT_KEY = lv_ASPECT_KEY
MESSAGE_TEXT = lv_MESSAGE_TEXT
MESSAGE_TYPE = lv_MESSAGE_TYPE ).
Links to Related Class(s)
/SCMB/IF...Full list of available SAP object classes
Search for further information about these or an SAP related objects