Data validation for Date Field in Web Dynpro ABAP

Hi ,
In my WDA i want to perform data validation for date filed. (i.e. While creating a new record i have to check the Start Date should be always lesser than End Date.)
If u ll enter the wrong date it should validate the Date and throw an error message.
Please Reply soon its urgent.
Thanks,
Deepika

Hi,
First read the two attributes start date and end date.
Then write the following condition.
IF item_start_date > item_end_date.
Error message.
Endif.
For pop up error message you need to use Create_window method of the Interface if_wd_window.
Thanks.

Similar Messages

  • How to display the data of CJ2C(T-CODE) using web dynpro abap

    Hi all:
        How to display the data of CJ2C(T-CODE) using web dynpro abap.
        CJ2C used to display a Gantt Chart.
        Thanks.

    Hi,
    Create a Value attribute (resource) of type Resource, bind it with the property of File Upload UI element.
    On action place the code and Deploy the application
    byte[] bytes = new byte[ 1024];
    FileOutputStream out = new FileOutputStream( new File( <path in server>));
    InputStream in = resource.read( true);
    int len;
    while( ( len = in.read( bytes)) > 0)
         out.write( bytes, 0, len);
    in.close();
    out.close();
    Regards
         Vinod V

  • TechEd recording for New Features in Web Dynpro ABAP session

    This week's SAP TechEd lecture of the week is New Features in Web Dynpro ABAP - hence this posting in the WDA forum.  It covers heavily the new features that came in NetWeaver 7.01 as well as giving a bit of a preview of some of the new features in 7.02. This session was recorded in 2009 at TechEd Phoenix.
    http://www.sdn.sap.com/irj/scn/index?rid=/media/uuid/80726482-3d07-2d10-009c-c5a4db525ff0
    These TechEd Lectures of the week only last for free for one week and then you need a subscription to the Virtual TechEd to be able to view them. So this session will only be available until June 17th.

    you can use link to action in table.So that when you click link you can see the message in window or where ever you want.
    check this link how to insert link to action in ALV Table.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/webDynproABAP-UsingUIelementsinALVcomponentcells
    thanks
    Suman

  • How to enable/disable the input fields based on the data entered/user action in the web dynpro abap?

    How to enable/disable the input fields based on the data entered in the web dynpro application abap?  If the user enters data in one input field then only the next input field should be enabled else it should be in disabled state. Please guide.

    Hi,
    Try this code.
    First create a attribute with the name readonly of type wdy_boolean and bind it read_only property of input field of which is you want to enable or disable.
    Next go to Init method.
    Set the readonly value as 'X'.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
         DATA ls_context TYPE wd_this->element_context.
         DATA lv_visible TYPE wd_this->element_context-visible.
    *   get element via lead selection
         lo_el_context = wd_context->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_context IS INITIAL.
         ENDIF.
    *   @TODO fill attribute
    *   lv_visible = 1.
    *   set single attribute
         lo_el_context->set_attribute(
           name =  `READONLY`
           value = 'X').
    After that Go to the Action  ENTER.
    First read the input field ( first input field, which is value entered field) , next give a condition
    if input value is not initial  then set the readonly value is '  '.
    DATA lo_nd_input TYPE REF TO if_wd_context_node.
         DATA lo_el_input TYPE REF TO if_wd_context_element.
         DATA ls_input TYPE wd_this->element_input.
         DATA lv_vbeln TYPE wd_this->element_input-vbeln.
    *   navigate from <CONTEXT> to <INPUT> via lead selection
         lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
    *   @TODO handle non existant child
    *   IF lo_nd_input IS INITIAL.
    *   ENDIF.
    *   get element via lead selection
         lo_el_input = lo_nd_input->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_input IS INITIAL.
         ENDIF.
    *   get single attribute
         lo_el_input->get_attribute(
           EXPORTING
             name =  `VBELN`
           IMPORTING
             value = lv_vbeln ).
    if lv_vbeln IS not INITIAL.
        DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_visible TYPE wd_this->element_context-visible.
    *  get element via lead selection
        lo_el_context = wd_context->get_element( ).
    *  @TODO handle not set lead selection
        IF lo_el_context IS INITIAL.
        ENDIF.
    *  @TODO fill attribute
    *  lv_visible = 1.
    *  set single attribute
        lo_el_context->set_attribute(
          name =  `READONLY`
          value = ' ' ).

  • Custom seach help for standard field in Web dynpro application

    Hi All,
    I have a requirement in SRM portal where in I have a to add a custom search help to the 'WBS_ELEMENT' field in the the 'ACCOUNT ASSIGNMENT' tab of the Shopping cart creation screen with some input parameters on the search help.
    As the SRM Shopping cartcreation screen is a standard web dynpro application.
    Can anyone help me in this regard for addition of search help for a field with some custom fields in the Search help screen.
    Any inputs will be very helpful.
    Thanks in advance.
    Regards,
    Ahmed.

    Hi Ahmed,
    If it is an standard application then you will have to do ENHANCEMENT in the component. And for using customised value help you will have to declare attribute in CONTEXT and dynamically change the binding of the Value property of UI element inside post-method of WDDOMODIFY. You can create your own customised value help for newly added attribute.
    Thanks,
    Vishesh

  • Disable Technical Information for UI Element in WEB DYNPRO ABAP

    Hi expert,
    I want to disable  Technical Information for UI Element in  my web-dynpro application i am alredy disable  in user setting by parameters WDDISABLEUSERPERSONALIZATION by i want to disbale other two options 1 Display quick help.
                2 More field help.
    KINDLY GIVE ME SUTIABLE SOULATION.
    REGARD'S
    Vikash

    Hi Vikash,
    Check this thread, may be you'll get some clues from here.
    [How to restrict right click to show user setting in WebDynpro ALV?;.
    Regards
    Manas Dua

  • Date field in Web Dynpro ABAP

    Hi All,
    I want to implement the Input Date Field on my WebdynPro Application in the same way as it is availble at "SCN - Contribution Points / filter criteria" .
    I want to give the user the option to change the year , past or future easily.
    I have tried to call that date UI Element , but unable to do so.
    Please help me which UI Element to use as am new in WebDynPro ABAP...
    Thanks and Regards
    Hemachandran

    hello,
    One way of doing is  -  declare two attributes(DATE_LOW and DATE HIGH ) in the context node of type DATS.Place two input feilds in the view INPUT1 and INPUT2 , bind the two attributes to the two input feilds.
    The other way is use  OVS ( object value selector ) Search Help.
    Regards,
    Naga

  • Validation of select-options in WEb DynPro ABAP

    Can anyone please help me on validating select-options. I want to have a functionality like what we use in normal text field while validating the field. We generally use the REPORT_ATTRIBUTE_ERROR_MESSAGE funciton.
    How can we achieve the same thing with select-options, cuz the select-options are not bound with any attribute.
    Edited by: Tirth Pandya on May 7, 2009 2:02 AM

    Hi,
    Refer to this link..Re: validate select option fields

  • Validation of an inputfield in Web Dynpro ABAP

    Hello together,
    I have an input field in which is bound to a context. The context has a value-help.
    My problem is that the user can input into tte inputfield any value. Is there a method or something to validate against values of the value-help.
    Greetings,
    Florian

    Hi
    To the best of my knowledge
    as the UI element is bound to a contex you can get it back in the program using GET_ATTRIBUTE method or GET_STATIC_ATTRIBUTE
    as the value is available you can validate it against any table or in whichever manner you want
    Regards
    Ramchander Rao.K

  • How to do the feild validations in web dynpro abap

    dear all,
    how to do the feild validations for the screen in web dynpro abap.
    thanks,
    jyothi.

    hi jyothi,
    There are diffrent ways of doing validations for fields of screen in webdynpro abap depending on the requirements.
    I am giving simplest way of doing this validation(it may fullfil your requirement also)
    For e.g you want that without entering value in particular field user should not proceed to submit the data in screen.
      DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
      DATA lo_api_controller     TYPE REF TO if_wd_controller.
      lo_api_controller ?= wd_this->wd_get_api( ).
      lo_message_manager = lo_api_controller->get_message_manager( ).
      DATA var1 type string.
      DATA: node TYPE REF TO if_wd_context_node.
      node = wd_context->get_child_node( 'DATA' ).
      node->get_attribute( EXPORTING name = ' VALUE'
                             IMPORTING value =     var1 ).
    IF var1  IS INITIAL.
        CALL METHOD lo_message_manager->report_error_message
          EXPORTING
            message_text = 'Please enter the value'.
          EXIT.
      ENDIF.
    Now in above code VALUE is the attribute with whome your input field is bound .So if user doesnt enter any value into it he will get above msg (u have to use message are ui element to use this method)
    If you have any other doubt feel free to ask.
    regards
    Panky

  • EREC: theme for Web Dynpro ABAP pages (external candidate)

    Hello,
    I have created a custom theme in the SAP Netweaver Portal for my customer and now I have the requirement to use the same theme for my stand-alone Web Dynpro ABAP applications (pages for the external candidate). Is it possible to use the same stylesheet as in the portal, without having to recreate a theme?
    I tried several options, but none of them did work:
    A. Downloading the portal theme as a ZIP file and then uploading it in ERP using the report BSP_UPDATE_MIMEREPOS (after unzipping) to a location /SAP/PUBLIC/BC/UR/nw5/themes/CUSTOM_THEME. After that, I call my application with the additional URL parameter sap-wd-themeroot=/SAP/PUBLIC/BC/UR/nw5/themes/CUSTOM_THEME but it does not work (the app is displayed with the default sap_tradeshow stylesheet)
    B. I also tried calling my app using the URL parameter sap-cssurl=/SAP/PUBLIC/BC/UR/nw5/themes/CUSTOM_THEME but here again, it does not work (the app is displayed with the default sap_tradeshow stylesheet)
    C. Downloading the portal theme as a ZIP file and then uploading it (zipped) using the report WD_THEMES, but here I receive the error "no themes found in the ZIP file". I have the same error if I upload only the ur.zip I receive from the portal (instead of uploading the whole *.zip file)
    I checked the UR versions both in portal & ERP, and we had a lower version in the portal than in the ERP, so we upgraded the portal version according to SAP note 1446099. Now we have a higher version in the portal than in the ERP. We regenrated the portal theme and downloaded it again, but with the same result.
    Does anyone have an idea what could be the solution to our problem?
    Thanks in advance!

    I would recommend to try another way. If it is possible to access any SAP Portal from outside you can use two URL Parameters to integrate the Portal style sheets in a standalone WDA application. The parameter sap-cssurl contains the absolute URL address to the style sheet and parameter sap-cssversion the current SAP Portal style sheet version. For all external facing scenarios it is important to use the whitelist mechanism to block unknown URLs.
    Example
    ?sap-cssurl=http://myportal.myserver.com:50000/irj/portalapps/com.sap.portal.design.urdesigndata/themes/portal/mytheme/ur/ur_ie6.css
    &sap-cssversion=7.11.5.20.0
    I canu2019t recommend to raise manually the version number. You will not get an consistent system this way. The meta data (project.zip) are outdated and of course you will get an outdated theme.

  • Authorization about Web Dynpro ABAP

    Dear all:
                 I have some problem withs the authorization about the web dynpro for abap.Please give me some advices.
    For example: In my web dynpro abap,i have two tabs,one is "upload",anthor is "preview".Now there are two users,
    in this example ,i  assume user A and user B.If user A have the authorization of "Upload",and the user B have "Preview".
    Now how can i solve the problem ?  If i do not want to use the  code to implement it , is there any solution for it ? Thank  you ~
    Best wishes !

    Hi,
    There are many ways to achieve this, but without code changes I guess this would be the easiest route:
    Create 2 application configurations: one with Upload button Hidden and other with Preview Button Hidden.
    Now to run you application you have 2 URL's by vritue of 2 application configurations.
    Give the appropriate URL to required set of people.
    Learn more about [App Configuration Here|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/media/uuid/af5e19e7-0b01-0010-37af-bc816f9a240c]
    Hope this helps.
    Regards
    Manas Dua

  • Invalid date format for 'Created' field in the getVersions web service Response.

    Hi all,
    I am trying to get all versions for selected document by calling getVersions method Versions.asmxweb service, but getting ‘Created’ date attribute value is in the format "29-05-2012 12:01"
    but I am expecting either one of the following date formats.
     1.      yyyy-MM-dd HH:mm:ss  or  yyyy-MM-ddTHH:mm:ssz
     2.      MM/dd/yyyy HH:mm a   (a means AM/PM)
     3.      MM/dd/yyyy
     4.      yyyyMMdd HH:mm:ss
    where do I need to change?
    what are all the formate will be support by SharePoint?
    please find attached response xml of getVersions call.
    <results xmlns="http://schemas.microsoft.com/sharepoint/soap/">
        <list id="{6A6F6CD1-2E9C-44CC-B1F5-56G7JB5C8778}"/>
        <versioning enabled="1"/>
        <settings url="http://hbngjfgj47s20/reg/_layouts/LstSetng.aspx?List={7S6F6CD1-2E9C-44CC-B1F5-KO9J8Y7Y6H78}"/>
        <result version="@0.3" url="http://vmesxsrv47s20/register/Shared Documents/Parent/child/my_doc" created="29-05-2012 12:01" createdRaw="2014-12-02T12:46:02Z" createdBy="my_dom\agi_sharepoint"
    createdByName="AGI_Sharepoint" size="288" comments=""/>
        <result version="0.1" url="http://hbngjfgj47s20/register/_vti_history/1/Shared Documents/Parent/child/my_doc" created="29-05-2012 10:01" createdRaw="2014-12-02T10:55:18Z" createdBy="my_dom\my_sharepoint"
    createdByName="my_sharepoint" size="288" comments=""/>
        <result version="0.2" url="http://hbngjfgj47s20/register/_vti_history/2/Shared Documents/Parent/child/my_doc.txt" created="29-05-2012 11:01" createdRaw="2014-12-02T10:59:25Z" createdBy="my_dom\my_sharepoint"
    createdByName="my_sharepoint" size="288" comments=""/>
    </results>
    Kindly help me on this.

    Hi,
    According to your post, my understanding is that you want to change date format for ‘Created’ field in the getVersions web service.
    Per my knowledge, you can get the date format for ‘Created’ field as “MM/dd/yyyy HH:mm a”.
    For more information, you can refer to:
    Versions.GetVersions Method (Versions)
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Adobe Flash Islands for Web Dynpro ABAP Data Binding problem

    I have downloaded the NetWeaver 7.1 Trial (includes Adobe Flash Islands for Web Dynpro ABAP). I try to create a very simple FlashIslands component running within the Web Dynpro Application, everything looks good. However, all binding to the Flex component is not working. Does anyone know why?
    Since it's trial version, I login as BCUSER into NSP system. When I load up the build-in sample, such as Chart Demo, the binding to Flex seems working. I suspect if it has anything to do with package? I could only create my Web Dynpro under the $TMP package, as all the build-in sample are defined in SWDP_DEMO.
    Please help.
    Alan

    hi,
    Check out this link. It will give you an idea how to integrate Aobe island comp with web dynpro.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/307b434f-ff32-2b10-e885-991247270480
    Thanx.

  • Import data from excel/csv file in web dynpro

    Hi All,
    I need to populate a WD table by first importing a excel/CSV file thru web dynpro screen and then reading thru the file.Am using FileUpload element from NW04s.
    How can I read/import data from excel / csv file in web dynpro table context?
    Any help is appreciated.
    Thanks a lot
    Aakash

    Hi,
    Here are the basic steps needed to read data from excel spreadsheet using the Java Excel API(jExcel API).
    jExcel API can read a spreadsheet from a file stored on the local file system or from some input stream, ideally the following should be the steps while reading:
    Create a workbook from a file on the local file system, as illustrated in the following code fragment:
              import java.io.File;
              import java.util.Date;
              import jxl.*;
             Workbook workbook = Workbook.getWorkbook(new File("test.xls"));
    On getting access to the worksheet, once can use the following code piece to access  individual sheets. These are zero indexed - the first sheet being 0, the  second sheet being 1, and so on. (You can also use the API to retrieve a sheet by name).
              Sheet sheet = workbook.getSheet(0);
    After getting the sheet, you can retrieve the cell's contents as a string by using the convenience method getContents(). In the example code below, A1 is a text cell, B2 is numerical value and C2 is a date. The contents of these cells may be accessed as follows
    Cell a1 = sheet.getCell(0,0);
    Cell b2 = sheet.getCell(1,1);
    Cell c2 = sheet.getCell(2,1);
    String a1 = a1.getContents();
    String b2 = b2.getContents();
    String c2 = c2.getContents();
    // perform operations on strings
    However in case we need to access the cell's contents as the exact data type ie. as a numerical value or as a date, then the retrieved Cell must be cast to the correct type and the appropriate methods called. The code piece given below illustrates how JExcelApi may be used to retrieve a genuine java double and java.util.Date object from an Excel spreadsheet. For completeness the label is also cast to it's correct type. The code snippet also illustrates how to verify that cell is of the expected type - this can be useful when performing validations on the spreadsheet for presence of correct datatypes in the spreadsheet.
      String a1 = null;
      Double b2 = 0;
      Date c2 = null;
                        Cell a1 = sheet.getCell(0,0);
                        Cell b2 = sheet.getCell(1,1);
                        Cell c2 = sheet.getCell(2,1);
                        if (a1.getType() == CellType.LABEL)
                           LabelCell lc = (LabelCell) a1;
                           stringa1 = lc.getString();
                         if (b2.getType() == CellType.NUMBER)
                           NumberCell nc = (NumberCell) b2;
                           numberb2 = nc.getValue();
                          if (c2.getType() == CellType.DATE)
                            DateCell dc = (DateCell) c2;
                            datec2 = dc.getDate();
                           // operate on dates and doubles
    It is recommended to, use the close()  method (as in the code piece below)   when you are done with processing all the cells.This frees up any allocated memory used when reading spreadsheets and is particularly important when reading large spreadsheets.              
              // Finished - close the workbook and free up memory
              workbook.close();
    The API class files are availble in the 'jxl.jar', which is available for download.
    Regards
    Raghu

Maybe you are looking for

  • QT 7.2 & iPhone - First Step to Ringtones?

    The new QT 7.2 has an export to iPhone and iPhone cellular. It only shows as "Movie", but exports "audio only" files also. Could this be the first step in giving us personalized ringtones? Maybe, unfortunately we'll need to wait and see ajm

  • Set an array with undeterminate size

    I should know this by now, but go figure. If I want to set up an array of Strings, yet I do not know how many Strings I am going to stick in it, how would I do so? For example, if I want to create an array myArray, and I do not know whether I am goin

  • Can't see networked computer in the finder's network window.

    I can no longer see my MacPro from my MBP in the finder's "Network" window. I can still connect using "Connect to Server" and typing the IP manually. From the MacPro I can see the MBP just fine. I repaired permission, ran cocktail etc... Any ideas?

  • How to set properties in XCM java appllication in NWDS

    Hi, Its Java Application using NWDS I need to set the properties which can be changed or controlled easily in different servers. I heard XCM is used for this purpose. I need guidance which config files will be used in XCM folder and how to use them i

  • What happens if i stop my iphone cloud backup?

    it says it still has 4 hours left to back it up? but i need to go out so will anything happen if i cancel it?