How to get the last day according to fiscal period input in selection scree

Hello expert
how to get the last day of fiscal period input.
the fiscal period inculdes 1-16
when fiscal period is greater than 12, only calculate the last day of 12nd month
your solution will be apprecaited, FM existing?
thank you
Kevin

Hi,
when you give a particular date in any month
the following fm will give you the last date of that month
here you can give
R_FDATE-HIGH  as 01 and month as the period you wnat and year for current year
concatenates '01'  month year  into r_fdate-high separated by '.'.
then it will give g_ltdt for that month and year which wil be the last date of that month
    CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
      EXPORTING
        DAY_IN            = R_FDATE-HIGH
      IMPORTING
        LAST_DAY_OF_MONTH = G_LTDT
      EXCEPTIONS
        DAY_IN_NO_DATE    = 1
        OTHERS            = 2.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
thanks & regards,
Venkatesh

Similar Messages

  • How to get the last day of the week?

    Hii
    i can get the calender week number for any given date using
    SELECT to_char(to_date('04/04/2011','MM/DD/YYYY'),'WW') FROM dual
    can any body tell me, how to get the last day of that week ?
    and the answer should be 04/08/2011(8th april )
    thanks
    San
    Edited by: sandeep9 on Apr 4, 2011 3:50 AM

    Hi, San,
    Here's one way:
    WITH     sample_data     AS
         SELECT  DATE '2011-04-04'     AS dt
         FROM     dual
    SELECT  dt
    ,     TO_CHAR (dt, 'WW')     AS week_num
    ,     NEXT_DAY ( dt - 1
               , TO_CHAR ( TRUNC (dt, 'YEAR') - 1
                      , 'Day'
               )          AS end_o_week
    FROM     sample_data;Another way is to use date arrithmetic:
    WITH     sample_data     AS
         SELECT  DATE '2011-04-09'     AS dt
         FROM     dual
    SELECT  dt
    ,     TO_CHAR (dt, 'WW')     AS week_num
    ,     TRUNC (dt, 'YEAR')
          + (7 * CEIL ( (dt - (TRUNC (dt, 'YEAR') - 1))
                / 7
          - 1               AS using_date_arithmetic
    FROM     sample_data;

  • How to get the last day of a month?

    HI,
    I want to know how to get the last day of a month.
    In my JClient form, I tried to get it by using oracle.sql.Date method, that is:
    lastday=oracle.sql.Date anydate.lastDayOfMonth();
    But it does not work. The result is lastday=anydate.
    Why?
    Stephen

    You can use the Calender class...
    Calendar c = Calendar.getInstance();
    and then something like...
    c.add(c.MONTH, 1);
    int dayOfMonth = c.get(Calender.MONTH);
    c.add(c.DAY_OF_MONTH, - (dayOfMonth-1) );
    other usefull functions are:
    System.out.println(" YEAR : " + c.get(Calendar.YEAR));
    System.out.println(" MONTH : " + c.get(Calendar.MONTH));
    System.out.println(" DAY_OF_MONTH : " + c.get(Calendar.DAY_OF_MONTH));
    System.out.println(" DAY_OF_WEEK : " + c.get(Calendar.DAY_OF_WEEK));
    System.out.println(" DAY_OF_YEAR : " + c.get(Calendar.DAY_OF_YEAR));
    System.out.println(" WEEK_OF_YEAR : " + c.get(Calendar.WEEK_OF_YEAR));
    System.out.println(" WEEK_OF_MONTH : " + c.get(Calendar.WEEK_OF_MONTH));
    System.out.println(" DAY_OF_WEEK_IN_MONTH : " + c.get(Calendar.DAY_OF_WEEK_IN_MONTH));
    System.out.println(" HOUR : " + c.get(Calendar.HOUR));
    System.out.println(" AM_PM : " + c.get(Calendar.AM_PM));
    System.out.println(" HOUR_OF_DAY (24-hour): " + c.get(Calendar.HOUR_OF_DAY));
    System.out.println(" MINUTE : " + c.get(Calendar.MINUTE));
    System.out.println(" SECOND : " + c.get(Calendar.SECOND));
    System.out.println();*/

  • How to get the last day of the payroll period

    Hi all,
    I need to get the last day of the payroll period e.g. last day of Jan 2007 is 31 Jan 2007. Can anyone suggest as to how to get it?
    Thanks,
    Madhu

    T549S contains the payroll periods with pay date.  T549Q contains the begin and end dates of the payroll period.
    You can select from the appropriate table (or from both depending on your given data) to get the end date of the period.
    Hope that helps.
    Mary

  • How to get the last day of calweek

    Hi Guys,
                Is there any function module to get the last day of the calendarweek.
    I want to show that last date of calweek in my column heading.

    You can use the Calender class...
    Calendar c = Calendar.getInstance();
    and then something like...
    c.add(c.MONTH, 1);
    int dayOfMonth = c.get(Calender.MONTH);
    c.add(c.DAY_OF_MONTH, - (dayOfMonth-1) );
    other usefull functions are:
    System.out.println(" YEAR : " + c.get(Calendar.YEAR));
    System.out.println(" MONTH : " + c.get(Calendar.MONTH));
    System.out.println(" DAY_OF_MONTH : " + c.get(Calendar.DAY_OF_MONTH));
    System.out.println(" DAY_OF_WEEK : " + c.get(Calendar.DAY_OF_WEEK));
    System.out.println(" DAY_OF_YEAR : " + c.get(Calendar.DAY_OF_YEAR));
    System.out.println(" WEEK_OF_YEAR : " + c.get(Calendar.WEEK_OF_YEAR));
    System.out.println(" WEEK_OF_MONTH : " + c.get(Calendar.WEEK_OF_MONTH));
    System.out.println(" DAY_OF_WEEK_IN_MONTH : " + c.get(Calendar.DAY_OF_WEEK_IN_MONTH));
    System.out.println(" HOUR : " + c.get(Calendar.HOUR));
    System.out.println(" AM_PM : " + c.get(Calendar.AM_PM));
    System.out.println(" HOUR_OF_DAY (24-hour): " + c.get(Calendar.HOUR_OF_DAY));
    System.out.println(" MINUTE : " + c.get(Calendar.MINUTE));
    System.out.println(" SECOND : " + c.get(Calendar.SECOND));
    System.out.println();*/

  • How to get the last day of the next month?

    Hi all.
    I need to get the last day of the next month. E.g. if the date is 20.03.2008 I need to get 30.04.2008.
    Is there any FM for it?
    TIA, Nikolai.

    hi Nikolai,
    pls. have a look athe following piece of code:
    PARAMETERS : p_date TYPE sy-datum.
    DATA : gv_res TYPE sy-datum.
    CALL FUNCTION 'CALCULATE_DATE'
    EXPORTING
    *   DAYS              = '0'
       months            = '2'
       start_date        = p_date
    IMPORTING
       result_date       = gv_res.
    ==> Now you have (gv_res) 2 months later as today
    gv_res+6(2) = '01'. ==> gv_res is first day of next-next month
    gv_res = gv_res - 1. ==> gv_res is last day of next month
    hope this helps
    ec

  • Object date - how to get the last day of the month?

    hi all,
    I have a date object in which I would like to get the last day of the month. any idea?
    eg AUG=31
    Feb = 28 (depends if a leap year)
    thanks

    Use java.util.Calendar
    Add 1 month to the day.
    Set the day of month to be 1.
    Subtract 1 day.
    Now you are on the last day of the month you wanted.

  • How to get the last day of the previous month

    Hello Team,
    If  my input date is today , then i need to find out the last day of the previous month for the same.
    Can someone help me  to find out .. how can this be done.
    Regards,
    Ravi

    Hi,
    Try the below code.
         // get a calendar object
        GregorianCalendar calendar = new GregorianCalendar();
        // convert the year and month to integers
        int yearInt = Integer.parseInt(year);
        int monthInt = Integer.parseInt(month);
         int dayInt = Integer.parseInt(day);
        // adjust the month for a zero based index
        monthInt = monthInt - 1;
        // set the date of the calendar to the date provided
        calendar.set(yearInt, monthInt, dayInt);
        int day = calendar.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
        return Integer.toString(day);
    Regards
    Venkat

  • How to get the last day of the current open fiscal period?

    hi folks,
         I  have to display the last date of the current open fiscal period in the selection screen. Its just a display only.
          if there is any function module vailable for getting that period, kindly suggest me?
    thanks in advance,
    cheers,
    Adi.

    hi,
    CALL FUNCTION '/BEV3/CHPERIOD_DETERMINE'
    EXPORTING
    date = sy-datum
    version = c_version
    IMPORTING
    period = l_period
    year = l_fiscal_year
    EXCEPTIONS
    period_in_not_valid = 1
    period_not_assigned = 2
    version_undefined = 3
    OTHERS = 4.
    If not use GM_GET_FISCAL_YEAR
    CALL FUNCTION 'GET_CURRENT_YEAR'
    EXPORTING
    BUKRS = '1000' " Company Code
    DATE = SY-DATUM " Date to find fiscal year for
    IMPORTING
    CURRM = w_currm " Current Fiscal Month
    CURRY = w_curry " Current Fiscal Year
    PREVM = w_prevm " Previous Fiscal Month
    PREVY = w_prevy. " Previous Fiscal Year
    Rgds
    Anver

  • How to get the calendar days of  last month in SAP HR Schema?

    Hi all,
       I have a question about the calendar days of last month, cause the customer calculated the salary not by natural month but cross-month, for example,
    for calculating salary of Aug, the time period may be 7.28-8.27, so I need the days of this period which is  the calendar days of  last month exactly.
    But I only knew GKSOLL was used for getting the calendar days of current month.
    If any place wrong, please guide me.
    Look forward to getting experts' help, thanks.
    Regards,
    May.

    Hi Sankarsan,
    Thank you so much for your help.
    The requirement I have described in detail when replying Viverk, you can take it as a reference.
    Cause my customer  don't want to use retro in SAP system, so I noted the schema about  retro.
    Now my question was how to get the last month calendar days in Schema. For example, now I am calculating the salary of July, the full attendance will be 30 days(06.28-07.27), in rule GKSOLL will get 31 days, so it's not right.
    I hope you can get my point, below is the wrong rule.
    Please guide me to correct it, thanks.
    Regards,
    May.

  • How to get the last error for while loop?

    How to get the last error for while loop? I just want transfer the last error for while loop, but the program use the shift register shift all error every cycle.

    What do you mean by "get" and "transfer"?
    If the shift register is not what you want, use a plan tunnel instead.
    Typically, programmers are interested in the first, not last, error.
    Can you show us your code so we have a better idea what you are trying to?
    LabVIEW Champion . Do more with less code and in less time .

  • How to get the last version of flash in MSI format automatically?

    How to get the last version of flash in MSI format automatically?
    Roberto Neigenfind
    Bravo Tecnologia
    www.bravotecnologia.com.br

    Hi Barbara,
    Flash Professional CS5.5 is a 32-bit application which can be installed on computers with either 32-bit or 64-bit operating systems.
    You can purchase this by Adobe's backward Licensing policy :
    " Adobe allows program members to order a current-version license but use a prior version. These members can contact Adobe Customer Service to request a serial number for the earlier version if they do not already have one. Prior-version software is available via ESD and can be purchased through standard resellers. The program member must follow all guidelines of the current-version EULA. "
    Please check the doc : http://www.adobe.com/volume-licensing/policies.html

  • How to get the "last changed by" for a set of function modules?

    How to get the "last changed by" for a set of function modules?
    is there any table to get it??

    See [this|Re: Date of creation of function module] I posted earlier.
    >TFDIR will give you the name of the function group program and the include number.
    >E.g. SAPLZFUNCGROUP Include 01.
    >From this you can construct the include name: LZFUNCGROUPU01.
    >You can look this up in TRDIR to find the creation date (CDAT) of the function module.
    In your case, you need unam and udat.
    matt

  • How to get the last page  SAP Script form

    How to get the last page  SAP Script form.
    I want to print a specific information in the last page of SAP form (Script). Please tell me how to get the last page number.
    Regards

    Hi
    You have to check the system variable &NEXTPAGE&, if it's 0 it means you're in the last page.
    From SAP Help:
    This symbol is used to print the number of the following page. The output format is the same as with &PAGE& .
    Note that on the last page of the output, in each window that is not of type MAIN, &NEXTPAGE& has the value 0.
    /: IF &NEXTPAGE& = '0'
       Last page
    /: ENDIF
    Max

  • How to get the first day in the month from a domain date ?

    Hi,
    I like to know how to get the first day in the month from a domain date?
    Thanks
    Stephen

    Hi Gokul...
    Instead of using the funtion module you can just write the 3 statements of code to get the first day of the week.
    Its similar to the above one but instead of writing case statement you can achive the following.
    data : w_res type i,
             w_data type d,
    w_res = w_date mod 7.
    w_date = w_date - w_res.
    write w_date.
    This works.
    Regards,
    Siddarth

Maybe you are looking for

  • HT4061 how can i get my phone to activate my iphone

    how can i activate my iphone it wll not let me activate

  • Warning using DWR to populate list box

    hi all, iam trying to use DWR for populating list box wen a check box is checked.iam using Tomcat 4.1 & j2sdk 1.4.2 but iam getting an alert: illegal access to default constructor Aug 20, 2006 6:30:43 PM uk.ltd.getahead.dwr.util.CommonsLoggingOutput

  • Connection to mySQL via jdbc

    I'm currently programming a GUI to access a database. Therefore I executed a query, which worked fine. But when I tried to exit my program with System.exit(0)my DOS-Prompt crashes without exiting. Now I tried it with a kind of minimalistic Connection

  • ABAP / XSLT

    Hi, I want to use XSLT in my abap program : CALL TRANSFORMATION 'name of the XSLT program'. where should i code the XSLT ? i'm using sap 4.6c. Thanks Ihsen

  • What is in the T400 box?

    Hi there, Can someone please let me know what is inside a T400 box? (bought from Lenovo site in the US) . Does it have a set of 3 track point caps? Thanks.