CMOD Variable

Hi,
I am not an ABAPer,
I am just going thru the customer exit variable in which, the following is the code:
WHEN 'XYEAR'.
    IF i_step = 2.
      CLEAR L_S_RANGE.
      LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
          WHERE VNAM = '0P_CALWE'.
        CLEAR L_S_RANGE.
        L_S_RANGE-SIGN = 'I'.
        L_S_RANGE-OPT  = 'BT'.
        CONCATENATE LOC_VAR_RANGE-LOW(4) '01' INTO L_S_RANGE-LOW.
        L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW.
        APPEND L_S_RANGE TO E_T_RANGE.
        EXIT.
      ENDLOOP.
    ENDIF.
In the above routine what is
1. i_step = 2 (what is 2? is there anything like 1,3,4..what does it do?)
2. L_S_RANGE-SIGN = 'I'.
        L_S_RANGE-OPT  = 'BT'. (what is I and 'BT')
Regards
Annie

Hi Annie,
I_STEP determines if the variable is "ready for input" or optional. If I_STEP =1 the variable processes without user input,if I_STEP = 2 the variable is processed after user enters input.If I_STEP=3 determines if the user entered valid input or in case of wrong values it will pop-up variable screen again. L_S_RANGE-SIGN determines I for Including values or E for excluding values. OPT determines whether the variable represents single value(EQ) or range(BT).Hope its clear!
Regards
Chandu

Similar Messages

  • How to use same CMOD code for 2 Diff. variableS?

    Experts,
    I have written some code under CMOD. Now, i have another query which i could use the same CODE, but diff. variable
    ( In the CMOD code, i am passing one User input variable ). For the 2nd query i have to pass different User Input variable.
    How OR what should i wright to tell CMOD, that IF its Query # 1 then use ABC variable and if Query # 2 then use XYZ .
    thanx

    Dear Hon Bon,
    Let us have a small example on ur scenario.
    Lets take the requirement as to calculate Month from Date. (In both the queries).
    Query 1: Input variable for Date is say  'ZDATE1'.
    Query 2: Input variable for Date is say  'ZDATE2'.
    Now let the CMOD variable be ZVAR_CALMONTH.
    when 'ZVAR_CALMONTH'.
        clear: lwa_var_rng,
               lwa_range.
        loop at i_t_var_range into lwa_var_rng where vnam = 'ZDATE1' or vnam = 'ZDATE2'.
          concatenate lwa_var_rng-low+0(4)
                      lwa_var_rng-low+4(2)
                 into lwa_range-low.
          lwa_range-sign = 'I'.
          lwa_range-opt  = 'EQ'.
          append lwa_range to e_t_range.
          clear lwa_range.
        endloop.
    Now when you execute the Query1,  the above code will work for 'ZDATE1' variable,
    if you execute the Query2,  the above code will work for 'ZDATE2' variable.
    So, the key point is,
    1. You need not worry about which query is getting executed. Whatever the query, the particular user entry variable of that query will be taken care.
    2. This method works only if the cmod variable (ZVAR_CALMONTH) is used in both the queries (Ofcourse its ur requirement).
    3. If queries have both the user entry variables then the cmod will work differently(it ll get data from both the user variables).
    You shall try ur code in the above example by replacing the code and the variable names and try playing around it.
    Hope this helps.
    Regards,
    Guru

  • BI CMOD Performance

    Dear Friends,
    I have a performance related question.
    We need to develop a report in which Sum of top 5 materials based on delivery quantity has to be displayed monthwise.
    Eg: If in January Materials M1 M2 M5 M6 M7 are top 5 in delivery quantity, then the sum of their delivery quantity.
    If in Feb Materials M2 M3 M5 M8 M9 are top 5 in delivery quantity, then the sum of their delivery quantity.
    and so on till December.
    I thought of using condition TOP N on delivery quantity in Bex query. (Pls correct me if i am wrong)
    Problem: Top N will work only for one month in a single query. It cant work for different month (different top 5 materials)
    Solution Proposed:
    1. Make 12 different queries, one for each month (using Top N) and put each result in a workbook.
    2. 12 different CMOD variables and cmod code picksup top 5 materials for each month and put in each variables of respective months. Restrict using these cmod variables for respective columns.
    So I wanted your valuable suggestions which of the above method will be of good performance (considering maintenance, etc factors) and the reason also.
    Approximate number of records 1 lakh per year.
    Kindly give ur suggestions.
    Thanks,
    Guru

    Hi
    I think I hv answered this in some other thread. Pl close this thread.
    Cheers
    Umesh

  • Performance wise: CMOD or dividing the queries.

    Dear Friends,
    I have a performance related question.
    We need to develop a report in which Sum of top 5 materials based on delivery quantity has to be displayed monthwise.
    Eg: If in January Materials M1 M2 M5 M6 M7 are top 5 in delivery quantity, then the sum of their delivery quantity.
    If in Feb Materials M2 M3 M5 M8 M9 are top 5 in delivery quantity, then the sum of their delivery quantity.
    and so on till December.
    I thought of using condition TOP N on delivery quantity in Bex query. (Pls correct me if i am wrong)
    Problem: Top N will work only for one month in a single query. It cant work for different month (different top 5 materials)
    Solution Proposed:
    1. Make 12 different queries, one for each month (using Top N) and put each result in a workbook.
    2. 12 different cmod variables and cmod code picksup top 5 materials for each month and put in each variables of respective months. Restrict using these cmod variables for respective columns.
    So I wanted your valuable suggestions which of the above method will be of good performance (considering maintenance, etc factors) and the reason also.
    Approximate number of records 1 lakh per year.
    Kindly give ur suggestions.
    Thanks,
    Guru
    Edited by: hi2guru on Nov 17, 2010 5:21 AM
    Edited by: hi2guru on Nov 17, 2010 5:55 AM

    Hi
    Interesting situation !!!
    I think writing 12 queries is not a good idea. For a simple reason that you will have either run a Query at a time (with a different input for each of this) .. isnt it ?
    Creating variables for each of the month would be a good idea. You could generate value of 11 months based on a single input from the user. Moreover, the user can give any input ...say for eg the input is 11.2010 then through the customer exit you could find values for the past 11 months. Similarly even if the user changes the input value (say to 08.2010) the system can easily calculate the previous 11 months thus giving you the desired output.
    Cheers
    Umesh

  • Populating the value of Sel Screen Parameter in the Free Characrtistic

    Hi  ,
    The requirement is that we have 2 dates - Touched Date and Created on Date .
    The Touched date is present in the Selection Screen .
    Now we need to use th value entered  for the Touched Date as default value of the created on Date in  the Free Characteristics.
    Please provide inputs on the same .
    Regards
    Edited by: Garima on Dec 10, 2010 4:07 PM

    As you said touched date is present in selection screen, you might be having a manula i/p variable for it. Right?
    Now create a cust exit variable for "created on Date".
    In cmod transaction use the following code to populate values from touched date to created on date.
    when '+Variable name of created on date+'.
        loop at i_t_var_range into lwa_var_rng where vnam = +'variable name of touched date'+.
          lwa_range-low  = lwa_var_rng-low.
          lwa_range-high = lwa_var_rng-high.
          lwa_range-sign = 'I'.
          lwa_range-opt  = 'EQ'.
          append lwa_range to e_t_range.
          clear lwa_range.
        endloop.
    This code u should write inside  if i_step = 2. condition.
    Now the cmod variable of created on date will have the same values of the touched date populated.
    Now u can use the filter as cmod variable of created on date and use created on date in ur free characteristics.
    Hope this helps. Revert back for any queries.
    Rgds,
    Guru

  • Bex Query which uses Dynamic columns to display actuals

    Hi Bex experts,
    I have a query issue/question.
    I currently have a Bex query which shows me the the planned values for each period, spanning 6 years into the future. My Key figure columns are defined as follows:
    Value type  = '020'
    Version  = mandatory variable, entered at execution.
    Posting period (FISCPER3)  = These columns are fixed values using periods 1 to 12 for each column.
    Fiscal year (0FISCYEAR) = Each column contains SAP exit for current year, and using the offset +1, +2, +3, +4 etc, when I define the future years coulmns.
    Currency = fixed 'USD'.
    Fiscal year variant = fixed 'Z4'
    The above works fine for plan data.
    I want to now include is:
    Seperate 'Dynamic columns' to show only actuals for period ranges from period one to the previous period (or current period minus 1). Each period should have it's own column for actuals.
    The dynamic actuals columns should be grouped together to the left of the plan columns.
    Actuals are only for current year, so I will still use the SAP EXIT for current year in the column definition.
    Example: If I am currently in period 10, the query should show me actuals from period 1 to period 9 in seperate columns, then continue to show me my plan values columns that I have in place already.
    How can I construct these actuals columns in to my existing query. If you have possible screens shots.
    Thanks, and maximum points will be alotted.

    The way I have approached this you may not like as it involves quite a bit of coding
    12 CKFs
    each CKF adds up 2 RKFs
    So 24 RKFs
    example Column 6 CKF
    Adds Column 6 RKF Actual and Column 6 RKF Plan
    Column 6 RKF Actual contains Actual version + key figure + Period variable column 6 Actual
    Column 6 RKF Plan contains Plan version + key figure + Period Variable column 6 Plan
    Period variable column 6 Actual
    is a cmod variable which reads the entered date
    if the period of entered date is LE 6
    then return period 6 into "Period variable column 6 Actual"
    else put 0 into "Period variable column 6 Actual"
    Period variable column 6 Plan
    is a cmod variable which reads the entered date
    if the period of entered date is LE 6
    then return period 0 into "Period variable column 6 Plan"
    else put 6 into "Period variable column 6 Plan"
    Now what happens is that if you enter period 6 in your selection screen all the Actuals of columns greater than 6 all have period 0 put into their selection so return 0 and all the columns less than or equal to 6 return the values for the fiscal period (ie column 1 gets period 1)
    And in addition all the Plans columns return the value of their column ie for their period for those greater than 6 and for those less than 6 they all return 0
    It's convulted - but you get the idea - and yes it works
    There may be a better way to do it - and I am open to suggestions
    (this does assume that NOTHING is posted to period 0 otherwise it won't work)

  • Queries based on Master data for the particular periods not working

    Hi,
    My Queries are based on master data and for 2007 we did not have customer groups define hence for the historical also we would like to display the customer groups hence we are reproting based on master data. But when iam executing my reprots for each and every month for the 2007 , i can able to execute the reprot properly but same when iam giving the values in ranges with the help of input filed ( calender month -interval) its taking hours but unable to retrieve the data for the 6 months at a time even if iam restricting the values in the queries still the problem is same...
    Can anyone has an idea what would be the problem .. its only for 6 months
    Thanks

    Hi
    Master data report consumes much time. try to see the Query Statistics  and make the performance tuning.
    Recheck your data flow for routines at TRules/upRules level.
    Recheck on the Query designer for formula/ Cmod Variables.
    The report fetching time even depends on the NO.of records too.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d06dcd70-41a8-2b10-9f8f-dc5c68769753
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6009e125-e9a3-2a10-c6a9-e1483dfa2e1b
    Hope ithelps

  • Wild selection material mask is not working

    Dear experts ,
    selection criteria contains as material selection KX-MB*. Expected result is to get all materials started from KX-MB however result is showing all material.
    please advise me how to correct to work this wild selection .
    Puru

    Surprising. This does work.
    Hope this is selection option variable?
    Could you please let me know the front end used by you and please check this in RSRT as well.
    In worst case Scenario, you could implement a cmod variable that would work as you expect.
    Thanks.

  • BEx Query Designer - Customer Exit

    Hello All,
    I have a requirment to create USER customer exit.
    User will enter the value of Month(ex, 02, 03...) and Year (ex 2010,2011 ...)  with two different prompt screen.
    Now i have to return back a date back to a RKF based on following senario:
    1) If month and year is current month and current year than return back current date to the perticular RKF Date.
    2) If month and year is not current month and current year then return back the last date of the month and year entered.
    Thanks & Regards
    Nishant

    HI,
    Just restrict the RKF with a CMOD variable and write the CMOD code as follows (sample):
    assume your month and year variables are as follows: VAR_MON and VAR_YEAR
    DATA: L_S_VAR LIKE RRRANGEEXIT.
    DATA: L_S_RANGE TYPE RSR_S_RANGESID.
    DATA: V_MON TYPE C LENGTH 2.
    DATA: V_YEAR TYPE C LENGTH 2.
    DATA: V_MONTH TYPE /bi0/oicalmonth.
    DATA: V_CURR_DATE TYPE SY-DATUM.
    DATA: V_DATE TYPE SY-DATUM.
    when 'variable_name'.
    if i_step = 2.
    READ TABLE I_T_VAR_RANGE WITH KEY VNAM = 'var_mon' INTO L_S_VAR.
    IF SY-SUBRC = 0.
       V_MON = L_S_VAR-LOW.
    ENDIF.
    CLEAR L_S_VAR.
    READ TABLE I_T_VAR_RANGE WITH KEY VNAM = 'var_year' INTO L_S_VAR.
    IF SY-SUBRC = 0.
       V_YEAR = L_S_VAR-LOW.
    ENDIF.
    V_CURR_DATE = . "Current date
    "Check for the values
    if V_MON eq V_CURR_DATE+4(2) AND V_YEAR eq V_CURR_DATE+0(4).
    V_DATE = SY-DATUM.
    else.
    CONCATENATE V_YEAR V_MON INTO V_MONTH.
    "call some function module to populate the last day of the above month (V_MONTH)
    "and populate the above obtained value into V_DATE.
    "see if you can use this SG_PS_GET_LAST_DAY_OF_MONTH
      L_S_RANGE-SIGN = 'I'.
      L_S_RANGE-OPT  = 'EQ'.
      L_S_RANGE-LOW  = V_DATE.
      APPEND L_S_RANGE TO E_T_RANGE.
    endif.
    Regards,
    Joe

  • How to read variable in CMOD code !

    Experts,
    in my one of the query, there is a variable, which takes 2 dates. so the variable is type "interval"
    so, when you run the report, user needs to enter value something like this.."mm/dd/yyyy  - mm/dd/yyyy"
    Now, i have writtn a code in CMOD, by reading this variable.
    But i dont know how to read 2nd date from the variable.
    READ TABLE   i_t_var_range
                 WITH KEY   vnam = 'VARIABLE'
                 INTO       l_var_range.
              First Date = l_var_range-low.
              Second Date = l_var_range-high.
    Does this low and high thing is correct?
    if i do debug, i could see the low values. but i coud see the same low values in High too.
    whats the problem ?
    please help

    Hi ,
    There are some scenarios for using CMOD, for variables in report.
    And as per I understand for you issue, please find my comments
    Scenario : You want to use the values enter by user in some other variable in the same report.
    Please make sure that properties of both the variables are same.
    Use below code:
    DATA: l_s_range TYPE rsr_s_rangesid.
    DATA: loc_var_range LIKE rrrangeexit.
       WHEN 'New Variale'.
            IF i_step = 2.
              LOOP AT i_t_var_range INTO loc_var_range
                      WHERE vnam = 'Varaible in which user has entered value'.
                CLEAR l_s_range.
                l_s_range-low  =   loc_var_range-low  .
                l_s_range-high =   loc_var_range-high .
                APPEND l_s_range TO e_t_range.
              ENDLOOP.
            ENDIF.
    Thanks
    Mayank
    Edited by: Mayank Chauhan on Feb 8, 2011 11:45 AM
    Edited by: Mayank Chauhan on Feb 8, 2011 11:46 AM
    Edited by: Mayank Chauhan on Feb 8, 2011 11:47 AM

  • Variable not touching the CMOD

    Hi,
    I defined a variable in the query and included the code in CMOD, But when i execute the query, the query is not touching the CMOD code and the variable is not getting populated.
    Please let me know what could be the reason and what should be done to execute the code in CMOD.
    Thanks
    GK

    Rishi,
    Y dont try to Debug the Query  in RSRT by giving ur query tech, name as selection . And one more thing put a break-point in the CMOD after activating exit where u wrote the code.
    Check wether the varaible processing type is Customer exit or not. And Is the code is calling that Varaible.
    Hope it helps
    bhaskar

  • Unable to debug/correct the CMOD code for a variable used in a query

    unable to debug/correct the CMOD code for a variable used in a query
    i am using the data in a DSO in a query and using a custom coding variable in that query , but this data not coming in that query ..
    can anyone suggest how to debug that cmod code for the variable?
    code is written in CMOD tocde for the variable.

    belowis the code that i have written for a custom coding for a variable
    *******Start***
    IF i_step = 2.
      CASE i_vnam.
        WHEN 'IC_COMPCD'.
         TYPES:       BEGIN OF gt_itab_DyAuthTable,
                           username  TYPE /bic/afiop_o1200-/BIC/IC_USER,
                           companycode TYPE /bic/afiop_o1200-COMP_CODE,
                      END OF gt_itab_DyAuthTable,
                      BEGIN OF gt_itab_Cocd_all,
                            companycode TYPE /BI0/MCOMP_CODE-COMP_CODE,
                      END OF gt_itab_Cocd_all.
          DATA: gi_itab_DyAuthTable TYPE STANDARD TABLE OF gt_itab_DyAuthTable,
                wa_itab_DyAuthTable TYPE gt_itab_DyAuthTable.
           DATA: gi_itab_Cocd_all TYPE STANDARD TABLE OF gt_itab_Cocd_all,
                wa_itab_Cocd_all TYPE gt_itab_Cocd_all.
          SELECT /BIC/IC_USER
                 COMP_CODE FROM /bic/afiop_o1200
            INTO CORRESPONDING FIELDS OF TABLE gi_itab_DyAuthTable
            WHERE /bic/ic_user = sy-uname.
          LOOP AT gi_itab_DyAuthTable INTO wa_itab_DyAuthTable.
            IF wa_itab_DyAuthTable-companycode EQ '*'
              OR
              wa_itab_DyAuthTable-companycode EQ ' '.
              SELECT COMP_CODE FROM /BI0/MCOMP_CODE
                  INTO CORRESPONDING FIELDS OF TABLE gi_itab_Cocd_all.
              LOOP AT gi_itab_Cocd_all INTO wa_itab_Cocd_all.
                l_s_range-low    = wa_itab_Cocd_all-companycode.
                l_s_range-sign   = 'I'.
                l_s_range-opt    = 'EQ'.
                APPEND l_s_range TO e_t_range.
              ENDLOOP.
          to exit the loop if any one value is */space/all for a user's compcode values
            EXIT.
            ENDIF.
          ENDLOOP.
           if control is here means, the comp codes values didnt have */space
              LOOP AT gi_itab_DyAuthTable INTO wa_itab_DyAuthTable.
                l_s_range-low    = wa_itab_DyAuthTable-companycode.
                l_s_range-sign   = 'I'.
                l_s_range-opt    = 'EQ'.
                APPEND l_s_range TO e_t_range.
              ENDLOOP.
      Endcase.
    Endif.

  • Variable based on attributes of another variable (using Exit & CMOD)

    Hello,
    Another coding question (while I get the previous one to work!)
    I have a query with amongst others, 2 variables.
    one is a require year variable in the query only ZREQYEAR
    another is a module ZMODULE
    ZMODULE have two attributes
       Year of start ZYEAR_START
       Year of end ZYEAR_END
    I need to write a enhancement in CMOD which does the following.
    When the query runs, it asks the user for a year (ZREQYEAR), lets say they those 2010 for this example.
    Based on this, the enhancement needs to populate the variable for ZMODULE with entries where
    ZMODULE-ZYEAR_START = 2010
    OR
    ZMODULE-ZYEAREND = 2010
    and then display the query for just these modules.
    is this possible? if you can think of  better way then I am open!
    I am very new to CMOD and ABAP so please keep any responses in baby language!  THANKS!!

    Hi,
    You can follow the below given steps,
    1) You will have to do all the coding in enhancement RSR00001, for using this enhancement you will have to create a project in CMOD transaction and do the coding in the available EXIT.
    2) Inside the EXIT write your code for customer exit variable created on ZMODULE (You will have to create a customer exit variable on ZMODULE infoobject).
    3) In the exit use your variable name for doing coding,
    When "ZMODULE_VARIABLE".
      IF I_STEP = 2.
        Loop at i_t_var_range into wa_var_range where vname = "ZREQYEAR_VARNAME".
        wa_data-sign = 'I'.
        wa_data-option = 'EQ'.
        wa_data-low = wa_var_range-low.
        append wa_data to e_t_data.
        EXIT.
        endloop.
        Endif.
    The value of ZREQYEAR is assigned to variable created on module. You can use following document for reference,
    [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f1a7e790-0201-0010-0a8d-f08a4662562d]
    Regards,
    Durgesh.

  • Code (ABAP) for the Customer Exit Variable (CMOD)

    Scenario
    An employee can purchase any no of policies in a day or month.each policy will have start date and expiry date.
    My requirment
    Count all the policies(valid) by employee on a ranges basis exception reporting
    (0-10;10-20;20-30;30-40) and then able to drill down by policy start date and expiry date.
    As per the requirment is to show policies that employee had with in the give date intreval  which are not yet expired (active) i need to write a condition that will count only policies whose Expiry date is > Current calender day
    As Policy Expiry Date is a char i am converting it to KF using fourmala variable so that i can write a condition on it using current cal day formula variable sap exit
    Requirment:
    Need a code for SAP exit variable which will meet the following requirment
    There are the following 2 variables in the query
    1) A variable (User Input)(Date Range) on Policy Start Date and
    2) Authorisation Variable which is based on Authorisation Object(Analysis Authorisations)
    I need a SAP Exit variable (CMOD) that will
    BAsed on the user entered Policy Start date it has to pick all the policy exiry date of the policies and display all the policies whose expiry date is greate than Sy Date (Current Date) and also if Policy Expiry Date is blank or # it has to display
    Arun supplied me with the below code...but i think it doesn't include blank expiry date or #...as i am new to ABAP please update me with releavent code
    Policy Start Date : ZPST_DTE
    Policy Expiry Date: ZPSP_DTE
    Variable (Type:Customer Exit) on Expiry Date: ZEEXP_DTE
    Arun's Code:
    IF I_STEP = 1.
    CASE V_NAME
    WHEN 'X' " X is the variable u created for the exit
    l_s_range-low = SY-DATUM.
    l_s_range-opt = 'I'.
    l_s_range-sign = 'GT'.
    APPEND l_s_range TO e_t_range.
    END CASE.
    Please modify above code to include Blank or # values of Expiry Date
    Thanks Arun
    Please ask if you need further info as this is urgent
    Thanks

    Hi Arun,
    Thanks for the help...will definetly assign points
    (Closed the previous thread)
    Please spare bit of ur time as this is my first ABAP Code
    Can i include 2 restrictions..# and Variable (Customer Exit)...But how can i include Records with Blank Values
    As the data from Source system the expiry date is filled up with either Date or # or Blank...my requiorment is to include all 3 and
    Question:
    As there are 2 other variables defined ..one on Policy Start Date (User input date intreval) and Location (Authorization Variable..Analysis Authorisations)...Do i need to change I_STEP in the code
    (Req: Reports shows all the(still valid) policies emp has purchased between  2 give date (Variable on Policy Start date)
    IF I_STEP = 1.
    CASE V_NAME
    WHEN 'X' " X is the variable u created for the exit
    l_s_range-low = SY-DATUM.
    l_s_range-opt = 'I'.
    l_s_range-sign = 'GT'.
    APPEND l_s_range TO e_t_range.
    END CASE.

  • 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

Maybe you are looking for

  • Itunes 9.0.2 ridiculously slow

    I am by no means the first person to post on this topic, but after reading through countless threads that all lead to the same frustrating "Where is Apple??" conclusion, I thought I would post my own thread to see if any light has been shed on the su

  • My new computer is "offline" to Aperture

    I bought a new laptop to replace a previous one. I used Migration Manager. All the photo files and the Aperture Library are where they previously were. I renamed the HD on the new computer to match that of the old. I am the same user name and passwor

  • User submitted Credit Card Historical Transactions Management Report by mis

    A user has submitted the 'Credit Card Historical Transactions Management Report' by mistake. They have noticed that as a result of this, the concurrent request appears to have deactivated all iExpense unused transactions up to and including the date

  • Saving your website in iWeb before moving to new project

    Hi there! I have a questions and was wondering if anyone can help me. I've created a website in iWeb, which I've loaded to .Mac. Now I need to start another project and I fear that the new 1.1 update may cause some errors etc with my new project whic

  • How to use '\' operator ?

    hi, i need to use '\' operator in a string, but not as escape character. since its not possible to use it, but is there any way. Deepa Datar