Variable Code for Date

Requirement: I have Posting Date for all Objects Now i want to create the <b>Variable “PSTVAR”</b>such that the variable will populate <b>only the entries with
User Input Posting Date(During Report Execution) >=greater than equal to Posting Date(OPSTDATE). .</b>
<b>Example</b> POSTING DATE = 03032007
POSTING DATE = 01012006
IF USER INPUT DATE = 01012007
Then only POSTING DATE = 03032007 will show up in report
write the code in <b>customer exit cmod in BI</b> if CAN CORRECT THE CODE WOULD BE GREAT
Data: l_s_var_range Type rrangeexit.
L_d_PSTDATE Type /bio/oipstdate.
L_d_PSTDATE Type /bio/oipstdate.
IF I_STEP=2.
READ TABLE I_t_var_range INTO l_s_var_range WITH KEY VNAM = ‘PSTVAR’.
If L_d_PSTDATE >= PSTVAR’
L_d_PSTDATE=l_s_var_range-low(0)
Please help me modify the above code with logic or with some extra line of code to solve my requirement. Appreciate all of you for help in advance
Thanks
Soniya Kapoor

This can be done without any coding.
If you are using the Web, there is a Boolean operator dropdown for each variable. Enter "1/1/2007" for the Posting Date variable value (in your example), then change the operator to ">=". (There is probably even a way to default to this.)
If you are using Excel, enter "1/1/2007" for the Posting Date variable value, then right click and choose "Options" and ">=".
Hope this helps...
Bob

Similar Messages

  • Can i have html code for date select options (SEARCH HELP)

    Hi frinds,
    I have a BSP Page with input as date.
    Can i have html code for date select options (SEARCH HELP)
    Moosa

    Hi
    Please find the sample code below.
    FROM DATE
          <htmlb:inputField id        = "dd"
                            width     = "45%"
                            type      = "DATE"
                            showHelp  = "X" <- Search help
                            alignment = "CENTER"
                            maxlength = "10"
                            disabled  = "TRUE"
                            value     = "<%= w_FROMDATE %>" />
    TO DATE
          <htmlb:inputField id        = "dd"
                            width     = "45%"
                            type      = "DATE"
                            showHelp  = "X"
                            alignment = "CENTER"
                            maxlength = "10"
                            disabled  = "TRUE"                      
    value     = "<%= w_TODATE %>" />
    Thanks
    kalyan

  • ABAP code for Date Range

    Hi All,
    I have requirement to write code for date range.
    Characterstic = Run-Out Date, it was created reference to 0Date.
    Requirement is data should load depends on Run-Out Date 7 days old and 14 days future.
    Logic is -7 days old >= Run_out date <= 14 days future.
    please let me know how I need to proceed with ABAP code for this requirement.
    Thanks.
    Please do not ask for ABAP code here. Its not a training forum
    Edited by: Pravender on Aug 18, 2011 1:46 AM

    >
    Sree vignesh wrote:
    > Hi,
    > In the select option we have a field month range as
    > SELECT-OPTION : FROM 01.2007       TO  01.2009 " Let say Ur Selection option is SO_MONTH
    > but now i need to add the DMBTR field considering the month range in the SELECT OPTION i.e., only FROM 01.2007 TO  01.2009 i mean without 2006 data.
    >
    > LOOP AT LT_DATA WHERE month in SO_MONTH. " Here add a Where condition
    >     ls_output-matnr = lt_data-belnr.
    >     ls_output-werks = lt_data-bukrs.
    >     ls_output-lgort = lt_data-dmbtr.   
    >
    >     COLLECT  ls_output INTO lt_output .
    >
    >   ENDLOOP.
    >
    > please help with code .
    >
    > thanks in advance.
    Regards,
    Suneel G

  • Demo code for data mining

    Where can I find the demo code for data mining?

    Where can I find the demo code for data mining?

  • Variable offset for date - a year ago

    I have this sales report with the following columns:
    1. Current Day Sales
    2. Month to Date Sales (this Year)
    3. Month to Date Sales (last Year)
    I'm using a range variable for 0CALDAY for column 2 (Month to Date Sales this year).  i'm having problem with column 3.  how is it possible such that the date is automatically assigned to last year's values?  using offset would mean -365, however, this may not work during leap years?
    please help

    Hi,
    Refer the 'Examples for using Variables' in 'Bex Query designer' of sap help..
    Examples for Offset Variables
    You want to use a query to carry out a comparison of two years.
    Year Comparison
    You want to compare the costs of a year of your choice with the costs of the previous year.
           1.      In the Query Designer, create a new structure and add a new Selection for each year that you require.
           2.      Only use one key figure (for example revenue) in this example query. Add this key figure to the filter or add it to the selection.
           3.      Use a characteristic value variable for the characteristic Calendar Year (0CALYEAR):
    Select the characteristic value variables for Calendar Year and, from the context menu (right mouse click), choose New Variables. The Variables Wizard appears.
    If you always want to reference to the current year automatically, use the SAP Exit variable 0CALYEAR (or as appropriate for another time characteristic).
           4.      Move the defined characteristic value variable into the selection.
           5.      Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
                                a.      Select the characteristic value variable and from the context menu, choose Enter Variable Offsets.
                                b.      Enter –1 as the offset and choose OK.
           6.      Choose OK.
           7.      Enter a description.
    Example: Use the name of the key figure, for example, revenue, for the name and use a text variable for the name of the calendar year. See Using Text Variables.
    When creating a new text variable, enter Replacement Path as the processing type, and choose calendar year 0CALYEAR as the characteristic with display as key.
           8.      Create a second selection with the same characteristic value variable and do not set an offset here.
    Also use a text variable in the description in this case.
           9.      Move the required characteristic into the rows.
       10.      Save the query.
    After execution, the query should appear as follows:
    Variable screen entry: 2002 (or no entry when using the SAP Exit Variable).
    Year Comparison
    A characteristic
    Revenue 2001
    Revenue 2002
    Value 1
    100.000
      90.000
    Value 2
    200.000
    180.000
    Value 3
    300.000
    400.000
    Comparison with Cumulative Previous Year Period
    For example: You want to compare the periods 1-8 of a particular year with the same periods for the previous year.
           1.      Create a new structure in the Query Designer and add a new Selection.
           2.      Move a key figure, for example, Revenue, into the selection.
           3.      Use a characteristic value variable for the characteristic Fiscal Year/Period (0FISCPER):
    Select the characteristic value variables for Fiscal Year/Period and from the context menu, choose New Variable. The Variables Wizard appears.
    Use the SAP Exit variable Current Fiscal Year/Period (0FPER) if you always want to reference to the current year.  If you set the variable as entry-ready in the Variable Editor, after executing the query, the variable screen then appears with which you can change the default values were necessary.
           4.      Move the characteristic value variable, such as OFPER, into the selection.
           5.      Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
           6.      Under Selection, choose Value Area and choose the tab page Variables.
           7.      Add the characteristic value variable, for example 0FPER, to the selection once again for the second value of the interval.
           8.      Select the characteristic value variable and from the context menu, choose Enter Variable Offsets.
                                a.      As an offset, enter -3 as the from value and 0 as the to value. Choose OK.
                                b.      Choose OK.
           9.      Enter a description, such as Revenue for current year.
       10.      Choose OK.
       11.      Select the selection and from the context menu, choose Copy and then Paste.
       12.      Now select the second selection and from the context menu, choose Edit.
       13.      Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
       14.      Select the characteristic value variable again and from the context menu (the right hand button), choose Enter Variable Offsets.
                                a.      As an offset, enter -15 as the from value and -12 as the to value. Choose OK.
                                b.      Choose OK.
       15.      Enter a description, for example Revenue for previous year.
    Also use a text variable in the description in this case.
       16.      Choose OK.
       17.      Move the required characteristic into the rows.
       18.      Save the query.
    After execution, the query should appear as follows:
    Variable screen entry: 01. 2002 to 08. 2002
    Comparison with Cumulative Previous Year Period
    A characteristic
    Revenue 01. – 08. 2001
    Revenue 01. – 08. 2002
    Value 1
    100.000
      90.000
    Value 2
    200.000
    180.000
    Value 3
    300.000
    400.000
    Two text variables replaced with characteristic values were used for the descriptions here. One is filled with the from-value for the column with an offset of 0 and a length of 3, the other filled with the to-value with an offset of 0 and a length of 7. You can find additional information under Example for Variable Replacement.
    Comparison of Cumulated Values for Two Years
    You may want to compare the cumulated values up to the current period of the current year with those of the previous year.
    For this example, use the variable 0FPER (current fiscal year period) and the variable 0P_FPER (your chosen fiscal year period). You use these two variables to set the interval limits.
           1.      In the Query Designer, create a structure with two selections:
    ¡        1. selection: Cumulative Amount for current year
    ¡        2. selection: Cumulative amount for previous year
           2.      With the first selection (cumulative amount for current year) , move the time characteristic 0FISCPER into the selection and select it.
           3.      Choose Restrict from the context menu (right mouse click).
           4.      Choose Value Area between as the selection and go to the tab page Variables.
           5.      Double click to choose the variable 0P_FPER as the from value and variable 0FPER as the to value. The result is an interval from the chosen period to the current period.
           6.      Define the second selection (cumulative amount for previous year) and proceed as for the first selection.
    ¡        Add the variable 0P_FPER as the from value and variable 0FPER as the to value here.
    ¡        Set an offset of –12 for both the from and the to values:
    Select the interval and from the context menu (right click), choose Enter Variable Offsets. Enter –12 for each.
    The result is an interval that has been moved 12 periods ahead.
           7.      Add the key figures and additional characteristics for the query.
    After executing the query, you get a variable screen for the variable 0P_FPER. You need to enter the start period in the current fiscal year.
    You can also suppress this entry by deactivating the indicator Entry-ready in the Variable Editor for the variable 0P_FPER and entering a default value (for example, 001.2001 for 2001). You only have to change this value once per year.
    You have now defined a query that compares the cumulative values for two years.
    The variables with SAP Exit delivered by SAP have the following behaviors:
    Variable 0FPER (current fiscal year period): Displays the values of the current fiscal year period.
    Variable 0P_FPER (any fiscal year period): Displays the values of any fiscal year period. You can set the fiscal year period in the variable screen when executing the query in any way you require.
    Variable 0FYTCFP (fiscal year up to current fiscal year period): Displays the values of the first period up to the current period of the current fiscal year.
    Variable 0FYTLFP (fiscal year up to previous fiscal year period): Displays the values of the first period up to the previous period (current period –1).
    You need to use the variables 0FPER and 0P_FPER in the above example for the comparison of cumulative values for two years.  When using the variables 0FYTCFP and 0FYTLFP, only values for one month are displayed for year transitions with an offset of –12.
    Regards,
    Prema

  • Variable Required For Date Difference In Ac Create Date

    Respected All;
    I am stuck in a variable for couple of weeks.
    Please help me to get the difference in dates coming under the Ac Create Date Column for respective Request Id's.
    I want the result in the Delay Column (Variable Required for the result of delay).
    For eg:-
    A
    B
    C
    D
    E
    F
    G
    Request Id
    Ac Create Date
    Act Role Proper Name
    Delay Simplified(Variable Required
    Result In Delay
    Act Activity Name
    1
    000000000560492
    7/9/2014
    Debt Recovery - Archive
    =Ac Create Date C2 - Ac Create Date C1
    5
    Resolved
    2
    7/14/2014
    Call Centre - Back Office
    =Ac Create Date C3 - Ac Create Date C2
    1
    Forward
    3
    7/15/2014
    OWN Shop - AL Rayyan
    =Ac Create Date C4 - Ac Create Date C3
    7
    Resolved
    4
    7/22/2014
    Call Centre - Back Office
    = Ac Create Date C5 - Ac Create Date C4
    0
    Customer Feedback
    5
    7/22/2014
    Call Centre - Back Office
    "NA"
    NA
    Closed FC
    6
    000000000561010
    7/1/2014
    Call Centre - Back Office
    =Ac Create Date C7 - Ac Create Date C6
    1
    Forward
    7
    7/2/2014
    FOLLOW UP TEAM
    =Ac Create Date C8 - Ac Create Date C7
    0
    Resolved
    8
    7/2/2014
    Call Centre - Back Office
    =Ac Create Date C9 - Ac Create Date C8
    1
    Forward
    9
    7/3/2014
    R_RO
    =Ac Create Date C10 - Ac Create Date C9
    12
    Return - Wrong Assignment
    10
    7/15/2014
    Call Centre - Back Office
    =Ac Create Date C11 - Ac Create Date C10
    1
    Forward
    11
    7/16/2014
    IT CRM & Provisioning
    =Ac Create Date C12 - Ac Create Date C11
    0
    Reassignment
    12
    7/16/2014
    IT CRM & Provisioning
    =Ac Create Date C13 - Ac Create Date C12
    1
    Follow Up
    13
    7/17/2014
    IT CRM & Provisioning
    =Ac Create Date C14 - Ac Create Date C13
    0
    Reassignment
    14
    7/17/2014
    IT_Comptel
    =Ac Create Date C15 - Ac Create Date C14
    3
    Resolved
    15
    7/20/2014
    Call Centre - Back Office
    =Ac Create Date C16 - Ac Create Date C15
    0
    Recategorization
    16
    7/20/2014
    Fiber Call Center-Back Office
    =Ac Create Date C17 - Ac Create Date C16
    0
    Forward
    17
    7/20/2014
    IT CRM & Provisioning
    =Ac Create Date C18 - Ac Create Date C17
    1
    Resolved
    18
    7/21/2014
    Fiber Call Center-Back Office
    =Ac Create Date C19 - Ac Create Date C18
    0
    Resolved
    19
    7/21/2014
    Fiber Call Center-Back Office
    =Ac Create Date C20 - Ac Create Date C19
    0
    Customer Feedback
    20
    7/21/2014
    Fiber Call Center-Back Office
    "NA"
    NA
    Closed
    I have used Delay =DaysBetween([Ac Create Date];Previous([Ac Create Date]))
    but however I'm not getting the results required..
    Can someone please help me out with the variable.. For better understanding of the question kindly copy paste the table in excel and check it out, but please please help me out !!!
    Thanks In Advance

    Hi Fahad,
    Try Below-
    Create variable-
    V_NextDate=If RelativeValue([Request Id];([Request Id];[Ac Create Date];[Act Activity Name];[Act Role Proper Name]);1)=[Request Id] Then ToDate((RelativeValue([Ac Create Date];([Request Id];[Ac Create Date];[Act Activity Name];[Act Role Proper Name]);1));"MM/dd/yyyy")
    In Delays column put below
    =If IsNull(DaysBetween([Ac Create Date];[V_NextDate])) Then "NA" Else DaysBetween([Ac Create Date];[V_NextDate])
    See sceenshot

  • Variable binding for Date type over ODBC

    Hi I'm trying to parameterize a DATE variable over ODBC. Over JDBC I have no problem doing so in Java but on the ODBC (C-code) I had problem figuring out how to deal with the expression, *{ts '2009-02-23 09:02:10'}.* But eventually based on SQL tracing on the DB side, I found that it gets translated to to_date('2009-02-23 09:02:10', 'YYYY-MM-DD HH24:MI:SS'). So now I can attempt to parameterize. But that's the side story.
    My question is, do I gain any performance by doing the following (cut and paste from SQL trace)
    SELECT ROWID, reservation_id, job_type, job_start
    FROM reservation_job_queue
    WHERE job_start &lt;= to_date(:1, 'YYYY-MM-DD HH24:MI:SS')
    ORDER BY job_start
    as compared to the original
    SELECT ROWID, reservation_id, job_type, job_start
    FROM reservation_job_queue
    WHERE job_start &lt;= to_date('2009-02-23 09:02:10', 'YYYY-MM-DD HH24:MI:SS')
    ORDER BY job_start
    Thanks!
    Edited by: pidge66 on Feb 23, 2009 6:27 AM
    Edited by: pidge66 on Feb 23, 2009 6:30 AM

    If I understand you correctly, you want to be able to enter some arbitrary dates in the where-clause of your application.
    Thus, to use the first form with a bind variable is key for performance of your application.
    And yes, you will gain a lot of performance when using to_date(:1, 'YYYY-MM-DD HH24:MI:SS') instead of to_date('2009-02-23 09:02:10', 'YYYY-MM-DD HH24:MI:SS').
    Why not using bind variables is evil you can read best over at AskTom

  • Cmod code for data extractor enhancement

    hi guys  i need some help writing some abap code
    the requirement is to enhance the datasource to show data..i have data like
    1  b  john   etc...
    1  c  john   etc..
    1  d john   etc...
    the data belongs in the same structure. .. the structure has 15 fields and i could append the structure with a new filed to hold the concatenated value of b, c, d.
    i need it to written out in the data source as
    1 line showing
    1  b c d  john   etc.......
    delete the rest of the extra lines..
    any ideas.?

    Hi Amar,
    You can do this in start routine of transformation.
    Create one internal table to hold the target value ie. combination of a b c and d in one field.
    Now you can keep  looping on source package and collect all the similar values as given below.
    create a temporary variable for storing the value of field1 which is holding all 1 values.
    Loop at source_package into wa_package.
    if sy-tabix = 1.
    temp_field1 = wa_package-field1.
    concatenate wa_table-field2 wa_package-field2 into wa_table-field2.
    endif.
    if temp_field1 = wa_package-field1.
    concatenate wa_table-field2 wa_package-field2 into wa_table-field2.
    else.
    append wa_table into it_table.
    clear wa_table.
    wa_table-field2 = wa_package.
    endif.
    endloop.
    Regards,
    Durgesh.
    endloop.

  • How to use the same variable value for data entry and the planning sequence

    Hi,
    the scenario is the following:
    Using the WAD template a user enters cost center plan data. The cost center is selected by the chosen value for the variable "V1".
    Afterwards he shall push a button which starts a planning sequence (including saving the data and further functions). This planning sequence uses a filter that also contains the variable "V1".
    What or where has it to be defined that the planning sequence uses automatically the same value for the variable "V1" as selected for the data entry?

    You have to define in the planning function. The planning sequence is only a sequence and it read the planning functions underneath it.
    Ravi Thothadri

  • Code for date navigator

    Hi,
    I want to display one date navigator input field in my ITS Screen. Please provide me the HTMLB code if you have or tell me the procedure to do the same..
    Thanks in advance...
    Naresh

    user8967004 wrote:
    i want insert date of birth in contionues....and.....this date of birth is taken by user.......Curiosity compels me to ask: How does this relate to the 'Technology Network Community » Downloads' forum purpose?
    (The forum description says: "Use this forum to report problems with or suggestions for the download.oracle.com service or content. ")
    If you want help with a product, such as an application (Peoplesoft, JD Edwards) or technology (Oracle Database, Oracle Application Server) you are encouraged to tell us which product. Or provide a webcam so we can see your desktop.

  • T Code for Date wise FG and SFG Created

    I want to check how many FG and SFG are created in each month? Any one knows the report or table in which  I will Get this DATA?

    ASK ABAP to copy MM60 to create a Modified report and add the cloulmn created on Table Mara field ERSDA and also ask him to add in the selection parameter the same so when you will run it for month it will give you for that period and by material type too the ouput with created on date in output too.
    Regards
    qsm sap
    Edited by: qsm sap on Jul 10, 2010 3:43 PM

  • Reg:variable creation for date

    how to create a variable with last refresh date
    after that use that object  ( <Date> is less than New
    Date). This will give you the entire data till last refresh date.

    Hi Vinay,
    You can get last refresh date using below function
    Var1=LastExecutionDate()
    Then you can apply filter [Date Object]>Var1

  • Code for date range

    Hi,
    In the select option we have a field month range as
    SELECT-OPTION : FROM 01.2007       TO  01.2009
    where as in one of the internal table we have data without considering the month range as below
    MONTH RANGE     BUKRS        BELNR    DMBTR
    01.2006         10            1001      50
    05.2006         10            1001      20
    02.2007         10            1001      30
    06.2007         10            1001      40 
    01.2009         10            1001      90
    but now i need to add the DMBTR field considering the month range in the SELECT OPTION i.e., only FROM 01.2007 TO  01.2009 i mean without 2006 data.
    if i write the code as below its getting all the data sum up but i dont want 2006 data
    LOOP AT LT_DATA.
        ls_output-matnr = lt_data-belnr.
        ls_output-werks = lt_data-bukrs.
        ls_output-lgort = lt_data-dmbtr.
        COLLECT  ls_output INTO lt_output .
      ENDLOOP.
    please help with code .
    thanks in advance.

    >
    Sree vignesh wrote:
    > Hi,
    > In the select option we have a field month range as
    > SELECT-OPTION : FROM 01.2007       TO  01.2009 " Let say Ur Selection option is SO_MONTH
    > but now i need to add the DMBTR field considering the month range in the SELECT OPTION i.e., only FROM 01.2007 TO  01.2009 i mean without 2006 data.
    >
    > LOOP AT LT_DATA WHERE month in SO_MONTH. " Here add a Where condition
    >     ls_output-matnr = lt_data-belnr.
    >     ls_output-werks = lt_data-bukrs.
    >     ls_output-lgort = lt_data-dmbtr.   
    >
    >     COLLECT  ls_output INTO lt_output .
    >
    >   ENDLOOP.
    >
    > please help with code .
    >
    > thanks in advance.
    Regards,
    Suneel G

  • Code for Date Picker

    Hi all,
      I have a icon related to calendar.when the mouse is over the icon it should open the calendar and when i click the particular date it should automatically enter into the input fields.
    Thanks In Advance.
    Regards,
    Surya.

    Hi,
    You can use the htmlb:dateNavigator tag for it. Check the tag browser, BSP extensions, Transportable, HTML. Drag the tag on the layout, click on the tag and press F1 for help.
    Alternatively, you can use things like the Tigra calendar: http://www.softcomplex.com/products/tigra_calendar/
    Eddy
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

  • REG:USER EXIT FOR DATA SOURCE 0HR_LSO_1

    Hi ,
    I have to write the enhancement ABAP code for data source 0HR_LSO_1 which is related to module " training and event management "(also known as LMS or LSO) in ECC 6.0 .
    So how can I find out appropriate user exit for the same .I have to concentrate on the field "kostl (cost centre)" in that data source .
    Please provide some suggestions .
    Thanking You ,
    Tarun Brijwani .

    Hi Tarun...
      I this might help you.
      In the HR System:
    1) T-CODE: CMOD
    2) Choose an existing project (vg: Z12345)
    3) Modify
    4) Press Components button
    5) Look for the enhance: RSAP0001  (the BW extracting enhancement)
    6) The you have one of the following option:
    a- If the Data Source is "transaction data": The exit is "EXIT_SAPLRSAP_001"
    b- If the Data Source is "master data": The exit is "EXIT_SAPLRSAP_002"
    7) double-click in the appropriate one
    8) You'll see an INCLUDE sentence. Could be this ZXRSAU01 or this ZXRSAU02 (depending on the previous step). Double-click and you'll be redirected to the SE38
    9)  some code:
    CASE i_datasource
      WHEN '0HR_LSO_1'.
        LOOP i_t_data INTO my_struct
           my_struct-KOSTL           "Here you'll must have your Cost Center
           ...etc...etc...etc
        ENDLOOP.
      WHEN OTHERS.
    ENDCASE
    Hope it helps.
    gdmon

Maybe you are looking for

  • Error: Installing CE 7.1 SR3 Trial version  Error @ Step 27 of 35

    Experts, I am trying to install SAP Netweaver Composition Environment 7.1 SR3 trial version, after filling in the installation parameters while executing the set up fails/hangs at step 27 of 35. With the following error message ; Cannot start instanc

  • Computer crashes during iPad Photo Sync.

    Hi everyone, I'm trying to help my grandpa get set up on his new iPad (he's a tech-savvy grandpa, I know) but for some reason his computer crashes when trying to sync his photos with his iPad. He's using Windows Vista, and I'm a Mac person myself so

  • Issue with avelsieve+squirrelmail

    Hi, I'm a bit newbie so I'll try to clearly explain the situation : I'm trying to setup Avelsieve for Squirrelmail on my XServ to automatically store mails in differents folders. I created many IMAP accounts and for each account I created aliases. Pe

  • Linksysviewer.cab. Security certificate not valid.

    I tried to use the online support, but it doesn't seem like it's a known issue. Even though a brief investigation on google shows another reality. The thing is that when I instal my Linksys WVC54GCA web camera (Serial numer SS5008304361 Firmware: V1.

  • Why do I have to login every time I use Facebook?

    I am asked to login every time I open Facebook on my iPad. This doesn't occur on my laptop or desktop.