lunes, 27 de septiembre de 2010

Comprobar si un campo es numerico ABAP

report ztest.

data irefer(60) value '1casa'.
data v_tipo(4).

CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
string_in = irefer
IMPORTING
* string_out =
htype = v_tipo
EXCEPTIONS
OTHERS = 1.

IF v_tipo EQ 'NUMC'.
if iREFER < 10000.
concatenate '01038' irefer+1(5) into irefer.
else.
concatenate '0100' irefer into irefer.
endif.

ENDIF.
write irefer.