Is there a function to calculate the period range?

E.g. the program input the 10.2008 - 01.2009 (MM/YYYY), so how can the program knows there are 4 months: 10/08, 11/08,12/08, 01/09 between them?
Is there function can do so?
P.S. yes it can be done, if calculate it manuly via while(in ABAP) clause

Hi,
Check this code..
DATA: V_FROM(6) TYPE N VALUE '200810'.
DATA: V_TO(6) TYPE N VALUE '200901'.
DATA: V_DATE TYPE D.
* Get the periods.
DO.
  CONCATENATE V_TO '01' TO V_DATE.
* Decrease one day.
  V_DATE = V_DATE - 1.
  WRITE: / V_DATE(6).
* Exit condition.
  IF V_DATE(6) = V_FROM.
    EXIT.
  ENDIF.
ENDDO.
Thanks,
Naren

Similar Messages

  • IS THERE A FUNCTION TO RETURN THE NUMBER OF MONTHS OR DAYS?

    I know that you can do a months between function between 2 dates divided by 12 and get years but is there a function that can return the number of months between 2 dates or the number of days between 2 dates in a select statement for a report? These 2 dates are entered in an Oracle forms.
    I have 2 dates.
    BEG_SVC_DT 30-JUL-1995 DATE FORMAT
    END_SVC_DT 981007 VARCHAR2 FORMAT Positions 5 and 6 are the days.
    I must subtract BEG_SVC_DT from END_SVC_DT.
    In PLSQL I add 31 to 07 and get 38. I subtract 30 from 38 and get 8.
    or I have 2 dates
    BEG_SVC_DT 10-JAN-2003 DATE FORMAT
    END_SVC_DT 050924 VARCHAR2 FORMAT Positions 5 and 6 are the days.
    I must subtract BEG_SVC_DT from END_SVC_DT.
    In PLSQL I subtract 10 from 24 and get 14.
    In both scenarios the end_dt field must be VARCHAR2 because the user has to enter the word 'PRESENT' . Is there a function in SQL that would compute the
    number of days between 2 dates?
    Is there a function to get the number of months between 2 dates?
    I have 2 dates.
    BEG_SVC_DT 12-JUL-2004 DATE FORMAT
    END_SVC_DT 050807 VARCHAR2 FORMAT Positions 3 and 4 are months.
    I must subtract BEG_SVC_DT from END_SVC_DT
    JUL is the 7th month.
    In PLSQL, I subtract 07 from 08 and get 01
    Or I have 2 dates
    BEG_SVC_DT 13-NOV-2004 DATE FORMAT
    END_SVC_DT 050429 VARCHAR2 FORMAT Positions 3 and 4 are months.
    I must subtract BEG_SVC_DT from END_SVC_DT.
    NOV is the eleventh month. 04 is less than 11.
    In PLSQL I have to add 12 to 04 and subtract 11 from 16 to get 05.
    In both scenarios, the end_dt field must be VARCHAR2 because the user has to enter the word 'PRESENT'. In SQL, is there a function to compute the number of months between 2 dates?
    I am doing my calculations this way because this is the way that the user has been doing them when they created the report manually.
    The database that I am using is Oracle 9.2.0.6
    Report Writer Report Builder 6.0.8.22.0
    Forms 6.0.8.22.1

    In your example:
    BEG_SVC_DT 30-JUL-1995 DATE FORMAT
    END_SVC_DT 981007 VARCHAR2 FORMAT Positions 5 and 6 are the days.
    I must subtract BEG_SVC_DT from END_SVC_DT.
    In PLSQL I add 31 to 07 and get 38. I subtract 30 from 38 and get 8.
    Where is the "31" depending on, on year and month of BEG_SVC_DT or END_SVC_DT?
    What would be the answer for the following example
    BEG_SVC_DT 25-FEB-1995 DATE FORMAT
    END_SVC_DT 980407 VARCHAR2 FORMAT
    Do I add 28 (=number of days in FEB-1995),
    or 30 (=number of days in APR-1998),
    or 31 (= max number of days in any month?)

  • Is there a function to get the IP of this remote system

    Hello EveryBody
    Currently I have an application that runs on our network. When someone logs on to the network it checks there system and gets the pc name. I would like to also get the IP address of that system. As well I may later like to ping that computer.
    1) Is there a function to get the IP of this remote system?
    2) IS the a function to ping a remote system and receive back the response?
    Thanks a lot.
    R

    Hello EveryBody
    Currently I have an application that runs on our
    network. When someone logs on to the network it
    checks there system and gets the pc name. I would
    like to also get the IP address of that system. As
    well I may later like to ping that computer.
    1) Is there a function to get the IP of this remote system?
    2) IS the a function to ping a remote system and
    receive back the response?Is this lan only?
    Because if wan or internet then the remote computer would have to have an address that is reachable from your computer. For the internet this would mean it would have to be public. And for a wan the IP would have to be unique across the wan.

  • Is there any function to change the width of forms'graphic ?

    Hi All,
    Is there any function to change the width of forms'graphic ?
    May be like set***property.
    Thanks,
    ke xiong

    No. Graphics cannot be handled at runtime.
    Francois

  • Is there any function to change the width of froms'graphic ?

    Hi All,
    Is there any function to change the width of froms'graphic ?
    May be like set***property.
    Thanks,
    ke xiong

    Hi;
    For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Application Development in PL/SQL » Forms which you can get more quick response
    Regard
    Helios

  • Is there any function module getting the cpu type?

    Is there any function module getting the cpu type?

    I guess the database server...
    I would like to get the SAP system cpu type as done in transaction st06 under system information.
    Thanks.

  • Is there a function to predict the next point accoding to the known point?

    For example
    ten points arranged in a parabola,
    is there a function to predict the coordinates of the six point behind according to the four points in front of?

    The ability to predict data values is predicated on your data having some sort of inherent structure. In cases where your data has that structure, curve fits can be very helpful. However, if your data does not have any inherent structure, or is too noisy to
    be able to see the structure, you can run curve-fits and still get results
    that look reasonable. Unfortunately those results would probably correlate better with the
    phase of the moon than they would what you are measuring. No matter how fancy, mathematics can only predict a probable value based on what it was given - and as in all things computer: GIGO. Hence, when working with this sort of thing, I always bear in mind this definition of a pocket calculator:
    "...a device that can divide a ball park estimate by a wild-ass guess and come up with an answer accurate to 13 decimal places..."
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Is there a function to open the outlook mail and to attach certain..

    Hello,
    Is there a function to open the outlook mail and to attach certain selected files?

    here is a code snippet from one of our programs
      data: out type ole2_object,
            outmail type ole2_object,
            att type ole2_object,
            atts type ole2_object.
          create object out 'Outlook.Application'.
          call method of out 'CREATEITEM' = outmail
            exporting
              #1 = 0.
          set property of outmail 'SUBJECT' = 'Smartform Output from SAP'.
          call method of outmail 'ATTACHMENTS' = atts.
          call method of atts 'ADD'
            exporting
              #1 = p_file.
          call method of outmail 'DISPLAY'.
    in our case, we save the data to a local file with the path p_file.
    so, we create the attachment on a local drive, at path p_file
    we open outlook
    we create a mail item
    we set the subject
    we add the attachment
    and we call disply, to pop the email up for any changes the user wants to make.
    in other programs we also use
      set property of outmail 'TO' = alvline-prc_email.
    to set the TO address of the email
    hope this helps

  • Is there any function to get the name of the days?

    Hi,
    I'm using oracle 10.2.0.1.0
    Is there any function to get the days of the week?
    like i need to get sunday,monday,tuesday.....saturday.
    I know i can use union and select the name from dual one by one.
    But just want to know whether there is any other way.
    I need to show the 7 days in a poplist in my form, thats the requirement
    Thanks

    David_Aldridge wrote:
    BluShadow wrote:
    Note: you may want to include "fm" in the format mask, otherwise the name of the day is padded with spaces:
    SQL> ed
    Wrote file afiedt.buf
    1  select replace(to_char(dt,'Day'),' ','*') as fmt1
    2        ,length(to_char(dt,'Day')) as length_fmt1
    3        ,replace(to_char(dt,'fmDay'),' ','*') as fmt2
    4        ,length(to_char(dt,'fmDay')) as length_fmt2
    5  from (select TRUNC(SYSDATE ,'DAY')+Level-1 dt
    6        from   dual
    7        connect by Level<8
    8*      )
    SQL> /
    FMT1      LENGTH_FMT1 FMT2      LENGTH_FMT2
    Monday***           9 Monday              6
    Tuesday**           9 Tuesday             7
    Wednesday           9 Wednesday           9
    Thursday*           9 Thursday            8
    Friday***           9 Friday              6
    Saturday*           9 Saturday            8
    Sunday***           9 Sunday              6
    7 rows selected.
    SQL>
    I think you should use a pl/sql function for this.
    Nah ... just joking.
    I'd be tempted to just use a union all statement to return the seven literals. People will look at it and know exactly what it does.Yeah, agreed, I was just demonstrating that the format mask of a to_char(..., 'Day') pads with spaces, which seems to have been missed in the above answers. ;)

  • Are there any functional differences between the trial and the paid version?

    Are there any functional differences between the trial and the paid version for Labview 2009?  Thank you.
    Solved!
    Go to Solution.

    This outlines the limitations of the eval version of Labview: Limitations of the LabVIEW Evaluation Version
    Cheers, 
    Misha

  • Is there a function to adjust the touch on the touch screen?   Its been very sensitive lately

    iphone has been very sensitive to my touch.  Is there a setting or function to adust the touch on the touch screen?

    Based upon your OP, I don't think Assistive Touch is what you want.  For more info on AT, see p. 155 of the User Guide.
    For your problem, try cleaning the screen and/or removing your screen protector.  It's a long shot but quick and easy to do.
    If still a problem, try restoring with your backup.
    FYI, there is no adjustment for the touch screen sensitivity.

  • Calculate the date range from entered date

    HI
    My requirement is to get the data in a perticular intervals of posting date.
    Directly we can create a variable with interval on posting Date to have the required data but Here we need two have two varibles because in one varibale user enters posting date and in second variable user enters any number like 1,2,3....etc
    Let's say user enetered posting date as 30.08.2010 in the first variable and number 4 in the second variable.
    Finally out put range should be calculted from entred posting date 30.08.2010  date to four days back  
    i.e output  should be appear in the report  from 27.08.2010 to 30.08.2010.
    My question i can create first avariable on posting Date but  where shoud i create the second variable on which field.
    Please help me on this..points will be awrded.
    Regards,
    Siva Thottempudi.

    R you talking about the below to create new variable on the existing key figure
    Selecting Variables
    When you select characteristic values in the query definition, you can also select variables instead of fixed values. These act as placeholders and are only filled with fixed values when the query is executed.
    When selecting variables, you can also define new variables, change variables, or delete variables. These functions are always available to the right of the selection of the variable type.
    Selecting Variables
    1.      Choose Show ® Variables.
    2.      Under Type, select the variable type (such as Characteristic Value Variable, Hierarchy Node Variable) from which you want to select the variable.
    3.      Select one (or, in exceptional cases, more than one) variable from the list of available variables in the left window and add them (using the right arrow) to the right Selection window.
    Selecting Variable Value Range Limits
    1.      Choose Show ® Value Ranges.
    2.      Select your required operator from the dropdown box. You can choose from the following operators:
    ○       Between
    ○       Less Than or Equal to
    ○       Greater Than or Equal to
    ○       Less Than
    ○       Greater Than
    3.      Select the required value or values for the value range and choose . The input help appears in a new dialog box and displays the selection of variables under Show  ® Variables.
    4.      Under Type, select the variable type (such as Characteristic Value Variable, Hierarchy Node Variable) from which you want to select the variable.
    5.      Select the required variable and choose OK.
    6.      For the Between operator, two single values are required for the interval limits; the system automatically displays two dropdown boxes. In this case, repeat steps 3-5.
    7.      After you have set the value range, choose OK.
    8.      Add the selection to the right Selection window using the right arrow.

  • Is there a way to hide the account ranges when creating a web-adi for budgets?

    Hi,
    I'm trying to create budgets for an end-user. The user doesn't want to see all account ranges defined for that budget organization and would like to populate them on his own. I can hide the account ranges in the document creation page but not in the web-adi excel file. Is there a way to do hide the account combinations from being displayed in the excel file?

    you'd have to disable javascript - but this won't be a very practical solution since many sites are broken without it. you can use an extension like [https://addons.mozilla.org/de/firefox/addon/noscript/ noscript] & do a whitelist approach - disable js by default and only allow it on sites that you trust/need.
    here's some more stuff that websites can find out about you: [http://browserspy.dk]

  • Is there a way to calculate the area of a shape?

    I work in toy packaging and the size of the warning we have to use is dictated by the size of the package. On most items, it's pretty straight forward, LxW... But that doesn't always work, as the packaging isn't always that simple. Is there a way to get Illustrator to give me the area of a shape?
    Thanks!

    Jacob
    It worked very well - great stuff!. I am a physician and I am working on cardiac MRI.. such as calculating the heart function using slices of heart images in systole and diastole (when the heart is squeezed or full of blood).
    .. we can write a little medical paper comparing really pricey software (GE, Siemens, Medis you name it..) with this method for people with not too many pennies in their pocket. The advantage of using Illustrator is that you can blow up the images up to the point of loosing resolution, and trace the margins of the heart with an accuracy that would make any GE guy cry for his mama..
    I thought even a cm further.. for simple-minded people (such as physicians for example) one would like a way to input the area of one slice directly into an equation. For example would be a way to create a routine that would take the number of the area of one slice and input it in this equation? Such as to create a little square where you put the slice, you trace it and then the program takes that number and pitches it in the equation without you writing it down on a paper.
    thanks again!
    Avi

  • Is there a function to output the crossing point of two plotted lines

    I got some data plotted on a graph, I need to find the crossing point  of the plotted lines on the graph (The plotted data curves are not linear lines) and detect it by an indicator. I could compare the to data arrays plotted and output the two closest data numbers, but the really crossing pionts is sertainly an intercept of two Interpolated values made by the graph, wich are not in my data buffers. any suggestions will be full Stared   
    Zamzam
    HFZ

    I only did a cursory look and didn't find any built-in function that jumped up screaming "I'm it! I'm it!", but that doesn't mean something doesn't exist given the large number of functions available with LabVIEW. An alternate solution is to use linear interpolation between successive points. If the points are close together then you can assume a straight line between the points and break this down to the simple case of finding the intersection of two lines, which is trivial. Not sure how computationally intensive of an algorithm this would be, and there would clearly be some error involved, and you will need to determine if the error is tolerable for you.

Maybe you are looking for

  • ITunes 7.7 - Error Message: AppleMobileDeviceHelper has stopped working

    Can anyone help with the above problem. I installed 7.7 two days ago and now cannot stop these error messages from popping up. I can play iTunes, but the whole time it is running this message pops up repeatedly. So far I have let it get to about nine

  • Properties does have getProperty method

    I have this code but the Properties does have the method getProperty() import java.io.*; import java.sql.*; import java.util.*; public class TestCode {     static final String PROPERTY_FILE="JDBC-ODBC Driver.properties";     String driverName, url, u

  • Error using the MDM Java Connector

    Hi All, I am developing a Web Dynpro type DC where I need to use MDM, I tried to reach MDM repository using the following code: import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.resourc

  • How to install garageband on original iPad ?

    I just purchased garageband without realizing it is not compatible with original iPads. Came across article on web suggesting that I should be able to download an older version of the app as long as I own the current version. Which I do. Have spent p

  • InDesign CC crashes when placing text

    Hi, InDesign CC updated to latest version and noticed it crashes every time i try and place a text file onto the document. I have uninstalled and then used CC Cleaner, removing preferences and manually deleting the folder. Have tried this several tim