Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How do I do a data type check?


I was trying to do a hashtotal for a table column. It is necessary that the table column only contains numeric values. Is there a way to do a data type check, before I compute the hashtotal value? Thanks.


LOOP AT itab INTO hash_value.

IF hash_value = NUMC. " (==> Cannot)

hash_total = hash_total + hash_value.



I would do it:

IF hash_value CO '0123456789.'.  "<=== Includes decimal
  hash_total = hash_total + hash_value.

This avoids problems with special characters (#$@, etc). You may want to exclude the decimal point and/or check for only one or none of them.


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question