Hi All,
I have a parameter on the selection screen wherin multiple email addresses will be entered with the ' ; ' as the seperator.
I have written a code for single email validation , but it wont work for multiple.
Can u please help me in that n tell me about the changes that needed to be done.
CODE
&----
*& Form validate_p_mail
&----
FORM validate_p_mail USING p_mail.
DATA : l_var1(20) ,
l_var2(50) ,
l_var3(25) ,
l_var4(25) ,
l_var5(25) ,
l_var6(25) ,
l_mail TYPE string.
CONSTANTS: c_temp(50) TYPE c VALUE ' ~`!#$%^&*()+=|\}]{[":;<>?/'.
l_mail = p_mail .
IF NOT p_mail IS INITIAL .
IF l_mail CA c_temp .
MESSAGE e000 WITH
'Enter a Valid Email address' .
ENDIF .
SPLIT l_mail AT '@' INTO l_var1 l_var2 .
IF l_var1 IS INITIAL.
MESSAGE e000 WITH
'Enter a Valid Email address' .
ENDIF.
IF l_var2 CA '@' .
MESSAGE e000 WITH
'Enter a Valid Email address' .
ELSEIF l_var2 CA '.' .
SPLIT l_var2 AT '.' INTO l_var3 l_var4 .
ENDIF .
IF l_var3 IS INITIAL .
MESSAGE e000 WITH
'Enter a Valid Email address' .
ELSEIF l_var4 CA '.' .
SPLIT l_var4 AT '.' INTO l_var5 l_var6 .
IF l_var6 CA '.' .
MESSAGE e000 WITH
'Enter a Valid Email address' .
ENDIF .
ENDIF .
ENDIF.
ENDFORM. " validate_p_mail
Thank you...