Leap Year Exception in Exit Variable

Hello Experts,
                       I have a Customer exit variable(ZVAR_PREVIOUS_MONTH) which displays data for previous month of input date. When i am entering 02/29/2008(which is a leap year) as input then the variable throws an error saying "Value "20070229" for user exit varaible is invalid. And thats true since 2007 is not a leap year. So how can i handle this Leap Year Exception
Regards,
Vishnu.

Vishnu,
Your description doesn't make sense. If you input 2008, why is the error showing 2007? Could you post your code here so we can have a look?
I think you are trying to implement the exit such that if you supply 02/29/2008, the variable should resolve to 01/01/2008 - 01/31/2008. Is that correct?
variable-sign = 'I'.
variable-option = 'BT'.
* received_value = 02/29/2008
received_value+6(2) = '01'.                        " 02/01/2008
variable-high = received_value - 1.            " 01/31/2008
variable-low = variable-high.                      " 01/31/2008
variable-low+6(2) = '01'.                             " 01/01/2008

Similar Messages

  • BEx Analyzer exit variable behaves differently from RSRT

    Hello experts
    I have an exit variable on a number of queries which is being filled out at I_STEP 1 with different values depending on which query is executed. This is a requirement for a number of reasons and cannot be changed. The user then has a different variable which is user input ready so he can select from one of the values I supply them. This variable is in the proposed values section of the query so it should only list the variables allowed for the user to select.
    For example on query A, I want the exit variable to give the values 1,2 and 3. The user, on variable screen can select in the input-ready variable on of those values. In query B the same happens except the exit variable has values 3, 4 and 5.
    If the user accesses one of these queries everything works fine. The problem happens when the user accesses query A, closes it and then accesses query B. In this situation he sees values 1,2,3,4 and 5 as available instead of only 3,4 and 5. It seems that the system shows him variables 1 and 2 despite the fact that he can't access them. This only happens in analyzer but not if I use RSRT. Is it a bug in Analyzer? I've tried debugging from RSRT the code to check if I forgot to clear something but I cannot find anything wrong but then again the problem does not happen in RSRT.
    What can I try to do to solve this?
    Thanks for your help.

    I've done some further researching and discovered the following:
    1 - My exit variable is working fine. It gets the correct values.
    2 - The user-input variable is not being filtered correctly. It looks like it does not show only the values allowed in the exit variable.
    Is this right? I thought if I had a set of values in the filter of the query, they would automatically restrict user input variables that the query may use in the proposed values.

  • How to handle leap in exit variable

    Hello Experts,
    I have a Customer exit variable which displays data for previous year of input date. When i am entering 02/28/2005 as input then the variable displays data only till 02/28/2004 but 2004 is a leap year and it has 29 days so my 29th day data is missing.
    This continues for 2001,2005,2007,2013,2017 since these years come after leap year(2000,2004,2008,2012,2016 are leap years). Need expert suggestions
    Regards,
    Vishnu.
    Edited by: vishnu@sri on Nov 1, 2010 12:59 PM

    Hi Suvarna,
                        I have 2 cases with my Exit variables
    Case 1: If my input date is 29/02/2004(leap year) then previous year should display 28/02/2003 which i have done.
    Case2: If my input date is 28/02/2005 then previous year should display 29/02/2004(leap year) which has to done.
    So pls throw light on Case2....       Suvarna pls elaborate your reply.
    Regards,
    Vishnu.

  • Customer Exit Variable Period 000 is not valid in financial year variant Z2

    Hi all,
    I am trying to get the week number from a particular posting period. But I get this error when I execute the Query:
    Error Group
    RFC_ERROR_SYSTEM_FAILURE
    Message
    SYST: Period 000 is not valid in financial year variant Z2
    I checked in "FIRST_DAY_IN_PERIOD_GET" FM and it is not accpting period 000 for PERIV Z2. It works fine for all other periods.
    Does anyone have an idea on this?
    Thanks.

    Simon,
    So do you think that there is a problem in my Query restrictions? You ask me to restrict from 0 - 12, but this period is calculated based on the SY_DATUM in a cust. exit variable. And this period is being used to pull week number. So, do I need to change the code?
    But I already have another query which is similar to this, only ready for input options are missing in the new one. The older one is working fine but the I have problem with this.
    Any more ideas?
    Thanks!!

  • SAP EXIT Variable 0FYEAR is not working for Fiscal Year(OFISCYEAR)

    Dear SDN,
    I have created Simple Query.
    ROWS
    Company code(0COMP_CODE)
    Fiscal Year(0FISCYEAR)
    Columns
    Total Debit postings(0DEBIT)
    Total Credit posting(0CREDIT)
    Filters
    Companycode(Variable Selection option)
    Fiscal year(Varialbe SAPEXIT 0FYEAR)
    Fiscal Year Variant(K4)
    After executing the query in the variable screen only company code is displayed.
    SAP EXIT FISCAL YEAR VARIALBE(0FYEAR) IS NOT WORKING.....
    Is there any setting or activation is required to use SAP EXITS?
    Waiting for Solution......
    Thanks & Regards,
    Praveen.K

    Hi
    In this case you will have to use a Customer Exit (which is Ready for Input) Variable which gets Current Fiscal Year as a Default Value.
    In order to do that - you will need to create a Customer Exit Variable which is Ready for Input. The Variable will have to be assigned with Current Fiscal Year under I_STEP 1 (this refers to the coding of the Customer Exit in T-code: CMOD)
    If you need any help with the coding - don't hesitate to ask.
    Yaniv

  • Need logic to find Year to Date for customer exit variable

    Hi to all,
    I am creating customer exit variable for query .
    query should display data according to current system year from jan till current system date.
    here senario is like that user never enter year and query will automatically will fetch the data according to current year starting from jan to current system date.
    example.
    current year 2010 and today is system date is sep 29 2010, so query will display data from jan 2010 to current data sep 29 2010.
    please can any one provide me logic for that.
    any code .
    regards
    pavneet rana

    Hi,
    You need to create the characteristic customer exit variable of type select-options. Restrict your keyfigure based on this variable.
    In the logic in CMOD,
    write as below
    i_step =2.
    case i_vnam.
    When 'exit variable'.
    temp = sy-datum+0(4).
    concatenate temp '0101' into temp1.
    l_s_range-low= temp1.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'BT'.
    l_s_range-high= sy-datum.
    append APPEND l_s_range TO e_t_range.
    endcase.
    For any further help on customer exit based variable, please refer below article.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20f119d9-922d-2c10-88af-8c016638bd90?quicklink=index&overridelayout=true
    Edited by: Rahul K Rai on Sep 29, 2010 3:09 PM

  • Customer Exit variable to display the current Year/Month by default.

    Hi Experts,
    I need to create a variable on the object 0CALMONTH that needs to display the current Month/Year by default when the query is run.
    Can anyone please help with the ABAP code that is required for the creation of this Customer Exit Variable?
    Thanks
    Aravind

    Hi,
    try this , just copy and paste in your Editor,
    Data: Year(4) type c,
          month(2) type C,
          date(6)  type c.
    IF I_STEP = 1.
      CASE I_VNAM.
        WHEN 'VAR_X'.
          l_s_range-low = sy-datum+0(6).
          l_s_range-opt = 'EQ'.
          l_s_range-sign = 'I'.
          year = l_s_range.
          l_s_range-low = sy-datum+4(2).
          l_s_range-opt = 'EQ'.
          l_s_range-sign = 'I'.
          month = l_s_range.
          concatenate year month INTO date separated BY '/' .
          Append  date to e_t_range .
      ENDCASE.
    ENDIF.
    Thanks,
    JACK

  • Unable to generate the file report pdf on 29 february 2012 or during any leap year day...

    hii this is manab......
    sir/mam i have face the following error in 29 february 2012 for my overall company report .But i can easily get the
    report of another department on 29feb 2012....but when i try generate the overall report of my comapany then i find the errors
    REP-1401: 'cf_mc_prod_lyrformula': Fatal PL/SQL error occurred.
    ORA-01839: date not valid for month specified
    The following is the logfile.........
    ...........................................................................................log file................................................................................................................
    HPCL Custom Application: Version : UNKNOWN
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    HPCCMDS module: HPC Modified CMD Report
    +---------------------------------------------------------------------------+
    Current system time is 04-SEP-2013 11:37:20
    +---------------------------------------------------------------------------+
    +-----------------------------
    | Starting concurrent program execution...
    +-----------------------------
    Arguments
    P_MILL='NPM'
    P_TRANSACTION_DATE='2012/02/29 00:00:00'
    Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
    American_America.US7ASCII
    REP-1401: 'cf_mc_prod_lyrformula': Fatal PL/SQL error occurred.
    ORA-01839: date not valid for month specified
    Report Builder: Release 6.0.8.24.0 - Production on Wed Sep 4 11:37:20 2013
    (c) Copyright 1999 Oracle Corporation.  All rights reserved.
    Enter Username:
    +---------------------------------------------------------------------------+
    Start of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    +---------------------------------------------------------------------------+
    End of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    Program exited with status 1
    Concurrent Manager encountered an error while running Oracle*Report for your concurrent request 11426643.
    Review your concurrent request log and/or report output file for more detailed information.
    +---------------------------------------------------------------------------+
    Executing request completion options...
    Finished executing request completion options.
    +---------------------------------------------------------------------------+
    Concurrent request completed
    Current system time is 04-SEP-2013 11:59:23
    +---------------------------------------------------------------------------+
    kindly give me solution .....i have e-business suite 11i
    internet explorer latest version...

    Hi,
    Please confirm whether this is a custom or standard report.
    If this is a custom report, then probably the respective issue has not been handled by exception handling.
    Also please refer note:
    How to check if version 11.5.10.2 is certified to Handle Leap Years (Doc ID 549937.1)
    Thanks &
    Best Regards,

  • How to do a date validation with leap years

    I'm doing a date validation program in my Java class, and well it's pretty hard (for me that is). I have to be able to type in a date, have it say whether it's a leap year or not, and print out the number of days in the month. It seems pretty straight forward, but I get confused on trying to do the 'if else' statements and even the simplest things like getting the day prompting to work. >< The years I'm doing only goes through 1000 to 1999, so that's why those numbers are there. The program isn't complete, so if anyone could help show me what I'm doing wrong in the areas I'm working on then I'd appreciate it...and I'm still kind of in the basics of Java so if you do hint me with some code then I'd appreciate it if it was stuff that's not too advanced so yea.
    // Dates.java
    // Determine whether a 2nd-millenium date entered by the user
    // is valid
    import java.util.Scanner;
    public class Dates
    public static void main(String[] args)
    int month, day, year; //date read in from user
    int daysInMonth; //number of days in month read in
    boolean monthValid, yearValid, dayValid; //true if input from user is valid
    boolean leapYear; //true if user's year is a leap year
    Scanner scan = new Scanner(System.in);
    //Get integer month, day, and year from user
    System.out.print("Type in the month: " );
              month = scan.nextInt();
    System.out.print("Type in the day: " );
              day = scan.nextInt();
    System.out.print("Type in the year: " );
              year = scan.nextInt();
    //Check to see if month is valid
    if (month >= 1)
    month = month;
    else
    if (month <= 12)
    month = month;
    else;
    //Check to see if year is valid
    if (year >= 1000)
    year = year;
    else
    if (year <= 1999)
    year = year;
    else;
    //Determine whether it's a leap year
    //Determine number of days in month
    if (year == 1 || 3 || 5 || 7 || 8 || 10 || 12)
         System.out.println (Number of days in month is 31);
         else (year == 4 || 6 || 9 || 11)
         System.out.println (Number of days in month is 30);
    //User number of days in month to check to see if day is valid
    //Determine whether date is valid and print appropriate message
    // Dates.java
    // Determine whether a 2nd-millenium date entered by the user
    // is valid
    import java.util.Scanner;
    public class Dates
    public static void main(String[] args)
    int month, day, year; //date read in from user
    int daysInMonth; //number of days in month read in
    boolean monthValid, yearValid, dayValid; //true if input from user is valid
    boolean leapYear; //true if user's year is a leap year
    Scanner scan = new Scanner(System.in);
    //Get integer month, day, and year from user
    System.out.print("Type in the month: " );
              month = scan.nextInt();
    System.out.print("Type in the day: " );
              day = scan.nextInt();
    System.out.print("Type in the year: " );
              year = scan.nextInt();
    //Check to see if month is valid
    if (month >= 1)
    month = month;
    else
    if (month <= 12)
    month = month;
    else;
    //Check to see if year is valid
    if (year >= 1000)
    year = year;
    else
    if (year <= 1999)
    year = year;
    else;
    //Determine whether it's a leap year
    //Determine number of days in month
    if (year == 1 || 3 || 5 || 7 || 8 || 10 || 12)
         System.out.println (Number of days in month is 31);
         else (year == 4 || 6 || 9 || 11)
         System.out.println (Number of days in month is 30);
    //User number of days in month to check to see if day is valid
    //Determine whether date is valid and print appropriate message
    }

    Here are some helpfull hints for you:
    1. Your code is really hard to read, there are two main reasons for this. First, your indentation sucks. Second, you seem to be fascinated with saving two (ok four if you count the shift key) keypresses to avoid using { and }.
    2. Not using the brackets (you know { and } which you like to avoid) also is causing your code to do some stuff you don't realize or want to happen, or at least it would be if your code compiled.
    3. If statements require arguements, "year == 1" is an arguement, "3" is not an arguement. Each operator like the or operator ("||") is essentially a new if and requires a complete arguement. So the following code peice:
    if (year == 1 || 3 || 5 || 7 || 8 || 10 || 12)Literally translates to if year equals 1 or if 3 or if 5 or if 7 or if 8 or if 10 or if 12. Doesn't make much sense in english, and it doesn't make much sense in Java either.
    4. I am pretty sure "year" is not the variable you want in the code snippet above (the one used in hint 3), especially considering years 1, 3, 5, 7, 8, 10, and 12 are not between 1000 and 1999. You need to be really carefull not make these kind of mistakes when coding, because they are by far the hardest to track down and fix later since they don't really throw up any flags or anything at compile or run time. Take your time and think thuroughly about each line of code while coding it, it will save you tons of time in the long run.
    5. What exactly do you expect statements like "month = month;" to do? That translates as make month equal to month. Do you go to the bank and say " I have exactly $3.56 in my pocket, so I would like to deposite all $3.56 and then withdraw $3.56 and put it back in my pocket"? How do you think the teller would look at you? Teller would probably do it, but the teller would feel like he/she wasted time with you and that you are not really right in the head. Java feels the same way when you make it do the same thing, and you love to do it.
    6. Code like the following is all wrong, and for more reasons than pointed out in hint 5.
    if (month >= 1)
    month = month;
    else
    if (month <= 12)
    month = month;
    else;Let's say someone put 13 in as the month. It passes the first check because 13 is greater than or equal to 1. so month which is 13, now gets set to 13 (gee that was effective). Now we hit the else and things get confusing because you didn't use brackets or proper indentation (hint 1) so we don't know what your real intent was. Did you mean else do nothing, and the next if statement is then executed, or did you mean to just run the next if statement if the else condition was met? Fortunatly it doesn't matter here because the next if statement is failed anyways since 13 is not less than or equal to 12.
    So, we leave this code with month ebing 13, wait when did we add a 13th month to the calendar? Are you using the Jewish calendar? Could be, except even if I put 1234567 as the month your code would except it as valid, and I know no calendar with that many months. Try writing this in english first and translating it to jave, like i would probably say "if the month is greater than or equal to 1 and less than or equal to 12 then the month is valid." Course now what do you do if it is invalid? Hmm, maybe I would actually say "while the month is less than 1 or greater than 12 ask the user for the month" until they get it right.
    There are a few other problems, but most of them are probably things you haven't learned yet, and they are not show stoppers so we will let them fly. You already have a lot of work to do to make this better. But I do have one more really really big usefull hint for you:
    Never, ever, under any circumstances, should you ever ask in any way or even hint at asking for someone else to provide code solutions to your problems. So "so if you do hint me with some code then I'd appreciate it if it was stuff that's not too advanced " was a very bad thing to do, but fortunatly for you you followed it with proof you were trying to write the code yourself. Had the code you provided not been so full of problems it was obvious a beginner wrote it, you would probably have gotten much less cordial responses. I would seriously consider avoiding any implication of wanting code, at least until you become a regular poster here and people know you are not just looking to get your homework done for you.
    Hope some of this helps.
    JSG

  • Predicate boolean method...calculating whether or not a year is a Leap year

    I'm trying to get pointed in the right direction for this program. I am attempting to write a program that calculates whether or not an inputted year by the user is a valid leap year or not, however I'm having problems figuring out the method for this calculation.
    A predicate method boolean seems to be the right way, but I can't figure out exactly how. Here's what I've brainstormed thus far:
    Leap Year Conditions:
    1. Is divisible by 4.
    2. Is NOT divisible by 100.
    3. Is divisible by 4.
    public class Year
              public boolean isLeapYear()
    }What confuses me is how to satisfy these conditions. Here is what I want to fill those '...' with. Excuse the tacky language coming up, but it's the only way I can express my thinking here:
    return ((inputted year) / 4) && (inputted year / 400) && !((inputted year) / 100)
    If the year is undivisible by any of these values then it could end up being a technical decimal (which means the inputtted year is not a leap year). But of course java would still calculate it anyway depending on how I defined the type.
    Should I try to implement a condition that if the variable returned by any of these calculations (except for 100) is a float point then the year is not a leap year? How would I do this?
    I'm really not sure where to go on this one. If anyone could point me in the right direction and give me a good start I would appreciate it. Thank you.
    Message was edited by:
    fairtex
    Message was edited by:
    fairtex

    http://en.wikipedia.org/wiki/Leap_year
    They have some leap year algorithms on there.

  • Problem with User exit variable

    We're using an user exit variable (var2) for YTD calculation (For getting the first month of current year). It gets value from another exit variable (var1) which has by default value last month of current year(populated in I_step1 from sy-datum). If the user wants he can change the default value of var1. It works fine when the query is executed the first time. But if the user calls the variable screen again, the variable screen does not show var1 in the popup and the user gets an error message that no value could be determined for var2. How can this issue be resolved or is there any other method to satisfy this requirement.
    Your help would be appreciated and rewarded.
    Thanks & Regards
    Hari

    Hi Ravi,
    Sorry, there's a correction. <b>var2 is used for getting the first month of the year selected by the user in var1</b>. If the user doesn't enter a value for var1, then var2 should take first month of current year from var1 which has by default last month of current year (populated in i_step1 from sy-datum). The user can select the value of var1 according to his requirement. Then var 2 should get first month of the year selected. That's why I'm using two exit variables.
    It works fine during the initial run of the query. But when the user clicks on the variable button in the toolbar and executes the query, var1 is not being displayed and an error message <i>No value could be determined for var2</i> is shown. All other variables used in the query are displayed except var1.
    Krzys, Is the option <i>Can be changed in Query Navigation</i>  available for Exit variables. I'll check that and get back to you.
    Boujema, Thanks for the OSS note.
    Thanks
    Hari

  • Crystal Reports with BEx Query using Custom Exit Variable

    Hi,
    We have BW BEx Query using Customer User Exit variable to derive  the Fiscal Week for Last Year (called it VAR2) based on another user input variable Current Fiscal Week (called it VAR1).
    VAR2 is derived from VAR1 in CMOD via some codings and thus it DOES NOT have the "Variable is Ready for Input" flag ticked in the BEx. VAR1 is user input variable, so it has "Variable is Ready for Input" flag ticked in the BEx.
    When we create a Crystal Reports with the BEx Query using variable VAR2, and when we run it we got an error message saying "Failed to execute query; '[]<java.lang.UnsupportedOperationException: No Selection State Support!ZP_MI_LYPUBWEEK>'. Redesign your query or contact the data source maintainer to solve the problem".  (note: ZP_MI_LYPUBWEEK is VAR2 in this case).
    Could anyone please assist? Surely, CR supports BEx customer user exit variables like the above, right?. I also refer to the forum below as it seems to have a similar issue (except mine with an error message), but it does not provide a solution in it.
    Crystal Reports with BEx Query using Custom Exit Variable
    Thanks,
    Andy

    Hi Vibhav,
    We have the SAP Crystal Reports for Enterprise XI4.0 Version 14.0.0. Not sure if SP0 or other SP, got to check with Basis Team later.
    We tried that "mandatory" option and did not work either.
    Anyway, SAP has now come back again saying it is something they will fix it in next release/version. We got a phone call from them and a reply below to our OSS.
    23.08.2011 - 08:20:49 CET - Info for Customer by SAP  
    I have raised this issue on the Idea#s Place as an enhancement request
    on the below link:
    https://cw.sdn.sap.com/cw/ideas/5586
    This ER contains the information of including the customer exit
    variables in the report without checking the #input for ready# option.
    This ER can be considered for being implemented in the future
    versions. You can refer to SAP Note: 1515837 - How To: Enhancement
    Request Process - "Idea Place" for more information regarding the Idea
    Place.
    Cheers,
    Andy

  • User Exit Variable for Bex in CMOD (ABAP Code)

    Hi Experts
      My requirment is to develop a Restricted Keyfigure...
      The restriction is based on 0Calmonth (Calendar Year/Month)
    The sales from beginning of calendar year up to last "closed" month in a Calendar.
    Ex: in June i want to see 01.01.2009 to 31.05.2009 data.
        in October i want to see 01.01.2009 to 30.09.2009 data.
    When user execute the report
        in Jan 2010 i want to see 0 as there is no closed month in that particular year.
        in Fed 2010 i want to see 01.01.2010 to 31.01.2010 data.
    For that purpose i need to create a User Exit variable in CMOD...
    I am struggling to get an idea on how to write a code to meet the requirment
    Please help me with code that i can use in cmod
    Thanks in advance

    Hi,
    Use the following code :
    when' variable name ' .
    DATA : year(4) type n,
    month2(2) type n,
    date_in type sy-datum,
    date_op type sy-datum.
    IF I_STEP = 1.
    CLEAR L_S_RANGE.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'BT'.
    month2 = sy-datum+4(2).
    if month2 = '01'.
    concatenate sy-datum+0(4) '01' '01' into l_s_range-low.
    l_s_range-high = sy-datum.
    else.
    month2 = month2 - 1.
    clear : date_in, date_op.
    concatenate sy-datum+0(4) month2 '01' into date_in.
    CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
      EXPORTING
        DAY_IN                  = date_in
    IMPORTING
       LAST_DAY_OF_MONTH       = date_op
    EXCEPTIONS
       DAY_IN_NOT_VALID        = 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.
    concatenate sy-datum+0(4) '01' '01' into l_s_range-low.
    l_s_range-high = date_op.
    endif.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    I dint know what output do you want if the current month is jan.
    I have put it as 1st jan till current date.
    Modify it if you need.
    Regards,
    Mansi

  • BW Customer Exit variable

    Hi Experts,
    I need some help with BW Customer Exit code. This is my reqmt. When a user entes Fiscal period and year,  the code shld go back 6 months back from there and apply that period as the lowest range and the user entered year and perid as the highest value range. Can anyone help??
    Thanks,
    DV

    Hi,
    Create Customer Exit Variable on Fiscal year period and the try with the following code.
    Create ZFYP User entry variable on Fiscal year period
    Process By = USer Entry
    Characteristic = Fiscal year period.
    Variable represents  =Single
    Variable Entry = mandatory
    Check ready for input.
    Create ZFSIX Customer Exit variable on Fiscal year period
    Process By = Customer Exit
    Characteristic = Fiscal year period.
    Variable represents  = Interval
    Variable Entry = mandatory
    UnCheck ready for input.
    Then write the following code in CMOD.
    1.Drag and drop  Fiscal year period in Freecharacteristic and restrict with ZFYP Variable.
    2.Restrict Keyfigure with Fiscal year period  with  ZFSIX  Variable in columns.
    WHEN 'ZFSIX'.
    DATA:  ZMONMIT LIKE GJVAR-MONMIT,
           ZFY1 TYPE /BI0/OIFISCPER,
           ZFY2 TYPE /BI0/OIFISCPER.
    DATA:  zbuper LIKE t009b-poper,
           zbdatj LIKE t009b-bdatj,
           zzdate LIKE sy-datum.
    DATA:  ZPOPER  TYPE POPER.
    DATA:  ZNUMC TYPE NUMC2.
    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZFYP'.
              CLEAR l_s_range.
              ZFY1 = loc_var_range-LOW.
              ZBDATJ = loc_var_range-low+0(4).
              ZPOPER = loc_var_range-low+4(3).
             ZMONMIT = '01'.
              CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
                EXPORTING
                  I_GJAHR              = ZBDATJ
                 I_MONMIT              = ZMONMIT
                  I_PERIV              = 'V3'
                  I_POPER              =  ZPOPER
               IMPORTING
                 E_DATE                = ZZDATE
               EXCEPTIONS
                 INPUT_FALSE          = 1
                 T009_NOTFOUND        = 2
                 T009B_NOTFOUND       = 3
                 OTHERS               = 4.
              IF SY-SUBRC <> 0.
                 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
         CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
           EXPORTING
             I_DATE               = ZZDATE
    *        I_MONMIT              = u201800u2019
             I_PERIV              = 'V3'
          IMPORTING
            E_BUPER              =  ZPOPER
            E_GJAHR              =  ZBDATJ
          EXCEPTIONS
            INPUT_FALSE          = 1
            T009_NOTFOUND        = 2
            T009B_NOTFOUND       = 3
            OTHERS               = 4.
         IF SY-SUBRC <> 0.
             MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
        CONCATENATE ZBDATJ ZPOPER INTO ZFY2.
        L_S_RANGE-LOW    = ZFY2 .
        L_S_RANGE-HIGH   = ZFY1.
        L_S_RANGE-SIGN   = 'I'.
        L_S_RANGE-OPT    = 'BT'.
        APPEND L_S_RANGE TO E_T_RANGE.
    ENDLOOP.
    Thanks
    Reddy

  • Error in customer exit variable

    Hi All,
    My requirement is end user will enter fiscal year and in report out put I need to display fiscal year periods.
    For this I have created two variables
    1.Fiscal year-Manual Input/Default value-Single value-Mandetary-Variable is ready for input.
    2.FiscalyearperiodCustomer ExitInterval-Optional
    DATA : fiscyear1 TYPE numc4,
          i_fiscper_high TYPE /bi0/oifiscper.
    DATA: datein LIKE  sy-datum .
    CMOD Code is as below
    CASE i_vnam.
    WHEN  'ZFISCVAR'.
        LOOP AT i_t_var_range INTO loc_var_range
                             WHERE  vnam = 'ZFISCYER'.
          CLEAR l_s_range.
          fiscyear1 = loc_var_range-low(4).
          CONCATENATE fiscyear1 '001' INTO i_fiscper_high.
          l_s_range-low = i_fiscper_high.
          l_s_range-high = i_fiscper_high.
          l_s_range-sign = 'I'.
          l_s_range-opt  = 'BT'.
          APPEND l_s_range TO e_t_range.
        ENDLOOP.
    But we are getting error after entering fiscalyear
    error message --Value 2009001 for uesr exit variable xxxx is invalid.
    Regards
    Albaik

    Hi All,
    Below is the code and there is no problem with code but there was some problem with Fiscal year varient and solution is we went to source system -right click-Transfer global settings---- and maintained  Fiscal year varient 
    DATA: l_s_range TYPE rsr_s_rangesid.
    DATA: loc_var_range LIKE rrrangeexit.
    DATA: datein LIKE  sy-datum .
    DATA: L_S_RANGE_2 TYPE RSR_S_RANGESID.
    DATA : I_FISCPER_HIGH TYPE /BI0/OIFISCPER ,
           I_FISCPER_LOW TYPE /BI0/OIFISCPER.
    DATA : FISCYEAR1(4), FISCYEAR2(4),CALMONTH TYPE /BI0/OICALMONTH .
    WHEN  'ZFISPERIOD'.
        LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                             WHERE  VNAM = 'ZFISYEAR'.
          CLEAR L_S_RANGE.
          FISCYEAR1 = LOC_VAR_RANGE-LOW(4).
          CONCATENATE FISCYEAR1 '001' INTO L_S_RANGE-LOW .
             L_S_RANGE-SIGN = 'I'.
          L_S_RANGE-OPT  = 'EQ'.
          APPEND L_S_RANGE TO E_T_RANGE.
        ENDLOOP.
    ENDCASE.

Maybe you are looking for

  • Installed photoshop cc (2014) and lost image processor from Bridge

    How do I get back Image Processor from the Tools drop down menu in Bridge?  I have uninstalled and reinstalled both Bridge and Photoshop and have no positive results.

  • Any danes who can explain what this is about.

    Got this message from controlling the disc.... Kontrollerer enheden "Macintosh HD" Kontrollerer HFS Plus-enhed. Kontrollerer Extents Overflow-arkiv. Kontrollerer katalogarkiv. Kontrollerer arkiver med mange forbindelser. Kontrollerer kataloghierarkie

  • Sales Order data from CRM

    Hi all, I want to upload Sales Order data from CRM to BW with DataSource "0CRM_SALES_ORDER_I". The upload fails due to missing information that are needed in the first update rule of the Sales ODS "0CRM_SALO". In this update rule some formulars on da

  • Strange folder names

    my wife just started using a new Panasonic camera and all of a sudden her uploaded photos in iPhoto '09 are arranged in folders in the "Originals" folder that have very strange alpha-numeric names rather than the date the photos were taken. Does anyo

  • Failed to convert user externalID servermgr_xcode

    since i upgraded to 10.9 and server 3.0 i get flooded with the following messages. [CSODService.m:78 9d38000 +0ms] Failed to convert user externalID servermgr_xcode to uuid_t for membership check So I installed Xcode and integrated it via servermgr i