Function Module for separating a date range into days

Hi all,
Does anyone know if there is a function module which gives back the list of days when we give a date range as input parameter to the function module. For example, we enter the range 10.07.2006 - 13.07.2006 and the function module gives back a table  in form 10.07.2006, 11.07.2006, 12.07.2006, 13.07.2006.
Thanks,
Sükrü

Hi suekrue,
1. Exactly for this purpose,
   i have written an
   INDEPENDENT FORM (subroutine)
  wherein we pass
   a) fromdate
   b) todate
   c) ITAB
2. and it gives all the dates in the internal table.
3. just copy paste
4.
data :  itab type table of sy-datum with header line.
parameters : fromdate type sy-datum default '20060701'.
parameters : todate type sy-datum default sy-datum.
perform getdays tables itab using fromdate todate.
break-point.
FORM
form getdays
tables itab
using fromdate todate.
  data : curdate type sy-datum.
  curdate = fromdate.
  do.
    if curdate > todate.
      exit.
    endif.
    itab = curdate.
    append itab.
    curdate =  curdate + 1.
  enddo.
endform.                    "getdays
regards,
amit m.

Similar Messages

  • Function module for transfering a file contents into another?

    Hi all,
       Is there a Function module for transfering a file contents into another?That is the whole content from a file to other??
    Regards,
    Shashank.

    Hi,
    I think there is no such FM. You need to read the data in internal table and then write it in another file.
    Regards,
    Atish

  • Function module for access OM Data from infotype 1001

    We had a function module for accessing OM data viz. Infotype 1001. Could you let me know.
    Advanced thanks,
    Dasaradh kosana

    Hi Dasaradh,
          Do you want the fm which fetches the data from HRP1001 , if this is the case you can use this FM RH_READ_INFTY_1001.
    Reward Points if it is helpful
    Regards,
    Kiran I

  • Function module for F4 help in ranges.

    The function module COMPLEX_SELECTIONS_DIALOG is used for providing the multiple selection popup screen for a particuler field.Now the problem is F4 help is not availble for each row in the multiselection pop up screen if the field refers to a custom table's field.But it is available if it refers to standard table.
    Please suggest if there is nayway to do this or is there any other alternative function module.
    Thanks!
    Savitha.

    Hi
    Have you assigned the CUSTOM table as a CHECK table against the fields of the row.
    Or declare as a master data table fields to see the F4 help.
    Or use the fun module F4IF_INT_TABLE_VALUE_REQUEST
    see the sample code
    See the following ex:
    TYPES: BEGIN OF TY_MBLNR,
    MBLNR LIKE MKPF-MBLNR,
    END OF TY_MBLNR.
    DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.
    data: it_ret like ddshretval occurs 0 with header line.
    At selection-screen on value-request for s_mat-low.
    Select MBLNR from mkpf into table it_mblnr.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    DDIC_STRUCTURE = ' '
    RETFIELD = 'MBLNR'
    PVALKEY = ' '
    DYNPPROG = ' '
    DYNPNR = ' '
    DYNPROFIELD = ' '
    STEPL = 0
    WINDOW_TITLE =
    VALUE = ' '
    VALUE_ORG = 'S'
    MULTIPLE_CHOICE = ' '
    DISPLAY = ' '
    CALLBACK_PROGRAM = ' '
    CALLBACK_FORM = ' '
    MARK_TAB =
    IMPORTING
    USER_RESET =
    TABLES
    VALUE_TAB = IT_MBLNR
    FIELD_TAB =
    RETURN_TAB = IT_RET
    DYNPFLD_MAPPING =
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 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.
    IF SY-SUBRC = 0.
    read table it_ret index 1.
    move it_ret-fieldval to S_mat-low.
    ENDIF.
    Go through the test program.
    REPORT Ztest_HELP .
    TABLES : MARA.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_MATNR(10) TYPE C.
    SELECTION-SCREEN END OF BLOCK B1.
    DATA : BEGIN OF ITAB OCCURS 0,
    MATNR TYPE MATNR,
    END OF ITAB.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.
    SELECT MATNR
    FROM MARA
    INTO TABLE ITAB
    UP TO 10 ROWS.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    RETFIELD = 'MATERIAL NUMBER'
    DYNPPROG = SY-REPID
    DYNPNR = SY-DYNNR
    DYNPROFIELD = 'P_MATNR'
    VALUE_ORG = 'S'
    TABLES
    VALUE_TAB = ITAB
    EXCEPTIONS
    PARAMETER_ERROR = 1
    NO_VALUES_FOUND = 2
    OTHERS = 3. 
    Regards
    Anji

  • Function Module for Changing delivery date

    Hi Friends ,
        I am held up with a scenario of changing the delivery date while creating purchase order. Could you please suggest any function module to change the delivery date in purchase order if it is less than 5 days.
    With Regards ,
    Sudhir S
    Moderator message: please do some own research before asking.
    Edited by: Thomas Zloch on Feb 21, 2011 11:45 AM

    Hi praveen for u r requirement there is no need of any FM
    Try this code
    parameters:
      p_date like sy-datum,
      p_no type i.
    data:
      w_date like sy-datum.
    w_date = p_date - p_no.
    write: / w_date .
    it is enogh for u r requirement
    plzz reward if it is usefull...
    for any further quiries my mail id is [email protected]
    plzz dont forget to reward

  • Function module for converting German Data/Time to Indian Date/Time

    Dear All,
    My requirement is to convert German date and time to Indian date and time. Is there any function module available or any way we can get it?
    Thanks and regards,
    Atanu

    hi,
    first get the timezone of that country
    CALL FUNCTION 'TZON_LOCATION_TIMEZONE'
          EXPORTING
            if_country        = p_it_userid-zcountry
          IMPORTING
            ef_timezone       = l_tzone
          EXCEPTIONS
            no_timezone_found = 1
            OTHERS            = 2.
    then use the below statements
    -- Convert from server time to GMT
          CLEAR l_tstmp.
          CONVERT DATE l_datum
                  TIME l_ctime
             INTO TIME STAMP l_tstmp TIME ZONE sy-zonlo.
    *-- Convert from GMT to user backup time
          CONVERT TIME STAMP l_tstmp TIME ZONE it_usr_timezone-ztzone
            INTO DATE it_usr_timezone-zdate
                 TIME it_usr_timezone-ztime.

  • Function module for move internal table records into MSexcel file

    Hi all,
    Tell me the function module which is used to
    move internal table records in to MSexcel file.
    Give the sample program...

    Please search the forum for FM  "GUI_DOWNLOAD" You will get tons of threads with sample code.
    Also take a look into SAP_CONVERT_TO_XLS_FORMAT
    Thanks

  • Function Module for getting J1IEX Data

    Dear All,
    Is there any F.M available for getting details whatever is posted in  J1IEX, like ED, Ecess, HEcess etc.
    regards,
    paras
    Point Assured.

    Hi,
    I'm not sure what you mean with 'textmodule' but try with function module READ_TEXT.
    Regards,
    Eduardo

  • Tables, function modules for variant config data

    Hi all,
    I need to extract characteristics and values for variant material from sales order and production orders. Could you please tell me the relevant tables and function modules?
    Regards,
    Sachin M

    Hi
    Try the following;
    Function module to find values of characteristics - CLAF_CLASSIFICATION_OF_OBJECTS .
    Table # AUSP also holds values of characteristics, you can link to it via table INOB,which should also linked to table KONDH if you are using the same.
    Transaction code for Variant Config - CC04 (Product Structure browser)
    Cheers
    Chandra

  • CONVERT   DATE RANGE INTO MONTHS

    HI FRIENDS,
    ACTUALLY IN MY SELECT-OPTIONS I HAVE USED DATE BETWEEN 03/06/1980  TO 04/12/1980
    BASED ON THIS DATE I HAVE TO CALCULATE NUMBER OF MONTHS.
    WILL THIS BE DONE AUTOMATICALLY OR I NEED TO WRITE ANY CODE FOR CONVERTING THE DATE RANGE INTO NUMBER OF MONTHS.
    REGARDS
    SIRI.

    Hi,
    Use FM's : MONTHS_BETWEEN_TWO_DATES_NEW
               MONTHS_BETWEEN_TWO_DATES
               FIMA_DAYS_AND_MONTHS_AND_YEARS
    Sample code :
    DATA : x_no_months type i.
    DATA : x_stdat like sy-datum,
           x_enddat like sy-datum.
           x_stdat  = s_date-low
           x_enddat = s_date-high
    CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
        EXPORTING
          i_datum_bis = x_stdat
          i_datum_von = x_enddat
        IMPORTING
          e_monate    = x_no_months.
    x_no_months will contain no.of months.
    Regards
    Appana

  • Function module for year todate

    Hi ,
    Here i am looking for a functiona module for year to date (YTD ) .
    For example fiscal year is Apr 2010 to till date we need to have the information . to get this kindly suggest the FM .
    Thanks
    Venkat

    Hi
    Please take some pain in searching on Forum.
    However have a look at this link but make sure you search for available information on SCN for all your future basic queries.
    [http://wiki.sdn.sap.com/wiki/display/ABAP/FunctionModulerelatedonDate+calculations]
    Regards
    Abhii

  • 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 Modules for Date

    Hi ALL,
    I would like to know the various function modules that can be used for calculating dates.Like first day of month,last day.....etc etc.
    Please give me a list of the FM's and not the F4 help option info.
    Cheers

    Hi ,
    Here are a few FM used for date manipulation
    <b>DATE_IN_FUTURE  </b>                   Add / Substract days from a given date
    <b>HR_SGPBS_ADD_TIME_TO_DATE</b>     Find the next date based on input date , addition / sub and month , year ,date
    <b>CONVERT_DATE_TO_EXTERNAL</b>     Convert date to External format
    <b>SG_PS_ADD_MONTH_TO_DATE</b>     Find the next date based on input date , addition / sub and month , year ,date
    <b>DATE_COMPUTE_DATE</b>     For a input date gives the day of the week
    <b>DATE_GET_WEEK</b>For an input date ,gives the week as output
    <b>WEEK_GET_FIRST_DAY</b>     Input year and week output is the first day of the week
    <b>WEEKDAY_GET</b>     Gives the day range , Monday , Tuesday ,…..
    <b>RP_CALC_DATE_IN_INTERVAL</b>     Calculate Future Date
    <b>CALCULATE_DATE</b>     Calculate Future Date
    <b>FIMA_DAYS_AND_MONTHS_AND_YEARS</b>     Difference between two dates
    <b>CONVERSION_EXIT_PDATE_INPUT</b>     It checks if the date is in future , if yes an error is displayed
    Reagrds
    Arun

  • Function Modules for Format Date, Month Name and Quarter value.

    Hi All,
    1. I am getting the date field from the Flatfile, so i need to format the date to YYYYMMDD. Is there any Function module for that in BW.
    2. Based on the above Formated Date i have to find out the Name of the Month like JANUARY, FEBUARY etc.
    3. Based on the same above Formated Date i need to find out the Quarter like 1, 2 etc.
    Could you please let me know if any function modules are there for the above questions in BW not in ABAP, why i mention is some Function modules are there in ABAP but not in BW.
    Thanks in advance.
    Regards,
    srinivas

    Hi ,
    1.If your input date format is MMDDYYYY then Use SDATE as conversion routine in trans strucutre to convert into YYYYMMDD.
    2.By passing year as input parameter for the following FM you would get all the months with text.Using READ statement in routine you can get month name
    MONTH_NAMES_GET
    3.For Quarters you can use the following FM:
    TSTR_PERIODS_QUARTERS
    hope it helps...
    regards,
    Raju

  • Function module to determine the date for the nth weekday of the mth month

    Hey folks,
    Is there a function module which determines the date for the mth weekday of the nth month in the pth year.
    For instance, if I input 2nd thursday of the 4th month in 2008, it should return me, 04/10/2008  (MM/DD/YYYY).
    Thanks and Best Regards,
    Puja.

    Hi Ravi,
    Hadn't been able to work on this lately...You solution was quite close, but did not work for a few scenarios....I tweaked the logic a bit to take care of them as well...
    So here goes the code:
    ================================================
      DATA first_day_of_month TYPE datum.
      DATA day TYPE p.
      CONCATENATE year month '01' INTO first_day_of_month.
      CALL FUNCTION 'DAY_IN_WEEK'
        EXPORTING
          datum = first_day_of_month
        IMPORTING
          wotnr = day.
      DATA day_number TYPE numc2.
      IF day = weekday.
        IF recur = 1.
          DATA ls_date(10) TYPE c.
          CONCATENATE month '/01/' year INTO ls_date.
          CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
            EXPORTING
              date_external                  = ls_date
           IMPORTING
             date_internal                  = date.
        ELSE.
          day_number =  ( ( recur - 1 ) * 7 )  + 1.
        ENDIF.
      ELSEIF day < weekday.
        day_number = ( ( recur - 1 ) * 7 ) + ( weekday - day ) + 1.
      ELSE.
        day_number = ( ( recur - 1 ) * 7 ) + ( 7 - day ) + weekday + 1.
      ENDIF.
      IF date IS INITIAL.
        CONCATENATE year month day_number INTO date.
      ENDIF.
    ====================================
    There still could be some loopholes in this....am not sure....but it sure did seem to work for a couple of random checks that I performed.
    Brownie points to you for giving me a direction.
    Thanks,
    Puja.

Maybe you are looking for

  • Bluez / Bluez4

    Hello Guys, today I tried to install bluez, however I fail at the gnome-bluetooth applet. It's not possible to remove it, since gnome-bluetooth needs it and gnome-shell needs gnome-bluetooth. But: shouldn't gnome now depend on bluez (5) instead of bl

  • How do I keep my ipad keyboard black

    How do I keep my ipad keyboard black

  • How to call webservices from IDM

    Hi, can anyone provide some documents how to call a web service from IDM 7.1 Thanks in Advance Regards, mary

  • How to download adobe standard 11

    how to download adobe standard 11 setup

  • PC Library updating ?

    All, Can't seem to get the PC (XP O/S) to update it's library on iTunes - hence all the deleted & moved tracks still show up (deletions & moves done after iTunes installed & done with XP Explorer), even tried unistall of iTunes. NO GO. Starting to ti