Está en la página 1de 1

* Obtenemos el texto de la Excepción del Repositorio

DATA: l_fun TYPE funct-funcname,


l_exc TYPE funct-parameter,
l_txt TYPE swotlq-shorttext.

IF i_matnr IS INITIAL.

l_fun = 'Z_OBTENER_DETALLES_MATERIAL'.
l_exc = 'DEBE_INFORMAR_MATNR'.

* Texto de la Excepción
CALL FUNCTION 'SWO_TEXT_FUNCTION_EXCEPTION'
EXPORTING
language = sy-langu
function = l_fun
exception = l_exc
IMPORTING
shorttext = l_txt.

* Raise the exception and exit


MESSAGE e001(00) WITH l_txt RAISING debe_informar_matnr.
EXIT.

ELSE.

SELECT SINGLE * FROM mara


INTO e_wa_mara
WHERE matnr EQ i_matnr.

ENDIF.

También podría gustarte