E-Mail Validation in WebDynpro

Hi all,
        I have a requirement to validate an Email Address given at runtime in the input Filed. How can i achieve this?
        Is simple type in the Dictionary will helpful to achieve this? if so what is the format i have to give?
can any body please help me out in this issue...
Thanks in Advance,
VJR.

Hi,
Using Regular expressions you can chek if the input email is a valid email format.
Just add this method to your view controller and call this while validating the Email.
  public void validateEmail( java.lang.String inputValue )
    //@@begin validateEmail()
     java.util.regex.Pattern pattern;
     String expression = "(
s|>|^)(?!(:|www
.|
.))[A-Za-z0-9_.-]@([A-Za-z0-9_-]
.)+[A-Za-z]{2,4}(
s|
W|_|<|$)";
     String value = null;
     boolean valid = false;
     try {
     value = inputValue.toString();
     pattern = java.util.regex.Pattern.compile(expression);
     valid = pattern.matcher(value).matches();
     } catch (Exception e) {
          wdComponentAPI.getMessageManager().reportException("Wrong Email",false);
   wdComponentAPI.getMessageManager().reportSuccess("Email Valid "+valid);
    //@@end
I have not checked for all the possible error format of Email.But a few and those that you have specified.
Message was edited by:
        Shriram Kabra

Similar Messages

  • How to send the Adobe page as mail attachement from webdynpro...

    Hi Experts,
    How to send the Adobe page as external mail attachment from webdynpro automatically (for example: If I input the data for sales order in a view and created the sales order, if the sales order is created then have to place the created sales order number and the some details in a adobe form and should send as external mail and have to specifying the body as "Sales order created and details can be found in the attached adobe form" from webdynpro).
    Do the needful.
    Thanks & regards,
    Ravi.

    Hi ravi,
    See the WDA forum for the how to attach a file in webdynpro component for the attachments.

  • E-mail validation code

    Can anybody send to me E-mail validation code?
    Please don't send below code again.
    This is not working properly.
    please send a perfect E-mail validation code.
    Thank you.
    public static boolean validEmail(String strEmail)
             Pattern pat=Pattern.compile("[\\w]+@[A-Za-z0-9]+([.][a-zA-Z]+)+([,][\\w]+@[A-Za-z0-9]+([.][a-zA-Z]+)+)*");
            Matcher matcher=pat.matcher(strEmail);
             boolean flag=matcher.find(); // true;
             return flag;
        }

    A few days ago, DrClap provided a refernce to a regex
    for this. It should not be too hard to find though I
    don't think you will like the result!I found if for you - http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html

  • How U Perform Client Side Validations In Webdynpro?

    Hi experts,
    explain me abt How U Perform Client Side Validations In Webdynpro?
    Thanks in advance
    Sreenivas

    Hi ,
    As the javascripts used for client side validations are not supported in Webdynpro, All the validation written in a code take a complete cycle at runtime.
    You need to write the validations in the corresponding eventhandler i.e. action.
    Regards
    Deepak

  • Validations in Webdynpro ABAP ....

    Hi All,
    Any body tell me whether client side validation is possible in Webdynpro ABAP ?
    Will I need to write Javascript code in WDA ? Please shade some light. Any help in this regards would be highly appreciated.
    Thanks,
    Anil Kumar

    Hi Roger,
    There no automatic required field check within Web Dynpro ABAP. If you set the state to "required" only the asterix is displayed. You should implement the check in WDDDOBEFOREACTION. I assume that the value should not only be checked for "not empty", but there should also be a validation whether the field is correct.
    Somethimes it is not too easy to check whether all mandatory fields are filled, because there may be customizing or personalization for the view. Therefore there is a method, which can be used for it: CL_WD_DYNAMIC_TOOL=>CHECK_MANDATORY_ATTR_ON_VIEW. This method will take the personalization and customizing into account, especially if the admin has set some fields to required. But an additional check in the business logic should also be executed.
    regards, Regina

  • How to check URL validation in webdynpro?

    I get the error message in the webdynpro application of nw04 as followed:
    com.sap.tc.webdynpro.services.exceptions.InvalidUrlRuntimeException: Invalid URL=file:
    wdfd00184026a\ECM\CMIS\PlugFest
        at com.sap.tc.webdynpro.serverimpl.core.url.AbstractURLGenerator.checkURL(AbstractURLGenerator.java:699)
        at com.sap.tc.webdynpro.services.sal.url.core.URLGeneratorInternal.checkURL(URLGeneratorInternal.java:390)
    Does the system provide the function to checkURL so as to avoid the error?
    Thanks for help!

    Hi,
    You can create a simple type with built-in type as String. Then maintain a format as ##:##. But this will not restrict the user from entering junk value on the client side, a validation will be performed in the next request-response cycle.
    Regards,
    Satyajit.

  • E-mail Validation

    Hi, Can anyone direct me to the right direction on how to validate for an e-mail address. This code will go in a servlet to check the e-mail field before going into the db. Is this validation checking similar to JavaScript?
    Thanks :)

    Yes, a validation can be pretty much exactly like it is in Javascript. You can have a simple validation (basically checking for the @ sign) or a more complex one that checks for correct configuration, forbidden characters, or whatever. Or, if you're just feeling plain lazy,
    http://www.jscape.com/emailinspector/javadoc/com/jscape/inspect/EmailInspector.html

  • Sender Mail Adapter - Incoming Mail Validation

    Hi Group,
    I am using sender mail Adapter to read the incoming mails from mail server,I have couple of questions:
    1.How we can configure adapter to read the mails from particular user.
    2.after reading the mail I am only taking subject line in to the mapping,is there any way we can validate whether the incoming
       subject line is in the right define form or not.
    3.how we can archive once after reading mail.
    4.Is there any performance affect on settling polling interval.
    Could you please help .
    Regards,
    Rajiv

    Hi,
    Refer Michael's steps on similar requirement.
    Picking mails from a particular sender using mail sender adapter
    Regards
    Krish

  • ABAP RFC Validations in WebDynpro for Java

    Hi All,
    Any idea how I can handle ABAP validations in WebDynrpo for Java. For example, there is a standard BAPI for (MM01), howare the validations and ECC Configurations (as in plant data etc) shown in WDJ. Do they also come as some drop-down or search help etc?
    Thanks,
    Vamshi

    Dear Vamshi,
    In broad terms this is what you will need
    1) you need to configure JCOs (that is if they are not configured already)
    2) you need to implement the necessary MODELS for your WD for JAVA. These models will then be used to retrieve data to and from your RFC.
    There's plenty information on SDN on how to implement a MODEL in WD for JAVA.
    Here's a nice one to begin with:
    [http://wiki.sdn.sap.com/wiki/display/WDJava/FAQ-Models-Adaptive+RFC]
    Kind Regards
    /Ricardo Quintas

  • Reading PDF from mail in java WebDynpro

    Hello all,
       I have a mail in my inbox with a PDF attachment. I am able to view the adobe form in view using the binary array, but what i want is to read the contents to view context elements and then display them to view. How can i do that?
      Points waiting for the right ans.
    Thanks
       Vinod V

    Hello shruti,
      You have done a great work in SDN Blog and i have followed that.
    one more way to solve this problem:
    WDInteractiveFormHelper.transferPDFDataIntoContext( byte[] pdfSource, IWDNode targetNode);
    use: extracts data from a PDF document and copies the values into the Web Dynpro Context.
    Thanks,
        Vinod V

  • E-Mail Validation fails (email validation)

    Hi,
    according to the RFC, emails addresses in the following
    format are allowed: [email protected]
    but SPRY fails on validating this email address. Is there a
    fix for that? And if not, which file would I have to update in
    order to allow this email format?
    Thanks!
    Nils

    Hi Nils,
    You need to modify
    http://labs.adobe.com/technologies/spry/widgets/textfieldvalidation/SpryValidationTextFiel d.js
    Open that file and do a search for 'email', you should see a
    regular expression after it that looks something like this:
    var rx = /^[\w\.-]+@[\w\.-]+\.\w+$/i;
    You'll probably want to add the + to it like this:
    var rx = /^[\w\.-\+]+@[\w\.-]+\.\w+$/i;
    I'll file a bug on our side to make sure we allow all chars
    specified in the RFC.
    --== Kin ==--

  • Screen validations in webdynpro java (NWDS 7.0)

    Hi Experts,
    We are using Portal 7.0 version and NWDS 7.0, we have developed one wdj application .in this application  i have designed one dropdown key with "YES" or "NO" options.
    if user click on YES ,then i should be ask the Enter the amount and after enter the amount i will go to another dropdown key field(department list field) with yes or no values, same thing procedure repeat for this dropdown field(department list field)also.
    If user click on "NO", it should be go for direct next dropdown field(department list field)..
    Please help on this issue.
    Regards,
    Vanitha

    hi vanitha<
    here is the code
    create one attribute of type Visibility and bind it to the department dropdown and set the visibility using the below code
    WDVisibility advanceField = wdContext.currentContextElement().getLinksVisible();
      wdContext.currentContextElement().setLinksVisible(advanceField.BLANK);

  • How to send pdf attachment through mail using Webdynpro-Java

    How can i send the Adobe Interactive Form with data involved as a PDF attachment to mail? using Webdynpro-Java.
    Is there any Adobe API or jar file for generating pdf?
    Helpful answer is highly appreciable and rewarded with points.!

    Hi Sankar,
    try [Offline Interactive PDF Form Using E-Mail|/docs/DOC-8061#49]
    Michal

  • Mailing throw webdynpro for java

    Hi Experts,
          I want to send the email throw my webdynpro application.i am using this code.
    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    public class Mailer
        public String to,from,subj,mess,cc;
        public boolean retrcpt;
        private Logger log;
        public Mailer()
                    to="";
                    from="";
                    subj="";
                    mess="";
                    cc="";
                    retrcpt=false;
                    log=new Logger();
        public boolean doMail()
            try
                Properties props = System.getProperties();
                props.put("mail.smtp.host", "160.84.32.6");
                Session s = Session.getDefaultInstance(props, null);
                s.setDebug(true);
                Message msg = new MimeMessage(s);
                msg.setFrom(new InternetAddress(from));
                msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to, false));
                if(cc!=null)
                    msg.setRecipients(Message.RecipientType.CC,InternetAddress.parse(cc, false));
                msg.setSubject(subj);
                msg.setText(mess);
                if(retrcpt) msg.setHeader("Disposition-Notification-To",""+to);
                Transport.send(msg);
                return true;
            catch(Exception e)
                log.errLog("Exception while sending mail to "to" by "from" * "+e.toString());
                return false;
    My problem is that
    Where to download the "import javax.mail.*;"file and where and how to install it.
    (ii)And also tell me how to configer the SMTP server for the above need.
    Advance Thanx

    Hi Bhavani,
    Are you using java mail API to send a mail from your  webdynpro application ? if yes you have have to add external jar files i.e mail.jar , activation.jar files to your webdynpro application. please  find that below code snippet which i used in my application where the mail is working properly ...
    these are the required import packages....
    import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    public void sendEmail( )
        //@@begin sendEmail()
         IWDMessageManager msgMgr=wdComponentAPI.getMessageManager(); 
         try
                Properties props = System.getProperties();
                props.put("mail.smtp.host","172.16.22.14");
                Session session = Session.getDefaultInstance(props, null);
                Message msg = new MimeMessage(session);
                msg.setFrom(new InternetAddress(wdContext.currentContextElement().getCreatedBy()+"@accenture.com"));
                msg.setRecipients(Message.RecipientType.TO,
                InternetAddress.parse(wdContext.currentTasksBeanElement().getAssignedBy()+"@accenture.com", false));
                msg.setRecipients(Message.RecipientType.CC,InternetAddress.parse(wdContext.currentContextElement().getCreatedBy()+"@accenture.com",false));
                msg.setSubject("Task 00"wdContext.currentTasksBeanElement().getTaskNo()"-"+wdContext.currentTasksBeanElement().getType());
                msg.setText("Hi"'\n'"The following task is assigned to you"'\n'wdContext.currentTasksBeanElement().getDescription());
                msg.setHeader("X-Mailer", "Email");
               Transport.send(msg);
              catch (Exception ex)
                ex.printStackTrace();
        //@@end
    but make sure the SMTP port number. If you are implementing this inside your company ask your portal adminstrator or network administrator to get SMTP port number:Still if you are facing any problem  ....keep in  touch at any time..
    Thanks and regards
    Ratnakar reddy

  • Webdynpro abap validations

    Hi
    all i am new for webdynpro, i have one doubt "how to do validations in webdynpro abap for a perticular report"
    thanx in advance
    karuna

    Hi Karuna,
    Below excerpt is taken from the SAP standard training material, "The view controller is concerned with displaying pre-generated data and then handling the resulting user interaction (validation, error handling, and so on). It is the custom controller’s job to interact with back-end logic to generate the required data."
    So if you want to do any validations then you need to code them in your view controller level. Say suppose
    the validation is only to be performed for a certain user action, it can be placed in the corresponding action handler method (onaction<action>). However, if multiple action handler methods exist, some validations may have to be performed in more than one of the action handler methods. In this case, it is a good idea to put the coding in an extra method in order to have it written only once.For this reason, a special hook method exists for each view, which is processed before any of the action handler methods is called. The name of this hook method is wddobeforeaction( ). If a screen is composed of multiple views (nested views), then all wddobeforeaction( ) methods are processed before any action handler method is called.
    Hope this helps resolve your problem. If you need to validate your input data for just 1 action then you directly write in the corresponding action handler method. If your view can have multiple actions triggered then you can put your validation logic inside the  wddobeforeaction( ) method.
    Regards,
    Uday
    And I guess that you are new to the SDN forum. Please create a new thread if you want to raise your doubts. Also try searching the forum for any previous similar threads.

Maybe you are looking for

  • Can Oracle run in real time OS(such as PSOS) and communicate with data server by OCI?

    Hi, all! i have a question to get your help! now my oracle client running in SUN solaris communicate with oracle data server by OCI(oracle call interface). In future, my client system will port to embeded system that will use real time OS, such as PS

  • Error occured when trying to pass object from Jsp to Applet

    I am trying to pass a serialized object(ie, object class implements java.io.Serializable...so that is not a problem) from a Jsp to an Applet. My jsp(Jsp_RMI.jsp) page is:- <%@ page import="java.io.*" %> <%@ page import="com.itlinfosys.syslab.mfasys.s

  • I am trying to send mass MMS with an image

    Does anyone know of a way or an App that will allow me to send mass MMS with images and allow me to create groups. For Iphone 4s. I have over 2000 contacts, and i can't seem to find an App for group messaging capable of adding images. Any help is gre

  • Frustrated 1000%

    I was using photoshop elements 12 for several days with no problems then everything went wonky with my brush and cursor displays. My eraser became a point rather than a variable diameter circle, my eyedropper for selecting color became a small circle

  • Netscape Mail Problem

    Let me begin by saying I've already paid Netscape Support $19.95 to help me retrieve my mail folders that just disappeared on me one day. After I got my folders back, I went to reply to an email and the following error message appeared: An error occu