XSLT: Validate if date is before date of current date

Hi everyone,
we need to check condition in XSLT transformation that if a date is before the current date or not.
its easy to do this in java but not finding anything to do this in xslt.
If anyone knows this please provide any pointer.
TIA,

to put above question clearly:
For example if i have a date say
     targetDate = 2015-03-02T00:00:00.000
now i need to verify if this targetDate is before current date or not.
If(targetDate>beforeCurrentDate)
     targetDate = targetDate - 1 Month

Similar Messages

  • Can SOA validate invoice data before the webservice sends a response?

    I'm working with another branch of the company, and they're having trouble getting SOA to validate invoice data before it goes into Oracle financials.  They claim that SOA can't validate the invoices according to our business rules, and can only validate the input data based on the schema defined in the webservice.  Even the validation from the schema is useless because it produces schema violation rules that I can't return to a user. 
    After the webservice lets go of the data, there's a multi-step scheduled process where the data is handed off from scheduled process to scheduled process, so SOA can't guarantee in any way to the client end that invoices will get into the database. and worse, the data could get "stuck" at any one of these stages far after a user has submitted it.
    Is any of this true?  Is there no programming language within SOA that can perform validation of the business rules, and insert the data into Oracle all on it's own?  I've little or no familiarity with Oracle, but it's kind of incredible to believe that this is how Oracle designed the major interface to interact with 3rd party applications.

    People insist on using HTTP because it is the easiest to get through forward proxies, reverse proxies, and firewalls.
    If you don't have to deal with those devices, then there are other protocol options.
    As far as the amount of data, that is what my customers want to upload...
    I suppose I could break it down into multiple requests, use compression etc.
    I could also have the server reset the connection on a fatal error like this. (one which occurs within the POST body)
    That would eliminate the keep-alive also since I do not want to waste another 10 minutes to resync the messages.
    Regards,
    Tim

  • PL SQL Procedure to validate the data before inserting

    Hi All,
    I have a PLSQL procedure that validates the data and also inserts the data into the table. That procedure must be run to validate each row to be inserted. My doubt is how to reference that procedure within the interface of ODI.
    After reading some posts that mention the use of procedures, I think the best option is to call the procedure inside the knowledge module (inside a cursor that does a insert clause). Am I correct?
    As the KM's do a lot of verification and use temporary tables, I don't know what are the steps to be modified. Also, I would like to know if it's necessary to modified only the IKM or the LKM too.
    I'm using the IKM Oracle Incremental Update (PL SQL) and LKM Oracle to Oracle.
    Thanks.
    Luciene

    by validating data you mean looking up some table and see if it exists?
    If this is the case the you can implement this using a user function.
    If validation fails then you may put a -1 into the mapping.
    Then put a constraint on the target( say column is -1) and enable flow control.

  • Validate the date

    I have to validate the date, using following rules. How I can validate.
    �     Valid date
    �     Not in the past
    �     Not more than 56 days in the future

    See DateFormat/SimpleDateFormat.parse()
    http://java.sun.com/j2se/1.5.0/docs/api/java/text/DateFormat.html#parse(java.lang.String)
    and Calendar.add()
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Calendar.html#add(int,%20int)
    There are also before(), after(), and compareTo() methods in Calendar.
    Message was edited by:
    jbish

  • Validate of date field on tcode MB21

    Hi Experts,
    In tcode MB21 for Create Reservation  the base date is taking the future date. .i.e if the date which i give in the tcode is taking the future date also so i need to validate that date filed to stop taking date greater than system date. How to do that?
    Plz any body faced this kind of requirement let me know...
    Regards,
    Sunil kairam.

    Hi ,
    try these , before doing , go thru the documentations of it.
    MBCF0002  Customer function exit: Segment text in material doc. item
    MBCF0005  Material document item for goods receipt/issue slip
    MBCF0006  Customer function for WBS element
    MBCF0007  Customer function exit: Updating a reservation
    MBCF0009  Filling the storage location field
    MBCF0010  Customer exit: Create reservation BAPI_RESERVATION_CREATE1
    MBCF0011  Read from RESB and RKPF for print list in  MB26
    MBCFC003  Maintenance of batch master data for goods movements
    MBCFC004  Maintenance of batch specifications for goods movements
    MBCFC010  Propose batch number on Inventory Management item screen
    regards
    P

  • How can I validate a date field in Portal Forms

    I have a date field in portal forms that I want to perform validation on to make sure it's in the proper format before being accepted (mm/dd/yyyy). How can I validate against that field?

    Hi Ben,
    I took the time to test and revise. This is code that will validate a date entry (format MM/DD/YYYY). Just paste this in the "Before the start of the form..." window of the Additional PL/SQL code section of the form. Then add validateDate(); into the onBlur event window of the field in question. Replace the CYCLE_END_DATE with the field name in question.
    HTP.P('
    <SCRIPT LANGUAGE=javascript>
    function validateDate() {
    var ddObj;
    var mmObj;
    var yyObj;
    var day;
    var mon;
    var year;
    var field_val;
    var field_name;
    for (var j=0; j < document.forms[0].elements.length; j++) {
    field_name = document.forms[0].elements[j].name;
    field_val = document.forms[0].elements[j].value;
    if (field_name.substring(field_name.indexOf(''DEFAULT.'') + 8, field_name.lastIndexOf(''.01'')) == ''CYCLE_END_DATE'') {
    var delimPos = field_val.search(/\//i);
    if (delimPos < 0)
    alert(''Invalid date entry! Please enter in MM/DD/YYYY format. '' +
    ''e.g, Dec 21, 2003 would be entered as 12/21/2003'');
    else
    if (field_val.length != 10)
    alert(''Invalid date entry! Please Please enter in MM/DD/YYYY format. '' +
    ''e.g, Jan 1, 2003 would be entered as 01/01/2003'');
    else {
    month = field_val.substring(0, field_val.indexOf(''/''));
    day = field_val.substring(field_val.indexOf(''/'') + 1, field_val.lastIndexOf(''/''));
    year = field_val.substring(field_val.lastIndexOf(''/'') + 1, 10);
    /* Need to subtract 1 from value because in Javascript, January begins with 0
    and ends with 11 for December */
    month = month - 1;
    ddObj = new Date(year, month, day);
    mmObj = new Date(year, month, day);
    yyObj = new Date(year, month, day);
    if (ddObj.getDate(ddObj.setDate(day)) != day)
    alert(''Invalid day!'');
    if (mmObj.getMonth(mmObj.setMonth(month)) != month)
    alert(''Invalid month!'');
    if (mmObj.getYear(mmObj.setYear(year)) != year)
    alert(''Invalid year!'');
    </SCRIPT>
    ');

  • Validate a date

    I want to validate a date in an select-option.
    AT SELECTION-SCREEN ON s_fkdat.
    IF s_fkdat > sy-datum.
       MESSAGE e007 WITH 'Date cannot be in the future'.
    ENDIF.
    How can I do this? What is the correct syntax?
    Thanks
    Rafa
    Moderator message - Please see The specified item was not found. before posting - post locked
    Edited by: Rob Burbank on Aug 4, 2009 2:44 PM

    Hi ,
    try this way...
      AT SELECTION-SCREEN ON s_fkdat.
      loop at s_fkdat.
        IF s_fkdat -low > sy-datum.                            
            MESSAGE e007 WITH 'Date cannot be in the future'.
        ENDIF.
        IF s_fkdat -High > sy-datum.                            
            MESSAGE e007 WITH 'Date cannot be in the future'.
        ENDIF.
      endloop.
    Prabhudas

  • How to validate the dates in the table control ?

    How to validate the dates in the table control ?
    Can I write like this ?
    LOOP AT it_tab .
    CHAIN.
    FIELD : it_tab-strtdat,it_tab-enddat.
    module date_validation.
    ENDCHAIN.
    ENDLOOP.
    Module Date_validation.
    ranges : vdat type sy-datum.
    vdat-sign = 'I'.
    VDAT-LOW = it_tab-STRTDAT.
    VDAT-HIGH = it_tab-ENDDAT.
    VDAT-OPTION = 'BT'.
    APPEND VDAT.
    WHAT CODE I have to write here to validate ?
    and If I write like this How can we know which is the current row being add ?
    It loops total internal table ..?
    Bye,
    Muttu.

    Hi,
    I think there is no need to put chain endchain.
    To do validation you have to write module in PAI which does required validations.
    Thanks
    DARSHAN PATEL

  • How to validate a date in message mapping

    Hi experts,
                    how to validate a date in message mapping. For ex:  if date comes as 2008/02/31, then file it shold not get processed.how to achieve this in message mapping. Please help .
    Thanks&Regards,
    Reyaz Hussain

    Hi,
    There are few simple ways for date validation as follow,
    1.If you would like to handle it in XI only, then in message mapping you could verify about it with the help of generating smart exception.
    For e.g in mapping there is one Date conversion API i.e. somthing DateTransformation It converts the incoming date format to required format. Here give the date format i.e expected from Sender File.
    If in case the format miss-matched then it will create the exception.
    You could handle this exception with the use of [Alert notification|http://help.sap.com/saphelp_nw04/helpdata/en/2c/abb2e7ff6311d194c000a0c93033f7/frameset.htm] and could be even able to notify to sender system about it.
    2. The another solution is easy for SAP synchornous communication --If you are passing the file data to SAP, then you could use below function modules to verify date format in receiver RFC/BAPI or inbound IDOC program. If the sy-subrc is not 0 then don't process further.
    CONVERT_DATE_FORMAT
    ISU_DATE_FORMAT_CHECK
    Thanks
    Swarup

  • Function module to validate posting date

    Hi all,
    i am using function module amfi_period_get_and_check to validate posting date.
    if posting date is not open this module raises error message but when i am using it
    in my code its not showing error message but when i am executing the module
    it is showing the message for the same date
    please reply soon
    thnx

    at selection-screen on pos_dt.
    CALL FUNCTION 'AMFI_PERIOD_GET_AND_CHECK'
      EXPORTING
        i_bukrs                = com_code-low
      I_GJAHR                =
        i_koart                = 's'
      I_KONTO                = ' '
       I_MONAT                = '00'
       I_BUDAT                = pos_dt.
    IMPORTING
      E_MONAT                =
      E_GJAHR                =
    EXCEPTIONS
      ERROR_PERIOD           = 1
      ERROR_PERIOD_ACC       = 2
      OTHERS                 = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • To find the date type fields in the row and validate those date fields

    TYPES : BEGIN OF TY_MARA,
              MATNR TYPE MARA-MATNR,
              ERSDA TYPE MARA-ERSDA,
              ERNAM TYPE MARA-ERNAM,
              LAEDA TYPE MARA-LAEDA,
              MTART TYPE MARA-MTART,
            END OF TY_MARA.
    DATA : it_mara TYPE STANDARD TABLE OF ty_mara,
          it_mara1 TYPE STANDARD TABLE OF ty_mara,
           wa_mara TYPE ty_mara.
    loop at it_mara into wa_mara.
      describe field wa_mara-ersda type c_data.
    if c_data eq 'D'.
      CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
        EXPORTING
          date                            = wa_mara-ersda
       EXCEPTIONS
         PLAUSIBILITY_CHECK_FAILED       = 1
         OTHERS                          = 2
      IF sy-subrc eq 0.
    wa_mara-ersda = '00000000'.
        append wa_mara to it_mara1.
        write :wa_mara-matnr,wa_mara-ersda.
        else.
            wa_mara-ersda = '00000000'.
        append wa_mara to it_mara1.
        write :wa_mara-matnr,wa_mara-ersda.
      ENDIF.
      endif.
      endloop.
    This issue regarding how to find the date type fields in the row and validate those date fields.If its not a valid date ,i have to assign initial value to that.
    I've tried that for single field using describe field.Please help me do that for all fields.

    Hi Sam,
     I believe we had discussed the same issue in the below thread. Can you please refer the below one?
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d93e16ff-c123-4b36-b60b-60ccd34f6ca7/calculate-time-differences-in-infopath?forum=sharepointcustomizationprevious
    If it's not helping you please let us know
    Sekar - Our life is short, so help others to grow
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer

  • How to validate the date in my class

    Hi
    In my project with jsp and struts I need to validate the date field.
    So in the action class I want to validate the date that is the date is in dd/mm/year format?
    can anybody please give some idea to do this?
    Thank you so much.

    Here is a method that validates day/month/year using the Calendar class.
         public boolean validateDate(int day, int month, int year) {
              try {
                   Calendar cal = Calendar.getInstance();
                   cal.clear();
                   cal.setLenient(false);
                   cal.set(year, month-1, day);
                   // need to call getTime() to make the calendar compute/validate the date
                   cal.getTime();
                   return true;
              catch (IllegalArgumentException e) {               
                   return false;
         }

  • How to validate when date format is diff Internally and externally

    Hello,
    How can I validate the Date format if Internal format and external format is different.
    Ex :
    *  SELECT SINGLE CRTSP
    **                FROM /SAPSLL/PR
    **                INTO L_CRTSP
    **                WHERE CRTSP IN S_CRTSP .
    CRTSP (YYYY/DD/MM HHMMSEC) Internal Format
    S_CRTSP (YYYY/DD/MM) External format - selection option
    I had done following to convert the internal format to external format.
    DATA : LV_DT TYPE STRING.
    DATA :  L_CRTSP TYPE /SAPSLL/CRTSP.
    SELECT SINGLE CRTSP
                    FROM /SAPSLL/PR
                    INTO L_CRTSP.
    MOVE : L_CRTSP TO LV_DT. "(YYYY/DD/MM HHMMSEC)
    L_LEN = STRLEN( LV_DT ).
    L_DATE = LV_DT+0(8).
    I have the date format that i need in L_DATE."  (YYYY/DD/MM)
    Now how should I validate?
    *  SELECT SINGLE CRTSP
    **                FROM /SAPSLL/PR
    **                INTO L_CRTSP
    **                WHERE CRTSP IN S_CRTSP .
    Please let me know how can I validate or how can I write the select query to validate this field.
    There should be some way using Wildcard or some function module...which I am not sure...
    Any suggestions will be appreciated!
    Regards,
    Kittu
    Edited by: Kittu on Jan 6, 2009 12:58 PM

    Hello,
    Thank you for youe response and I apprecaite the help so far.
    This logic work if it is Parameter...When I have select option it is not working as it is not taking the range values...
    SELECT GUID_PR "Primary Key as GUID in "RAW" Format
    CRTSP "PRODUCT CREATED ON
    CHTSP "PRODUCT CHANGED ON
    FROM /SAPSLL/PR
    INTO TABLE T_PR.
    DATA : T_PR1 TYPE TY_PR OCCURS 0 WITH HEADER LINE.
    DATA:  W_TEST    TYPE STRING,
           W_LV_LEN  TYPE I,
           W_LV_LEN1 TYPE I,
           W_LV_DATE(20)  TYPE C,
           W_LV_DATE1(20) TYPE C.
    DATA : W_V(8) TYPE C,
           S_CT(11) TYPE C.
    SORT T_PR BY CRTSP CHTSP.
    LOOP AT T_PR INTO WA_PR.
      W_TEST = WA_PR-CRTSP.
      W_LV_LEN = STRLEN( W_TEST ).
      W_LV_DATE = W_TEST+0(8).
    ** IF WE SELECT ONLY ONE DATE IN SELECT OPTION
    s_crtsp VALUE IS - IEQ20040101..bY REMOVING FIRST THRID DIGITS
    WE ARE GETTING THE S_CRTSP VALUE IS 20040101 AND THIS LOGIC IS WORKING FINE..
       MOVE S_CRTSP TO S_CT.
      W_LV_LEN1 = STRLEN( S_CT ).
      W_LV_DATE1 = S_CT+3(8).
    *  IF W_LV_DATE NE S_CRTSP
    IF W_LV_DATE NE W_LV_DATE1.
      W_FLG = 'X'.
        DELETE T_PR INDEX SY-TABIX.
      ENDIF.
      CLEAR W_FLG.
    ENDLOOP.
    Can we do anything for this...
    ANy suggestions would be apprecaited!
    Regards,
    Kittu

  • Validate the Date Time

    Does any java library class support to validate the date of the user input?

    Error index is concerned with the pattern not with the value.
    SimpleDateFormat test = new SimpleDateFormat("yyyy-MM-dd");
    ParsePosition p = new ParsePosition(0);
    p.setErrorIndex(-1);
    Date d=test.parse("2002-1130",p);  //does not match the pattern
    System.out.println(p.getErrorIndex()); // index other than -1 expected
    p.setErrorIndex(-1);  //  initialize
    d=test.parse("2002-11-31",p);// match the pattern but value invalid
    System.out.println(p.getErrorIndex()); //-1 expected

  • Validate long date in javascript & OnSubmit problem

    hi i need to validate long date format "E, dd MMM yyyy HH:mm:ss" or Thu, 18 Jul 2002 12:52:49 that is key in by the user. but i'm not sure how to do this. i have couples of input data and i'm passing an object to the javascript function validateform using OnSubmit. Which one is better, using OnSubmit or OnCick for this kind of parameter passing. Eg <form method="POST" action="insert.jsp" onSubmit="return validateForm(this)"> However i'm having a problem where when there is an invalid input from the user, it will notify the user but it will also send the form to the insert.jsp at the same time. Therefore the user can't correct the invalid data. The function return false for valid input and true for invalid. Please help!!! urgent.... thanks in advance

    Your problem is you have used
    <input type="submit" onClick="OnSubmit();">
    this won't work.
    Instead try
    <input type="button" value="someValue" onClick="OnSubmit();">
    This may help. All the best.

Maybe you are looking for