How can I check the field char can be translate into num type?

Hi
when I import Excel file into sap . I create one table to save the column and there are one column who's tpye is num . as we all know ,all the fields from excel are char type, the sap system will
automatic translate char to num . but if the field can not translate char to num. then the program
will be crush down
such as : qty type char : 500 in excel then in tab qty type num :500 ok
qty type char : 50A in excel then crash
Is there any function that can deal with this matter?

You may [CATCH|http://help.sap.com/abapdocu/en/ABAPCATCH_SYSTEM-EXCEPT_SHORTREF.htm] the error.
CATCH SYSTEM-EXCEPTIONS convt_no_number = 1
                        conversion_errors = 2.
  MOVE char TO num.
ENDCATCH.
IF sy-subrc EQ 0.
  " converted
ELSEIF sy-subrc EQ 1.
  " not numeric
ELSEIF sy-subrc EQ 2.
  " not converted, other error
ENDIF.
Regards

Similar Messages

Maybe you are looking for