Setting offset in text variables

Hi,
I had a requirement to get the header values to be dynamically populated based on a value from the table.
I need this value to be decremented locally for each and every column heading. Each column involves some calculations from RKFs . Is there any way to have the offset for text variable locally so that I can avoid writing code to populate each and every column header.
Thank You for your help in advance.
K.Manikandan.

Hi,
create your text variable with processing type of customer exit and NOT ready for input.
In CMOD, code the following being given ZTEXT your text header showing the period and ZINPUT representing the variable input by the user
DATA: loc_var_range LIKE rrrangeexit.
  WHEN 'ZTEXT'.
    IF i_step = 2.
      LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZINPUT'.
        CLEAR l_s_range.
        "loc_var_range-low will be like 'yyyymm'
        CONCATENATE
            loc_var_range-low+4(2)
            loc_var_range-low(4)
        INTO  l_s_range-low.     
        l_s_range-sign     = 'I'.
        l_s_range-opt      = 'EQ'.
        APPEND l_s_range TO e_t_range.
        EXIT.
      ENDLOOP.
    ENDIF.
You can even make it nicer by doing something like mm.yyyy
        CONCATENATE
            loc_var_range-low+4(2)
            loc_var_range-low(4)
        INTO  l_s_range-low.    
or anything else of your creativity
hope this helps...
Olivier.
Message was edited by:
        Olivier Cora

Similar Messages

  • Get all file names in a folder, set each as text variable

    First off, I do not know if this is possible.
    For an app I'm writing, I need it to get a list of all the file names inside of a folder, then set a text variable for each of the file names. The app will then display a list of those items, which I know what to do from there.
    If anyone knows how I would be able to do this, or alternatives, I would be extremely grateful.
    Thanks in advance!

    just use any colon separated path (i.e., the desktop would be {color:blue}HD:Users:yourname:Desktop:{colors}) basically, path specifiers come in a number of types:
    # text designations - HD:Users:yourname:Desktop (just a normal text line)
    # posix designations - /Users/yourname/Desktop (how unix expects paths to be written)
    # alias designations - alias "HD:Users:yourname:Desktop" (a pointer to an actual, existing file system element
    # file system referents - file "HD:Users:yourname:Desktop:somefile", folder "HD:Users:yourname:Desktop", etc -
    # file system objects - Folder "Desktop" of folder "yourname" of folder "Users" of disk "HD"
    each has its advantages and disadvantages, and you can coerce between them (though not completely - you need to convert #5 to text before you can convert it to #3, for instance.

  • Setting & Reading In Text Variables

    Hello, can anyone tell me why my dynamic text box, instance
    name = "body_txt", displays the undefined? I have a .txt file with
    variables, &law1, &law2, etc... I want to set my variable
    "body_text_var" from buttons and only show the specific text
    variable content, i.e. &law1.
    I think this should be working but is not.... Thanks, Ed
    stop();
    var body_text_var:String;
    if (body_text_var == undefined) {
    body_text_var = "law1";
    //// director text
    fileData = new LoadVars();
    fileData.onLoad = function(success) {
    if (success) {
    trace("Loading History Data OK!");
    //// history text
    body_txt.htmlText = fileData.body_text_var;
    trace(body_text_var);
    } else {
    trace("Loading History Error!");
    fileData.load("timeline/law.txt");

    Doh on reading it a bit closer I see something else as well.
    body_text_var is defined probably on the _root timeline or
    some such in that case you need to do two things access the value
    of body_text_var and then retrieve the appropriate value from the
    LoadVars
    So something like this:
    body_txt.htmlText=this[_root.body_text_var]
    This is what is refered to as array notation. That says look
    on the _root level for the variable/property called body_text_var
    and then use the value of that to look within "this" object for a
    varialbe/property with the same name and finally assign that to
    body_txt's htmlText property. And again "this" in this case is the
    LoadVars object..

  • Offset in Text variable

    I need to create a text variable to display the forecast for 2009 2010, 2011, I have successful created  one for 2009 by using replacement path, but I can not find how to offset the year like what we can do for regular year variable by using + 1 to get 2010 value, Anybody know hot to do it?
    Thanks,

    Hi,
    Use the following code to get Current Day and Current day-1 like that, here I'm giving for Calday, so based on your input, you can alter the following code.
    You cerate Text variables for 2009, 2010, i.e. current year, current year+1, current year +2 like that then alter the following code.
    ****Begin*****TO get the Date (TEXT VAR) based on ZCDAY Input variable***********
        WHEN 'ZT_DAY' .
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZCDAY'.
            IF sy-subrc = 0.
              CLEAR: l_s_range.
              l_s_range-low+0(2) = loc_var_range-low+6(2).
              l_s_range-low+2(1) = '.'.
              l_s_range-low+3(2) = loc_var_range-low+4(2).
              l_s_range-low+5(1) ='.'.
              l_s_range-low+6(4) = loc_var_range-low+0(4).
              l_s_range-sign = 'I'.
              l_s_range-opt = 'EQ'.
              APPEND l_s_range TO e_t_range.
            ENDIF.
          ENDLOOP.
    ****End*****TO get the Date (TEXT VAR) based on ZCDAY Input variable***************
    ****Begin*****TO get the Date-1(TEXT VAR) based on ZCDAY Input variable***********
        WHEN 'ZT_DAY1' .
        DATA: ZT_DT1 TYPE SY-DATUM,
              ZT_DT2 TYPE SY-DATUM,
              ZT_SDT TYPE SY-DATUM,
              ZT_YR(4) TYPE N,
              ZT_DY(2) TYPE N,
              ZT_MT(2) TYPE N,
              ZE_TT(2) TYPE N.
              ZT_SDT = SY-DATUM.
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZCDAY'.
            IF sy-subrc = 0.
              CLEAR: l_s_range.
              ZT_DY = loc_var_range-low+6(2).
              ZT_MT = loc_var_range-low+4(2).
              ZT_YR = loc_var_range-low+0(4).
          CONCATENATE ZT_YR ZT_MT ZT_DY INTO ZT_DT1.  "YYYYMMDD
          CALL FUNCTION 'DATE_CREATE_2'
            EXPORTING
             i_datum_ein                   = ZT_DT1
             I_KZ_INCL_AUS                 = '1'
             I_KZ_INCL_EIN                 = '0'
             I_KZ_ULT_AUS                  = 'X'
             I_KZ_ULT_EIN                  = 'X'
             I_STGMETH                     = '0'
             I_SZBMETH                     = '0'
             I_TAGE                        =  0
           IMPORTING
             E_DATUM_AUS                   = ZT_DT2.
              l_s_range-low+0(2) = ZT_DT2+6(2).
              l_s_range-low+2(1) = '.'.
              l_s_range-low+3(2) = ZT_DT2+4(2).
              l_s_range-low+5(1) ='.'.
              l_s_range-low+6(4) = ZT_DT2+0(4).
              l_s_range-sign = 'I'.
              l_s_range-opt = 'EQ'.
              APPEND l_s_range TO e_t_range.
            ENDIF.
          ENDLOOP.
    ****End*****TO get the Date-1 based on ZCDAY Input variable***********
    Thanks
    Reddy

  • Need help in text variable !!

    experts !
    i have asked question earlier about the problem, i was trying all the possible combinations and i just got another way,
    Can i use Offset settings for Text variable ?
    my requirement is , i have ofiscper, and there is a text variable created on that too. but if my fiscper is 0012010 then my text variable shows april 2010. but i need "may 2010" instate.
    so, if my fiscper is 0012010 , then my text variable should show one month prior or after  .
    So, i found in text variable..ther is sometjng like "offset". i was wondering can i use that to get that result ?
    i tried, but didnt work...
    please help

    Hi Honar,
    The offset for text Variable is just to get a substring of the result of the text variable and not like the offset that we use in the Restriction of the Keyfigures.
    Hence this will not work.
    Regards.
    Shafi.

  • Text variables. How do you change time zone?

    I am trying to set up a text variable for modification time. However, it is not registering my time zone. How do you change the time zone?

    Sorry. I have worked it out that it is in my timezone!!

  • Find text from a file and set it as a variable in applescript?

    I am trying to build a script that sends me updates and notifications from cex.io. Please keep on reading below, so I may guide you until the point I have trouble with.
    The first simple script in this operation goes to cex.io's trading page for BTC/GHS. It records ands saves the text to a file every 4 seconds. It works great. It doesn't need to have safari refresh because the site pushes info to the browser live.
      repeat
              set the webpage_content to ""
              tell application "Safari" to set the webpage_content to the text of document 1
              set theText to webpage_content
              set a to "Macintosh HD:Users:PRIVATE:Desktop:CEX:"
              set theFile to (open for access file ((a) & "CEXRaw") with write permission)
              write theText to theFile
              close access theFile
              delay 4
      end repeat
    And it returns this from the site to this main file every 4 seconds: (note I cut off a chunk from the bottom and the top of the file, because they are unimportant)
        GHS:
        0.05233439
        BTC:
        0.00000223
        NMC:
        0.00002939
        LTC:
        0.00000000
        GHS/BTC
        0.02362958 LTC/BTC
        0.02438131 NMC/BTC
        0.00597565 GHS/NMC
        3.96951800 BF1/BTC
        1.67000000 Fund Account
        GHS/BTC
        Last price:
        0.02362958
        Daily change:
        -0.00018042
        Today's open:
        0.02381000
        24h volume:
        73812.35539255
    I now need an applescript to read that file, and return wanted values. But I'm lost on how to write it.
    It needs to find the number under BTC, and set it as a variable.
    It needs to find the number under GHS, and set it as a variable.
    It needs to find the number under Last Price, and set it as a variable.
    If anyone could script that really quick for me, or tell me how to do it, that would be amazing. Thank you so much!

    Couldn't tell if you had any whitespace in the lines (i.e. is there a space before or after GHS:), so I used contains, not is.  Also, if you have a line such as GHS/BTC with a colon GHS/BTC:  then it will also fail (as contains "BTC:" would be true for BTC: and GHS/BTC:)
    However, this will give you some guidance:
    set a to "Macintosh HD:Users:PRIVATE:Desktop:CEX:CEXRaw"
    set x to 0
    set Names to paragraphs of (read file a)
    repeat with nextLine in Names
              set x to x + 1
              if nextLine contains "BTC:" then
                        set BTC to item (x + 1) of Names
              else if nextLine contains "GHS:" then
                        set GHS to item (x + 1) of Names
              else if nextLine contains "Last Price:" then
                        set lastPrice to item (x + 1) of Names
              end if
    end repeat

  • Text Variable for 0CALWEEK: On Structure with Calweek offset

    Good day
    Please assist? I have gone through numerous SDN threads relating to the following, but could not find a solution for my problem.
    1) User wants to see 16 weeks data in columns, each week in own column. I have created a structure for each week with offsets 0 to -16, 0 to -15 and so on to display data. User wants to '0' display even if no data was loaded for a certain week, thus the structure. The data is displayed for 16 weeks. Now I want to replace it with calendar week text. (I have used week 12 to test text variable. week 12 should be displayed as 'example' 2008/42)
    2) There are no calweek text variables available for selection, so I created a new one as 'replacement path', characteristic "Calendar year/week" and 'replace variable with "Name (Text)".
    2.1) The following is the result 12  &0DPM_WV1&. Not what I wanted.
    Where am I going wrong?
    Your assistance will as always, be appreciated.
    Thanks
    CJ

    You have to create 16 customer exit text variables and populate them in the RSR0001 Customer variable exit in i_step = 2.
    http://help.sap.com/saphelp_bw320/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_bw320/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/frameset.htm
    If you always run your query as of current system date and display 16 weeks data till current date, then u can use sy-datum in variable exit to populate these 16 text varaibles. If you are using a user entered calweek in the report varaible and displaying 16 weeks prior to that week in your report, then you need to read the user entered variable inside the customer exit and populate the texts for all 16 weeeks.
    Hope it helps!

  • How to set the document language based on the contents of a text variable?

    In my Indesign documents, I use a text variable in which I type the abbreviation of the document language according ISO639-1 (e.g. EN, DE, ES, ...). I'd like to have a JavaScript that checks this text variable every time the document is opened and then sets the Language property of my Normal paragraph style, but I don't have any experience with JavaScript.
    Can someone help me please?
    PS: I use InDesign CS5.5.

    Hi Todd,
    I believe ES4 sp1 allows you to do this, but I don't have that version so aren't sure.  I follow the steps described in this blog, LiveCycle Blog: Gesperrte PDF-Eigenschaften in XFA-Formularen ändern//Edit locked PDF properties in XFA forms seems very hacky but does work (the English version comes after the German).
    Regards
    Bruce

  • Text Variable (offsets)

    Hi,
    Please I will like to confirm if it is possible to make use of a variable offset in a text variable. How can I do this from the query designer ?
    I have already restricted the charateristic with a variable and offset, but I'm not sure if this will automatically affect the text variable (of the same chracteristic) used in the description of the selection or whether it requires a text variable offset (??) to achieve this.
    Any suggestions will be appreciated.
    Regards,
    Uche

    hi Uchenna,
    if you have created text variable (with replacement path from that characteristic), the offset on characteristic variable will reflect to the text variable, e.g
    you have zyear with offset +1 and +2 and the year itself,
    then your report may look like
    zchar    2006 2007 2008
    a        xx   xx   xx
    b        xx   xx   xx
    hope this helps.

  • Cal year Text Variable Offset

    If you have a text variable based on 0CALYEAR say ZT_CAL as user input, can you have column headings based on an offset from the user input value? For example, the user inputs 2004 and I have 2 columns (current year and prior year). The current year shows up fine based on &ZT_CAL& but I can't make the prior year show up as 2003 using &ZT_CAL-1& or &ZT_CAL&-1.

    Your approach does not work since my key figures are not RKF separately restricted by time. I am familiar with replacement path text variables working with restrictions.See the following typical example from APO:
    Sales - Current year xxx
    Sales - 1 Year Ago xxx
    Sales - 2 years Ago xxx
    All 3 key figures have the same 0FISCYEAR value. So when I run the query I need for the first row (or column) to say Sales - 2004, the 2nd row to say Sales - 2003 etc. based on a variable input of 2004.

  • "Set offset for Variable" is disabled

    Hi,
    I need to use this option but it is disable (inactive) and I am not able to set offset.
    I am using it for single value variable.
    Please help,
    Thanks

    Hi,
    Can you try create a variable as interval option and offsetoption  will enable.
    Regards
    sivaraju

  • Error in Display of Text variable

    Hello gurus,
    I have a requirement in which power user wants to see the output as follows :
    Product sold of Current year for months --- to -
         /  Product Sold of Previous year for months --- to -
    So if on Selection screen ,user enters months 01/2005- 05/2005
    it should show the
    Product sold for 01/2005-05/2005  / Product sold for 01/2004-05/2004
    So i created 2 text variables one for start period and second for ending period.
    I included this in the display of 1st column.
    It is coming perfectly.
    Now how shall i include or do this for 2nd column.
    In second column i just set the offsets value so data is coming right
    If i restrict those with time chara.
    But in display of 2nd column ,
    WHAT SETTINGS I DO FOR TEXT VARIABLES.
    plust the requirement is that.
    User shall enter the Value of range of months only ONCE.

    Hi Noviced
    1.  Create a variable having user input enabled for calmonth range.
    2. Create a customer exit variable
    3. Restrict one KF with this cust exit variable and one with user input variable
    4. Cust exit variable will give the value of previous year months.
    5. Write the code in CMOD under ur project
    DATA: loc_var_range LIKE rrrangeexit,
                 l_s_range   LIKE rrrangesid.  "Header line for E_T_RANGE for export
    WHEN 'ZTEXT'.
    IF i_step = 2.
    READ TABLE  i_t_var_range INTO loc_var_range WITH KEY  vnam = 'ZINPUT'.
    v_year = loc_var_range-low+0(4).               " Take the year
    v_month_start = loc_var_range-low+4(2) . " Take the starting month
    v_month_end = loc_var_range-high+4(2).   " Take the ending month
    v_year = v_year - 1.
    CONCATENATE v_year v_month_start INTO l_s_range-low.
    CONCATENATE v_year v_month_end  INTO l_s_range-high.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'BT'.
    APPEND l_s_range TO e_t_range.
    ENDIF.
    Thanks
    Tripple k

  • How to Create a Text Variable

    Hi Experts...
    Can you please explain me how to create a Text variable...
    In my Cube i had 3 different date fields....
    and as per my requirment i need to create a rolling report for which will display data for 6 months rolling.
    As the date field which i need to use is not mapped to Time Char's (Cal Year,Cal Month...etc)
    For that reason i created below customer exit variable and used offset variables to achieve the rolling 6 months report
    Code used for Customer Exit VAriable:
    WHEN 'ZC_Cmonth1'. " Current Cal Month Car Expiry
    IF i_step = 2.
          CLEAR l_s_range.
    determine date
        LV_SYDAT     =  SY-DATUM.
        LV_YEAR_ACT  =  SY-DATUM+0(4).
        LV_MONTH_ACT =  SY-DATUM+4(2).
    Set begin date of intervall
    CONCATENATE LV_YEAR_ACT LV_MONTH_ACT '01' INTO LV_DATE_LOW.
    Set end date of intervall
    CONCATENATE LV_YEAR_ACT LV_MONTH_ACT '31' INTO LV_DATE_HIGH.
    Fill ranges-tab with: include all values between beginning of year
    and actual date
      CLEAR E_T_RANGE.
      CLEAR L_S_RANGE.
      L_S_RANGE-SIGN = 'I'.
      L_S_RANGE-OPT  = 'BT'.
      L_S_RANGE-LOW  = LV_DATE_LOW.
      L_S_RANGE-HIGH = LV_DATE_HIGH.
      APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    Now i need to create TEXT VARIABLE that will display the Month Name in the column name
    Please update in detail step how to create a Text Variable

    In your specific requirement select the which ever the keyfigure you want  to analyse, go to edit mode of keyfigure propeties there select the newvariable type and create the Text variable by maintaining the proper offset start and length and also maintain the in whcih format u want see the month name in column headers. Maintain the Text format or key format. it totally depends on u r requirement.
    Hope it will help ful for u.
    Bye,
    Chandu.

  • 10 text variables in query ?

    Hello,
    I have to create a query with a structure in in columns. I have to fill a variable on the selection screen (for example 0CALYEAR).
    The query now lists the last 10 years in the other columns as an offset to the variable 0CALYEAR.
    Now I want to see each year as a text in each column header.
    Any ideas to avoid the creating of 10 text variables for each column ?
    Thanks a lot in advance....

    Hi,
    Get the input for Calyear in some dummy key figure and populate the last 10 year value in user exit to calyear variable.
    Drill down the calyear across the column and set the display as text.
    Hope this helps
    Regars
    Akhan

Maybe you are looking for

  • Need to deactivate old computer so I can download apps to new computer

    I have a dual boot setup iMac that the screen went bad on. I updated to a new iMac and need to download creative cloud to it. Can some tell me how to go about unauthorized the previous two downloads on my old computer on your end so I can set the new

  • Setting up Wiki Calendars in iCal with Active Directory Accounts

    I'm Having a little trouble wrapping my head around our Wiki Calendar Solution, Id like to find a way to get the 10.6 Wiki Server Calendar's in iCal Client - using our active directory authentication. I have a test 10.6 Server bound to our Active Dir

  • Error while invoking ODI Scenario from BPEL

    Hi, I have created a BPEL process for invoking ODI Scenario as mentioned in the http://www.oracle.com/technology/obe/fusion_middleware/odi/ODIscenario_BPELcallback/ODIscenario_BPELcallback.htm when i am deploying the process through console in i am g

  • Question for Database EXPERTS about implementing an Embedded Database

    One of my current projects is to implement a Embedded pure java database with a smaill subset of SQL. Since I estimate it will take me at least 400 man hours (based on my intial unfinished attempt) to build something robust and usable, I thought I'd

  • T Code for Viewing Customer Deliveries by Warehouse?

    Hello All, I am trying to find out if there is a Transaction Code which will list a specific region's customers by Warehouse.  We do not have any PA reports.  In its absence, I am trying to see if I could run any transaction code where I can put in w