Function module to validate time

Hi Gurus,
I am getting invalid time from source system , I need to validate the time in BW.
Is there any function module to use to validate the time field ?
Thanks
Liza

Try to write a small routine like this:
DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
  DATA: i_time(2) TYPE c.
  i_time = TRAN_STRUCTURE-ZZENTIME.
  If i_time > 24.
       i_time = 0.
  else.
               i_time = i_time.
  endif.
RESULT = i_time.
returncode <> 0 means skip this record
  RETURNCODE = 0.
abort <> 0 means skip whole data package !!!
  ABORT = 0.
Hope it helps..

Similar Messages

  • Function module to validate input value

    Hi all,
    can you please provide me the name of the function module to validate input value.
    I have a case where i have to validate decimal values. sometimes users may enter wrong decimal values by mistake instead of  "0.23" "0..23' and it gives CONVT_NO_NUMBER runtime error so have to come up with some solutions to validate user input.
    Please provide me Function module if anybody knows.
    Thanks,

    Try this one
    data: lv_htype TYPE dd01v-datatype.
        CALL FUNCTION 'NUMERIC_CHECK'
          EXPORTING
            string_in = my_number
          IMPORTING
            htype     = lv_htype.
        IF lv_htype NE 'NUMC'.
           Raise an error here...
        ENDIF.

  • API - BAPI , RFC Function module to validate user id and password

    Hi,
    Can anyone provide me with the function module to validate the username and password of the user of the back end R/3 System.
    Best Regards
    Sid

    Use function module SUSR_CHECK_LOGON_DATA. You need to provide auth_method (P for password check), userid and password.
    Be careful when you execute the function in test mode because it converts the input into upper case hence if you have lower case characters in your password it will return with invalid password. If you pass the lower case into the function in a program everything is fine.
    Regards,
    Michael

  • Function module to validate numeric values

    Hi all.
    Can some one please tell me Is there any Function Module to validate only numeric values?
    Like in year variable, it can never contain alphanumeric values or special symbols?
    Is there any function module to check, wheather the variable contains only numeric values, no alphanumeric value or special symbol?
    If there is no as such function module then what is the alternative approach we can take?
    Plz help me .
    Regards
    Dipankar

    Function Module NUMERIC_CHECK for Editing and checking numeric fields ( i.e. Num validations)
    Check using the Function Module "NUMERIC_CHECK".
    CALL FUNCTION 'NUMERIC_CHECK'
    EXPORTING
    STRING_IN = X
    IMPORTING
    STRING_OUT = X
    HTYPE = H_TYPE.
    if h_type = 'CHAR'.
    WRITE:/ 'Not Numeric'.
    else.
    write:/ 'Numeric'.
    ENDIF.
    REWARDS IF USEFUL
    GAURAV J.
    Edited by: GAURAV on Feb 3, 2008 2:19 PM

  • Function Module to validate date

    Hi,
    Is there a Function module to validate date in transfer rules or update rules. I checked the forum, couldn't find an answer. Any help is appreciated
    Thanks
    Bala

    You should be able to use this FM:
    CALL FUNCTION 'RSAR_DATE_CHECK_PLAUSIBILITY'
      EXPORTING
        i_date                          = yourdate
    EXCEPTIONS
       PLAUSIBILITY_CHECK_FAILED       = 1

  • Function modules to read Time clusters B1 and B2 from PCL1 and PCL2

    Hi All
    Are there any function modules or macros to read time clusters B1 & B2?
    I want to read time data in the clusters for reporting purpose.
    Regards,
    Rupesh Mhatre

    You can also call the FM HR_TIME_RESULTS_GET and get the exact cluster you need from B2 like WPBP, ZE, SALDO etc.
    Otherwise if you want to use the older FM declare the GET_TBUFF and GET_BUFFER_DIR as of below structure.
    DATA: BEGIN OF TBUFF OCCURS 5000.                           "XPMK014785
            INCLUDE STRUCTURE PCL1.
            DATA: SGART(2),
          END OF TBUFF.
    DATA: BEGIN OF BUFFER_DIR OCCURS 2000,                      "XPMK014785
            SGART(2),
            CLIENT LIKE PCL1-CLIENT,
            RELID LIKE PCL1-RELID,
            SRTFD LIKE PCL1-SRTFD,
            NTABX LIKE SY-TABIX, "pointer auf aktuellen satz
            OTABX LIKE SY-TABIX, "pointer auf alten satz (falls vorhanden)
            NNUXT LIKE PCL1-SRTF2, "anzahl folgesaetze aktueller Satz
            ONUXT LIKE PCL1-SRTF2, "anzahl folgesaetze alter Satz
          ofset(3) type p,     "offset innerhalb eines entry
          END OF BUFFER_DIR.
    INT_TIME_RESULTS should be of type PTM_TIME_RESULTS.
    Regards
    Ranganath

  • 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.

  • Function Module for Start time and End time

    Hi Experts,
    I need a function module for getting particular Work schedule rule start time and endtime and further details by passing personnel number and day.
    Thanks in advance.
    Sunil

    FYI - https://forums.sdn.sap.com/click.jspa?searchID=-1&messageID=5338428
    Thanks,
    SK

  • Re: Function Module to Validate ESS Id and Password

    Hi ,
         Is there is any function module / BAPI to validate the ESS Id and Password .
    Regards,
    Vijay

    Hello Vijay,
    there is a BAPI:
    BAPI_EMPLOYEE_CHECKPASSWORD
    Regards
    Gregor

  • Function module to validate Sales Deal in VA01

    Dear Experts,
                       I have a requirement to validate the sales deal for material/material group and customer/customer group
    discounts. I need to activate/deactivate the condition type based on the sales deal entered in the sold-to-party and ship-to-party
    level. Please let me know if any function module is available for the same.
    Thanks
    Ramesh Manoharan

    Hi,
    Using custom ROUTINES in requirement column of pricing procedure (V/08) we can activate/deactivate any condition type in sales order. For your requirement you have to define the exact logic to write in routine.
    n routine, you need to set the SY-SUBRC value.
    If SY-SUBRC = 0, then the condition type will be triggered in sales order.
    If SY-SUBRC = 4, then the condition type will not be triggered in sales order.
    I hope this will help you.
    If my understanding is wrong, please explain in detail about your requirement.
    Regards,
    Shashwath

  • Function Module To Change TIME from GMT to CST

    Hello All,
    Can anyone tell me if there is any Function Module to convert the TIME from GMT to CST?
    Regards

    Hi Sunil,
    use the following code.
    DATA :
      timestamp like TZONREF-TSTAMPS,
      time      like sy-uzeit,
      date      like sy-datum.
    The following function module is used to convert the
    time and date into GMT timestamp
    CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
      EXPORTING
        i_datlo           = sy-datum
        i_timlo           = sy-uzeit
        I_TZONE           = 'INDIA'
    IMPORTING
       E_TIMESTAMP       = timestamp.
    The following function module is used to convert the
    above obtained timestamp to PST timezone date and time.
    CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'
      EXPORTING
        i_timestamp       = timestamp
        I_TZONE           = 'CST'
    IMPORTING
        E_DATLO           = date
        E_TIMLO           = time.
    write :/ 'Date and Time at PST zone is ',date, time.
    Reward if helpful.
    Thanks,
    Naveen.

  • Function module to find time difference

    Can any body help me to find the function module to find the time diff: between two times, time is in 24hrs

    Hi again,
    1. Difference is always returned in SECONDS.
    2. use this code (just copy paste in new program)
    REPORT abc.
    data : t1 type sy-uzeit.
    data : t2 type sy-uzeit.
    DATA : DIFF TYPE I.
    t1 = '090000'.
    t2 = '100000'.
    DIFF = T2 - T1.
    WRITE :/ DIFF.
    regards,
    amit m.

  • How to create function module in real time

    hi experts,
    can somebody explain a real time requiremwnt , to create a function module.
    its very urgent.
    i want elaborately.
    regards,
    subhasis.

    hi,
    In real time
    1. as per my knowledge we create function modules to Inbound IDOC /outbound processing..
    2.Interface between a program..
      Example we need to take some data from a report say materials and plant and process some bapi and return logfiles to the report we can use FM here too.
    To create a function module
    First you need to create a function group (function group holds a number of function modules relevant)
    SE37>goto>function groups-->create group ..click this create group..
    Now in the pop up enter the function groupname Eg: ZW_FG1 plus short text and saveit
    Now again goto SE37--> enter new Function module name eg:ZW_FM1
    and press F5.
    Now again a popup you need to enter
    function group name : ZW_FG1
    and short test and save it..
    Now the Function module is created under the Function group ZW_FG1.
    write your export import table parameters and you source code.
    rewards if useful
    regards,
    nazeer
    Message was edited by:
            nazeer shaik

  • Function Module for Date/ Time difference in Working Days

    Hi all,
    Are there any function modules which will calculate the difference between a date AND time, but in working days?
    I can use the FIMA_DAYS_BETWEEN_TWO_DATES_2 FM for the dates, but I need to include times in this as well.
    This is for situations where the 'starting date' is a non-working day, and the 'end date' is a working day.  In this situation I need to take all the hours and minutes into account, which happened on the working day.  To give an example -
    Start date:  04.07.2010 (Sunday - Non working day)
    Start time:  21:12:36
    End date:  05.07.2010 (Monday - Working day)
    End time:  04:47:24
    I realise there is a Time option in this function module, but when I test it, it doesn't seem to be returning the desired results (returns 0 for days and time).  I am using '5' as the I_STGMETH and 'GB' as the I_SKALID. 
    I need a calcuation which will return the time, post midnight on the working day - in this example, 4 hours, 47 minutes (seconds are optional!).
    Can anyone help? - can I still use FIMA_DAYS_BETWEEN_TWO_DATES_2 but with different parameters?
    Thanks
    Mischa
    Edited by: Mischa Gulseven on Jul 20, 2010 10:40 AM

    Hi,
    Thanks but this FM does not seem to account for working days.
    For example, if I use:
    DATE1                           04.07.2010  (non working day)
    TIME1                           04:00:00
    DATE2                           05.07.2010   (working day)
    TIME2                           21:00:00
    It will give the following results -
    DATEDIFF                                                      1
    TIMEDIFF                                                     17
    EARLIEST                        1
    I don't want to account for the non-working day so the result I actually want would be to calculate from midnight on 05.07 to 21:00 on 05.07 which should be 21 hours.
    I suspect I probably need to include the STGMETH and the factory calendar somewhere in the FM?
    Does such a FM exist, or could anyone help me with some ABAP for this?
    thanks
    Mischa

  • Function Module to validate a value against domain fixed values

    Hi,
    Could anybody please let me know if there is a standard Function Module that takes a Value and Domain name as an input and checks if the input value exists in the Fixed Values of the domain.
    Thanks,
    Shalabh

    Hi,
    you can use fm FM_DOMAINVALUE_CHECK. Pass parameter values for I_DOMNAME and I_DOMVALUE.
    If the value is invalid, exception VALUE_NOT_ALLOWED will occur.
    Regards,
    Klaus

Maybe you are looking for

  • ABAP dump error while updating product master in APO

    Hi All, Greetings from Vijay! I need to your help to resolve below issue ; I am getting error ' No simulation parameters could be set for the active version' While i am updating and trying to assign active version to my product master in APO which ar

  • Paperfree Billing

    hi, I have just spoke to BT as my new bill has no discount for paperfree billing and Bt customer service have just informed me that online paperfree billing discount is no longer available,Was anyone else aware of this? Solved! Go to Solution.

  • Adobe flash player Crashes,also computer freezes and restarts itself while watching online videos

    Please help!

  • Rendering error with wrong template path

    Hi there, I got a processing exception during a "Render" operation. I think the problem is shown in the following log entries on the server with Adobe Document Services installed (ADS). The application is running on another system (AS1): com.adobe.ad

  • Wacom Mouse crashes Elements 9 Organizer

    Hello, Sorry for my bad English, I'm french I'm trying Elements 9. I use a Wacom Intuos 3 with mouse on one computer, and my old Graphire 3 with mouse on a second computer. I use W7 32bits. On both computer, impossible to use Elements 9 Organizer wit