Output of Error Messages

Context

You want to include your own error messages in the conversion log.

Procedure

  1. Use a WRITE statement in the code.
    WRITE: 'Fehler bei der Umsetzung von Feld xxx'
                   
  2. In the editor, choose Insert -> Message to display a message that exists in the SAP system.

    (code after calling the menu function and filling the appropriate fields):

    WA_ERRORTAB-ID = '/SAPDMC/LSMW'.
    WA_ERRORTAB-MSGNO = 012.
    WA_ERRORTAB-PAR1 = 'A'.
    WA_ERRORTAB-PAR2 = 'B'.
    WA_ERRORTAB-PAR3 = 'C'.
    WA_ERRORTAB-PAR4 = 'D'
    INSERT WA_ERRORTAB INTO TABLE G_ERROR_TAB.  
                   

    An appropriate message is listed in the log.