For
the email address format validation you can use the "pattern"
option of the "Set"
command:
Set
V[x1] "&V[email]" pattern="_%@_%._%"
if not
Q[ok]
Message "E: Invalid email address &V[email]" -statusline
endif
Explanation:
in the given pattern the _ symbol stands for a single character and the % symbol
for an arbitray string (can be empty).
For
the tax number format check you can call an SAP function module,
e.g.
Call
"EU_TAX_NUMBER_CHECK" -try in.COUNTRY="&V[country]"
in.EU_TAX_NUMBER="&V[taxno]"
if not
Q[ok]
Message "E: Invalid tax naumber" -statusline
endif
Here we use the
-try option, since the function module returns an exception if the given tax
number is not valid. A message text is not returned by this function module; you
would need to write your own function module that calls
"EU_TAX_NUMBER_CHECK" in order to get the message text in ABAP system
fields.
|