Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Email validation in screen input

Former Member
0 Likes
872

Hi friends,

i want's to validate email id and postcode in screen input field, does any budy have a complete code for it please forward it.

Thank you.

Regards,

Mayatra

3 REPLIES 3
Read only

Former Member
0 Likes
603

Hi

Post code is always validated based on the country

You can't validate that field alone

so declare it as some ADRC table field and validate against the Country and Postal code

Similarly you can declare the Mail ID field as

ADR6-SMTP_ADDR field and validate against this ADRC table

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
603

types: ty_email TYPE mailaddress. "Mail ID

Data : G_mailID TYPE ty_email,

SELECT-OPTIONS: p_email FOR G_mailID NO INTERVALS .

Just give like this.

Read only

former_member196299
Active Contributor
0 Likes
603

hi Virat ,

There are two ways you can validate your fields , one by the value checks and the other by the entry check .

The value check you can do by using a select statement on the table and then checking for the existance of that field in the list you got from select .

The other way is validating the screen field for a correct email id . the code fore which is given below .

Else for sample you can use the logic in the given code for checking an email id in input screen .

**************

FORM check_email

USING u_record_from_buffer_h TYPE zct_str_h

CHANGING ct_tab_msg TYPE zct_str_msg.

*-- Local data declarations

DATA: l_wa_msg TYPE LINE OF zct_tab_msg.

IF u_record_from_buffer_h-e_mail CA

'/,%,*,$,^,#,(,),!,~,``,&,-,=,+,[,],:,;,",<,>,?,/,|,\'.

*-- Do the error handling

l_wa_msg-return_code = con_rc_ppt_diff_e_mail.

l_wa_msg-msg_class = con_msg_class.

l_wa_msg-msg_type = con_msg_error.

l_wa_msg-msg_number = 011.

l_wa_msg-param1 = u_record_from_buffer_h-e_mail.

ENDIF.

MOVE l_wa_msg TO ct_tab_msg.

ENDFORM. " check_email

******************

Revert if further help needed !

Reward if helpful !

Regards,

Ranjita