Function module to add 2 time fields

I've 2 time fields : t1 = 06:00:00 (start time)
                            t2 = 06:00:00 (end time)
                            t3 = 01:30:00 (break time)
              it's basically : t1 + t2 - t3.
the result should be : 21:30:00

Hi Narsingh,
Do like this :
tables  : syst .
parameters :   time1 like  syst-uzeit ,
               time2  like  syst-uzeit .
data :   time3 TYPE  STRING ,time4  TYPE  STRING,time5  TYPE  STRING.
time4  = time1 .
time5  = time2 .
time3  =   time4  +  time5  .
write /(10)  time3 USING EDIT MASK'__:__:__'
or converting the time in seconds, and then adding all the time in seconds and then converting it back to hrs and mins as required....
best regards
Himayat

Similar Messages

  • Function Modules for Data and Time

    Hi all,
              I need 2 function modules for date and time. when we pass current data(sy-datum) and current time (sy-uzeit) into function modules, shoud get date in <b>dd/mm/yyyy or dd.mm.yyyy</b> and time in<b> HH:MM:SS</b> formats.
    Thanks in advance

    Hi Ranjith,
    i think this will b usefull for you..
    SAP Bar Chart Function Modules and what they are used for
    Function module
    Used for
    BARC_GRAPHIC_PBO
    Starting bar chart at PBO time, using a graphic profile (parameter PROFILE)
    BARC_GRAPHIC_PAI
    Analyzing data returned by the graphic
    BARC_SET_TIME_AXIS
    Setting start and end of time axis
    BARC_SET_OPTIONS
    Setting options
    BARC_ADD_CHART
    Creating a chart
    BARC_SET_CHART_ATTRIB
    Setting chart attributes
    BARC_ADD_SECTION
    Creating a section on the time axis
    BARC_SET_SECTION_ATTRIB
    Setting section attributes
    BARC_ADD_RIBBON
    Adding a ribbon to the time axis
    BARC_SET_RIBBON_ATTRIB
    Setting attributes for ribbons in the chart
    BARC_ADD_GRID
    Adding a time grid
    BARC_SET_GRID_ATTRIB
    Setting grid attributes
    BARC_ADD_LAYER
    Adding a layer (graphic elements)
    BARC_SET_LAYER_ATTRIB
    Setting layer attributes
    BARC_ADD_LINE
    Adding a line
    BARC_ADD_CALENDAR
    Creating a calendar
    BARC_SET_CALENDAR_ATTRIB
    Setting attributes for a calendar
    BARC_ADD_TIME_PROFILE
    Creating time profiles
    BARC_SET_TIME_PROFILE_ATTRIB
    Setting attributes for time profile
    BARC_ADD_INTERVAL
    Adding a time interval
    BARC_SET_INTERVAL_ATTRIB
    Setting time interval attributes
    BARC_ADD_TIME_OBJECT
    Creating a time object
    BARC_CONVERT_DATE
    Creating a date string in bar chart format
    BARC_REVERT_DATE
    Converting a date string in bar chart format to date and time
    BARC_ADD_DATELINE
    Creating a date line
    BARC_SET_DATELINE_ATTRIB
    Setting dateline attributes
    BARC_GET_PROFILE_CONTENTS
    Obtaining profile contents for customizing a chart
    BARC_GET_COLUMN_WIDTH
    Selecting new column width
    BARC_SET_COLUMN_WIDTH
    Setting the column width
    BARC_GET_TEXTINDEX
    Obtaining the text index of a field
    BARC_SET_LABELS
    Positioning the chart display
    BARC_SET_COLUMN_ATTRIB
    Setting column attributes
    BARC_SET_ROW_ATTRIB
    Setting row attributes
    BARC_SET_ROW_HEIGHT
    Setting the line height
    BARC_SET_MAXCHARTS
    Setting the maximum number of charts sent
    <b>If its usefull reward points
    </b>

  • FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.

    HI EXPERTS,
         FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.
    PLS DO HELP.....

    Hiii gita
    we have another FM SPELL_AMOUNT
    regards
    Jaipal

  • Need function module to convert system time to local time

    Hi Experts,
    Need function module to convert system time to local time.
    i.e country specific that to in HH:MM format.
    Thanks in advance.

    Dear Prince,
    Kindly check the following link which contains the list of function modules for date and time conversion.
    [http://www.sap-img.com/abap/date-month-pop-related-function-modules.htm]
    Regards

  • Function module to caluculate difference time

    hi friends,
    i need a function module to caluculate the time difference in hours..
    user enters start date and time
                      end date and time
    like
             14.10.2008  10:00:00  ( start )
              15.10.2008  12:30:00 ( end ).
    now the difference   is  26.5 hours..
    i need this ..any function modules..
    Thankyou

    you can use this function L_TO_TIME_DIFF

  • Any function module to update SPRPS (Lock field)

    Hi all,
    Can any one tell if there is function module to update the SPRPS field in the infotype? I failed to update using the HR_INFOTYPE_OPERATIONS.

    you were not able to use LOCKINDICATOR in the FM?

  • BAPI or function module to add/update MRP Area (MDMA table precisely)

    Hi All,
    can any one suggest me the BAPI to add/update MRP Area. I need to update the fields in MDMA table.
    Thanks in Advance,
    KG

    Dear Brahmankar,
    My actual requirement is that I will get an excel sheet with data to be added to MARC and MDMA table. I guess the report you suggest is good for manually updating/creating/deleting MRP area. It will as good as using BDC in MM02 transaction programatically. Doing BDC will be the last option. If I am able to use any function module then it will good I guess. Please correct me, if I am wrong and suggest me how to proceed.
    Thanks and Regards,
    KG

  • Function Module Failing in Run Time

    Hello Friend. Thanks to SDN to get this FM created , but still i have some more issues.  I copied the function module RSAX_BIW_GET_DATA_SIMPLE using SE80 TO Z_CUSTOMERB and also the Function Group I copied from RSAX TO ZCUSTB in SE80 ABAP area.
    <b>Error in SE80 FOR Function Group ZCUSTB: Main program Z_CUSTOMERB does not begin with Function-Pool
    please edit my code and let me know how to fix the code to include FUNCTION-POOL</b>
    But when i go to se37 Activated the FM Z_CUSTOMER and check for any syntax error in FM source code it give no error. But when i run the function module using my datasource rsa3 or execute FM then i get the dump
    dump reasons stated.
    1. FM Z_CUSTOMER is not active and hence cannot be found during run time
    2. Function Library contains incorrect entry for Z_CUSTOMERB
    3. Function Module contains no Code even the FUNCTION ... ENDFUNCTION Missing.
    I checked the code and no errors. Please suggest what should I change in FM Setting to fix the error. where is the function library
    Please revise my code to make it work its very simple logic to populate the custom table se11 ZBW_SFLI001_DS to get the data fields from KNA1 and then fetch other fields from KNB1 where KNA1-KUNNR = KNB1 KUNNR.
    Function Module Code
    FUNCTION Z_CUSTOMERB.
    ""Local Interface:
    *" IMPORTING
    *" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR OPTIONAL
    *" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
    *" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
    *" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
    *" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
    *" VALUE(I_REMOTE_CALL) TYPE SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
    *" TABLES
    *" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
    *" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
    *" E_T_DATA STRUCTURE ZBW_SFLI001_DS OPTIONAL
    *" EXCEPTIONS
    *" NO_MORE_DATA
    *" ERROR_PASSED_TO_MESS_HANDLER
    TABLES: KNA1, KNB1.
    DATA: L_S_SELECT TYPE SRSC_S_SELECT.
    STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,
    S_COUNTER_DATAPAKID LIKE SY-TABIX,
    S_CURSOR TYPE CURSOR.
    RANGES: l_r_zcalweek FOR ZBW_SFLI001_DS-ZCALWEEK,
    l_r_ZKUNNR FOR ZBW_SFLI001_DS-ZKUNNR.
    RANGES: l_r_ERDAT FOR KNA1-ERDAT.
    DATA: zweek LIKE ZBW_SFLI001_DS-ZCALWEEK.
    DATA: ZKNA1 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
    DATA: ZKNB1 LIKE KNB1 OCCURS 0 WITH HEADER LINE.
    DATA: zitab LIKE ZBW_SFLI001_DS OCCURS 0 WITH HEADER LINE.
    IF I_INITFLAG = SBIWA_C_FLAG_ON.
    CASE I_DSOURCE.
    WHEN 'ZBW_SFLI001_DS'.
    WHEN OTHERS.
    IF 1 = 2. MESSAGE E009(R3). ENDIF.
    LOG_WRITE 'E' "message type
    'R3' "message class
    '009' "message number
    I_DSOURCE "message variable 1
    ' '. "message variable 2
    RAISE ERROR_PASSED_TO_MESS_HANDLER.
    ENDCASE.
    APPEND LINES OF I_T_SELECT TO s_s_if-t_select.
    s_s_if-requnr = I_REQUNR. "Step (B)
    s_s_if-dsource = I_DSOURCE. "Step (B)
    s_s_if-maxsize = I_MAXSIZE. "Step (B)
    APPEND LINES OF I_T_FIELDS TO s_s_if-t_fields. "Step (B)
    ELSE. "Initialization mode or data extraction ?
    IF s_counter_datapakid = 0. "Step (C)
    "Begin of Step (D)
    LOOP AT s_s_if-t_select INTO l_s_select WHERE FIELDNM = 'ZCALWEEK'.
    MOVE-CORRESPONDING l_s_select TO l_r_zcalweek.
    APPEND l_r_zcalweek.
    ENDLOOP.
    LOOP AT s_s_if-t_select INTO l_s_select WHERE FIELDNM = 'ZKUNNR'.
    MOVE-CORRESPONDING l_s_select TO l_r_ZKUNNR.
    APPEND l_r_ZKUNNR.
    ENDLOOP.
    LOOP AT l_r_zcalweek.
    CASE l_r_zcalweek-option.
    WHEN 'EQ'.
    CALL FUNCTION 'WEEK_GET_FIRST_DAY'
    EXPORTING
    WEEK = l_r_zcalweek-low
    IMPORTING
    DATE = l_r_ERDAT-low
    EXCEPTIONS
    WEEK_INVALID = 1
    OTHERS = 2.
    l_r_ERDAT-high = l_r_ERDAT-low + 7.
    l_r_ERDAT-sign = 'I'.
    l_r_ERDAT-option = 'BT'.
    APPEND l_r_ERDAT.
    when 'BT'.
    zweek = l_r_zcalweek-low.
    WHILE zweek <= l_r_zcalweek-high.
    CALL FUNCTION 'WEEK_GET_FIRST_DAY'
    EXPORTING
    WEEK = zweek
    IMPORTING
    DATE = l_r_ERDAT-low
    EXCEPTIONS
    WEEK_INVALID = 1
    OTHERS = 2.
    l_r_ERDAT-high = l_r_ERDAT-low + 7.
    l_r_ERDAT-sign = 'I'.
    l_r_ERDAT-option = 'BT'.
    APPEND l_r_ERDAT.
    zweek = zweek + 1.
    ENDWHILE.
    ENDCASE.
    ENDLOOP.
    DELETE FROM ZBW_SFLI001_DS "Step (E)
    WHERE ZREQUNR = s_s_if-requnr.
    SELECT * FROM KNA1 "Step (F)
    INTO TABLE ZKNA1
    WHERE ERDAT IN l_r_ERDAT
    AND KUNNR IN l_r_ZKUNNR.
    SELECT * FROM KNB1 "Step (F)
    INTO TABLE ZKNB1
    FOR ALL ENTRIES IN ZKNA1
    WHERE KUNNR = ZKNA1-KUNNR
    AND ERDAT = ZKNA1-ERDAT.
    LOOP AT ZKNA1.
    zitab-zrequnr = s_s_if-requnr.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = ZKNA1-ERDAT
    IMPORTING
    WEEK = zitab-zcalweek
    EXCEPTIONS
    DATE_INVALID = 1
    OTHERS = 2.
    zitab-ZKUNNR = ZKNA1-KUNNR.
    zitab-ZREGIO = ZKNA1-REGIO.
    zitab-ZFAKSD = ZKNA1-FAKSD.
    READ TABLE ZKNB1 WITH KEY KUNNR = ZKNA1-KUNNR
    ERDAT = zKNA1-ERDAT.
    IF sy-subrc = 0.
    zitab-ZZTERM = ZKNB1-ZTERM.
    ELSE.
    zitab-ZZTERM = 'NULL'.
    ENDIF.
    zitab-ZAKONT = ZKNB1-AKONT.
    ENDLOOP.
    INSERT ZBW_SFLI001_DS FROM TABLE zitab.
    OPEN CURSOR WITH HOLD s_cursor FOR "Step (I)
    SELECT (S_S_IF-T_FIELDS) FROM ZBW_SFLI001_DS
    WHERE zrequnr = s_s_if-requnr.
    ENDIF.
    FETCH NEXT CURSOR s_cursor "Step (J)
    APPENDING CORRESPONDING FIELDS
    OF TABLE E_T_DATA
    PACKAGE SIZE S_S_IF-MAXSIZE.
    IF SY-SUBRC <> 0. "Step (K)
    CLOSE CURSOR S_CURSOR. "Step (L)
    DELETE FROM zbw_sfli001_ds "Step (M)
    WHERE zrequnr = s_s_if-requnr.
    RAISE NO_MORE_DATA. "Step (N)
    ENDIF.
    s_counter_datapakid = s_counter_datapakid + 1. "Step (O)
    ENDIF.
    ENDFUNCTION.
    null

    In the top include for the function group, ensure that the first line is:
    FUNCTION-POOL Z_MY_GROUP.
    Where Z_MY_GROUP is the actual name of the actual function group that your actual function module belongs to.
    Rob

  • Is it possible to add a time field to a booking?

    I want to use the booking module for private consultations based on time. I would like to have different hourly slots available for people to reserve their desired time, but there is no time field on the booking module. Does anyone have any idea how I could do this?

    Hi Guys,
    I have recently developed a booking functionality using a webapp and then tied it into the event module so I can utilise the pre event and post event email tools.
    What your requiring is basically a form to give users an option for time. If you build the webapp so it ties into the event module and then build a form in which the user can specify a time slot i believe that should solve the problem.
    The booking module is for events so we use it to display seminars / networking events etc.
    Hope that helps.

  • Function module to add record into incompletion log of creating sale order

    Hi SD Experts,
    Do you know any function module / class  to add record a into incompletion log procedure of creating / changing sale order process? We can do it through configuration OVA2 but I need to add more condition before adding to this table.
    Thanks,
    Duy

    Hi,
    Refer to The SDN Post : [user exit to update the incompletion log in sales order for pricing error |Re: user exit to update the incompletion log in sales order for pricing error]. 
    Limitation : While creating Sales order, this works only for document type with external number range as the code required for updating XVBUV require Sales Order Number.
    Regards
    Vinod

  • How to run the Function module Parallelly at a time.

    Hi all,
    LOOP AT ITAB.
    call function 'Z_SAMPLE'
    ENDLOOP.
    Here if ITAB is having 4 records, Function module Z_SAMPLE will be runned 4 times one by one .
    My requirement is If ITAB is having 4 record ,Function module should be runned 4 times parallely(parallel process) .
    Please tell me how i can do this  Can i run that statement 4 times by removing the loop or
    Can i Create 4 different jobs and run that jobs at a time if yes please tell me how to creat the jobs and run parallelly.
    Please suggest me the solution
    Please do ask  me if question is not clear
    Thanks in Advance
    Ajay

    Is it possible ?
    DATA : f1 TYPE string VALUE '1',
           f2 TYPE string VALUE '2',
           f3 TYPE string VALUE '3',
           f4 TYPE string VALUE '4'.
    DATA : f1o TYPE string ,
           f2o TYPE string ,
           f3o TYPE string,
           f4o TYPE string.
    PERFORM call_fm USING f1 CHANGING f1o.
    PERFORM call_fm USING f2 CHANGING f2o.
    PERFORM call_fm USING f3 CHANGING f3o.
    PERFORM call_fm USING f4 CHANGING f4o.
    WRITE f1o.
    WRITE f2o.
    WRITE f3o.
    WRITE f4o.
    *&      Form  CALL_FM
    *       text
    *      -->P_F1  text
    FORM call_fm  USING f1 CHANGING f1o.
    * FUNCTION Z_TEST_MULTI.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(A) TYPE  STRING OPTIONAL
    *"  EXPORTING
    *"     VALUE(B) TYPE  STRING
    *b = a.
    *ENDFUNCTION.
      CALL FUNCTION 'Z_TEST_MULTI'
        EXPORTING
          a = f1
        IMPORTING
          b = f1o.
    ENDFORM.                    " CALL_FM

  • A function module to add an entry to the change log of the ODS needed

    Hi all,
    I want to add an entry to the change log table of the ODS .
    Is there a Function module available for this or a work around for this.
    Regards
    Akshay

    Hi Kiran,
    You can directly add days to the date.
    Eg:
    DATA date LIKE sy-datum.
    DATA days TYPE i.
    date = sy-datum.
    days = 100.
    date = date + days.
    WRITE date.
    Regards
    Wenceslaus

  • Require a function module to add days to a date?

    My purpose is to add days to a particular date and get the resulting date. I tried using this function module "RP_CALC_DATE_IN_INTERVAL", but the problem is this function module only accepts two digits for days. i.e. i am only able to add a maximum of 99 days to a particular date, but i do want to go further and add more so please tell me if there is any function module which shall help me add 3 digit days to a date.

    Hi Kiran,
    You can directly add days to the date.
    Eg:
    DATA date LIKE sy-datum.
    DATA days TYPE i.
    date = sy-datum.
    days = 100.
    date = date + days.
    WRITE date.
    Regards
    Wenceslaus

  • Function Module that will retrieve the Field Catalogs of a Display Variant

    Hello Experts,
    Are there any function modules that I can use to retrieve the field catalogs (fields to be displayed in ALV report) by passing the display variant name?
    An RFC needs to apply this to determine which field(data) to be passed to XI (calling system) depending on user login.
    Thanks in advance!

    These are the various FM available for Variants (field Layout)
    REUSE_ALV_VARIANT_ALL_MAINTAIN Maintain all display variants for one object
    REUSE_ALV_VARIANT_DEFAULT_GET  Read default display variant (description only, w/o field catalog)
    REUSE_ALV_VARIANT_EXISTENCE    Checks whether a display variant exists
    REUSE_ALV_VARIANT_F4           Display variant selection dialog box
    REUSE_ALV_VARIANT_MAINTAIN     Definition of a display variant outside the list context
    REUSE_ALV_VARIANT_SAVE         Save a display variant
    REUSE_ALV_VARIANT_SELECT       Read a display variant
    Regards,
    Amit

  • Function module to convert to time stamp format

    Hi friends,
    can you tell me any function module to convert date and time to time stamp format?
    kind regards.

    Just use 
    CONVERT DATE d
    TIME t [DAYLIGHT SAVING TIME dst]
    INTO TIME STAMP tst
    TIME ZONE tz.
    look at this example
    DATA:
    tstamp type timestamp,
    d TYPE D VALUE '19971224',
    t TYPE T VALUE '235500'.
    SET COUNTRY 'US'.
    CONVERT DATE d TIME t INTO
    TIME STAMP tstamp TIME ZONE 'UTC+12'.
    " tstamp : 19971224115500
    " (12/24/1997 11:55:00)
    CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO
    DATE d TIME t.
    Also look at the blog..
    /people/himanshu.gupta/blog/2006/11/14/abap4-date-time-and-timestamps
    Raja T
    Message was edited by:
            Raja Thangamani

Maybe you are looking for

  • Require netpoint 5.9?

    could u tell me the link. where i find the net point  5.9 tool?

  • Timer class and javax.......

    Hi, Downloaded the latest java version to d:\download folder. The downloaded file has the name " j2re-1.4.2_03-wndows-i586-p.exe ". The file size was about 14.53MB. Double clicking the same installed j2re1.4.2_03 in "C:\Program Files\java\j2re1.4.2_0

  • Interactivity in Book with single page documents

    I'm currently working with a book, with single page documents. I'm trying to use the interactivity features for buttons in CS5.5 I was able to get pages 2-5 to link to the first page, which we have set up as the table of contents. However, I'm having

  • Pen pressure not recognized on samsung tablet

    i just got a new windows 8 tablet and thought I would try photoshop to see how the pen works vs. my wacom. i cannot get any pressure control in cs6. I checked with samsung and the driver is up to date and the pen works in one note and ms photo but no

  • Cannot access apple support

    I bought a refurbished 2nd generation ipod shuffle 3 months ago. It now is completely nonfunctional and I have been on hold for over one hour on the phone with the "support" from apple. I have tried to email them for help, but there does not seem to