Skip to Content
author's profile photo Former Member
Former Member

reg caluclating date range?

hi friends

my requirement is i have to retrive data based on the one month date range given on the date in my selection screen . how to caluclate one month range for the given date ? is there any function module available ? can i use hr function modules in abap ?

thanks & regards

deepurd

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 16, 2008 at 06:05 AM

    Hi,

    FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.

    DAY_ATTRIBUTES_GET : Returns attributes for a range of dates specified

    MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.

    use any of the above fm as per your requirement.

    you can use hr fm also in abap.

    Rgds,

    BabuSrinath

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      First You told this;

      >

      >actually my requirement is i have to retrieve the data which is entered from the last one month of given date >in selection screen? whatsthe function module for getting this

      >ex: suppose i given 20-11-2008

      >i have to retrieve the data between 20-10-2008 to 20-12-2008

      Now you are telling this;

      >

      > hi sravanthi

      > when i was trying to use the HR function module its giving dump .

      > my requiremnt is

      > if selection screen input date is 25-12-2008 i have to retrive documents posted within 1 month range . data between 24-11-2008 to 25-12-2008.

      >

      > regards

      > deepurd

      Do you know that thus you are effectively wasting yours as well as others time? Can't you use the above codings and FM's given by all to achieve your requirement. First of all you come to a conclusion on what you want, then you can arrive at the solution using all the above inputs and ideas.

      Regards

      Karthik D

  • author's profile photo Former Member
    Former Member
    Posted on Dec 16, 2008 at 06:00 AM

    Hi,

    Derive year and Month of the date using CACS_DATE_GET_YEAR_MONTH and use the below FM for first and last day of the month:

    FIRST_AND_LAST_DAY_IN_YEAR_GET
    

    Thanks,

    Sriram Ponna.

    Edited by: Sriram Ponna on Dec 16, 2008 11:31 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 16, 2008 at 06:30 AM

    Hi,

    Use FM BKK_GET_MONTH_LASTDAY to get the last day of the month and use the following code to get the first day of month.

    first_day = date.
    first_day+6(2) = '01'.

    Regards

    Karthik D

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 16, 2008 at 07:18 AM

    hi deepu,

    You can use HR function modules but you need to to diclare some sturcture before using any hr function modules like tables: pernr.

    i have an doubt about your requirement

    do you want 30days in a month or as per calender month.

    can you tell me which one do you want

    Regards,

    Arjun.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 08:59 AM

    hi deepu,

    You can use HR function modules but you need to to diclare some sturcture before using any hr function modules like tables: pernr.

    i have an doubt about your requirement

    do you want 30days in a month or as per calender month.

    can you tell me which one do you want

    Regards,

    Arjun.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.