Multiline substitution of text variables

Very often there are problems with headers and footers. Thus it is necessary to apply an absolutely unsustainable methods of solution.
In addition, I would like to see further development of text variables. In this direction, ID is too little flexibility.
Required user-configurable universal type of a variable instead of rarely used bad customizable predefined types of variables.
For example, calculated variables, functions for numbers and text, connecting scripts to create a final form of text replacement.

I don't use auto-correct, so someone else will have to tell us whether and auto-correct list is only global or can be resticted at the document level.
Another possibility, though pretty clunky, is to use data merge. Just put a placeholder field for each string where you need it, then merge the file. You'd need to set up a Tab delimited text file with one record and all of your strings on one line, I imagine.

Similar Messages

  • No value found for Text Variable

    Hi All,
    I have 2 different variable created on 0VERSION. One for user entry and second one is text variable with replacement path as "text".
    I have 3 different columns in the report.
    One is Restricted KF, based on user entry variable. Heading of this column has to be Result (&ZVERTXT&), where ZVERTXT is my text varaible.
    Now, in second column I m using formula to calculate percentage. Heading of this column is &ZVERTXT& (%).
    Now, in third column i m again using formula using the same KF as in first column. But this time, in the heading this text variable thorws "no value found error"
    can anybody help me out in this issue.. ??

    Hi,
    This is the proble to get value for text variables with Replacement path ,in case system is getting 2 reference values .So it get confusion and says that <i>No value found for Text Variable </i> .
    So as a work around :
    Instead of a text variable with automatic substitution(replace ment path) from another characteristic value, you can also create a text variable that is filled by a customer exit.In the code you  assign the Text value by looking into TEXT table with the value you got from User entry variable( which is used in first Restricted KF).
    With rgds,
    Anil Kumar Sharma .P

  • Substitution vs bind variable

    Hi,
    Can you please give me the differences between substitution vs bind variables? I have done many searches and I am lost. Any examples would be great.
    Thanks.
    -U

    Perhaps what is needed is a simple example of both.
    h2. Substitution Variables
    The clue here is in the name... "substitution". It relates to values being substituted into the code before it is submitted to the database. These substitutions are carried out by the interface being used. In this example we're going to use SQL*Plus as our interface...
    So let's take a bit of code with substitution variables:
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function myfn return varchar2 is
      2    v_dname varchar2(20);
      3  begin
      4    select dname
      5    into   v_dname
      6    from   dept
      7    where  deptno = &p_deptno;
      8    return v_dname;
      9* end;Now when this code is submitted...
    SQL> /SQL*Plus, parses the code itself, and sees the "&" indicating a substitution variable.
    SQL*Plus, then prompts for a value for that variable, which we enter...
    Enter value for p_deptno: 20
    old   7:   where  deptno = &p_deptno;
    new   7:   where  deptno = 20;... and it reports back that it has substitution the &p_deptno variable for the value 20, actually shoing us the whole line of code with it's value.
    This code is then submitted to the database. So if we look at what the code is, now created on the database we see...
    SQL> select dbms_metadata.get_ddl('FUNCTION', 'MYFN', USER) from dual;
    DBMS_METADATA.GET_DDL('FUNCTION','MYFN',USER)
    CREATE OR REPLACE FUNCTION "SCOTT"."MYFN" return varchar2 is
      v_dname varchar2(20);
    begin
      select dname
      into   v_dname
      from   dept
      where  deptno = 20;
      return v_dname;
    end;The database itself knows nothing about any substitution variable... it just has some fixed code with the value we supplied, that SQL*Plus substituted when we compiled it.
    The only way we can change that value is by recompiling the code again, and substituting a new value for it.
    Also, with substitution variables we don't necessarily have to use them just for 'values' (though that it typically what they're used for)... we can use them to substitute any part of the code/text that we are supplying to be compiled.. e.g.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function myfn(x in number, y in number) return number is
      2  begin
      3    return &what_do_you_want_to_return;
      4* end;
    SQL> /
    Enter value for what_do_you_want_to_return: y*power(x,2)
    old   3:   return &what_do_you_want_to_return;
    new   3:   return y*power(x,2);
    Function created.
    SQL> select dbms_metadata.get_ddl('FUNCTION', 'MYFN', USER) from dual;
    DBMS_METADATA.GET_DDL('FUNCTION','MYFN',USER)
    CREATE OR REPLACE FUNCTION "SCOTT"."MYFN" (x in number, y in number) return number is
    begin
      return y*power(x,2);
    end;It really does substitute the substitution variable, with whatever text you type.
    So, that's substitution variables. In summary they are variables that the user interface detects and prompts for text to substitute into the code before submitting it to the database.
    h2. Bind Variables
    Bind variables are a completely difference concept to substitution variables.
    Bind variables typically relate to SQL queries, and are a placeholder for values within the query. Unlike substitution variables, these are not prompted for when you come to compile the code.
    Now there are various ways of supplying bind variables, and I'll use a couple of examples, but there are more (such as binding when creating queries via the DBMS_SQL package etc.)
    In the following exaxmple:
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function myfn(p_deptno in number) return varchar2 is
      2    v_dname varchar2(20);
      3    v_sql   varchar2(32767);
      4  begin
      5    v_sql := 'select dname from dept where deptno = :1';
      6    execute immediate v_sql into v_dname using p_deptno;
      7    return v_dname;
      8* end;
    SQL> /
    Function created.The ":1" is the bind variable in the query.
    If you examine queries running in the database you will typically see bind variables represented as :1, :2, :3 and so on, though it could be anything preceded by a ":" such as :A, :B, :C, :X, :FRED, :SOMETHING etc.
    When the query is passed to the SQL engine (in this case by the EXECUTE IMMEDIATE statement), the query is parsed and optimised and the best execution plan determined. It doesn't need to know what that value is yet to determine the best plan. Then when the query is actually executed, the value that has been bound in (in this case with the USING part of the execute immediate statement) is used within the execution of the query to fetch the required data.
    The advantage of using bind variables is that, if the same query is executed multiple times with different values being bound in, then the same execution plan is used because the query itself hasn't actually changed (so no hard parsing and determining the best plan has to be performed, saving time and resources).
    Another example of using bind variable is this:
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function myfn(p_deptno in number) return varchar2 is
      2    v_dname varchar2(20);
      3  begin
      4    select dname
      5    into   v_dname
      6    from   dept
      7    where deptno = p_deptno;
      8    return v_dname;
      9* end;
    SQL> /
    Function created.Now, this isn't immediately obvious, but what we have here is the ability of the PL langauge to seamlessly integrate SQL within it (giving us PL/SQL). It looks as though we just have an SQL statement in our code, but in reality, the PL engine parses the query and supplies the query to the SQL engine with a bind variable placeholder for where the PL variable (parameter p_deptno in this case) is within it. So the SQL engine will get a query like...
    select dname
    from   dept
    where  deptno = :1and then the PL engine will handle the binding of the value (p_deptno) into that query when it executes it, as well as dealing with the returning value being put INTO the PL variable v_dname. Again the SQL supplied to the SQL engine can be optimised and re-used by code because it isn't hard coded with values.
    So, here, the binding of values is implicit because the PL engine is removing the need for us to have to code them explicitly.
    The other advantage of using bind variables is that you don't have to worry about the datatypes.
    Often we see people creating code such as this (going back to a similar dynamic SQL example)...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function myfn(p_hiredate in date) return number is
      2    v_empno number;
      3    v_sql   varchar2(32767);
      4  begin
      5    v_sql := 'select empno from emp where hiredate = to_date('||to_char(p_hiredate,'DD/MM/YYYY')||',''DD/MM/YYYY'')';
      6    execute immediate v_sql into v_empno;
      7    return v_empno;
      8* end;
    SQL> /
    Function created.... where the developer is trying to concatenate in a date or varchar variable with the appropriate single quotes and formatting required to make the SQL make sense. Not only does that prevent the SQL explain plan from being re-used with different values, but it makes the code hard to maintain and get right in the first place (as well as leaving things open to SQL injection)
    But, with bind variable, that's not necessary... simply doing...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function myfn(p_hiredate in date) return number is
      2    v_empno number;
      3    v_sql   varchar2(32767);
      4  begin
      5    v_sql := 'select empno from emp where hiredate = :1';
      6    execute immediate v_sql into v_empno using p_hiredate;
      7    return v_empno;
      8* end;
    SQL> /
    Function created.... is all that is needed.
    The SQL engine knows that it is expecting a DATE datatype for the value because of what it's being compared against, and the USING statement is supplying a value of DATE datatype. No messy need to play with date formats or quotes etc. it just simply works. (and the same with other datatypes).
    So, that's bind variables. In summary they are placeholders in queries that allow SQL queries to be soft parsed rather than hard parsed when the query is re-used, help prevent SQL injection, and allow for the values to be supplied easily and seamlessly by the issuing code.

  • Error in creating Text Variable

    Hi  Gurus,
    I have one requirement to create a text variable for the user & the user wants to put the description as input to the variable.
    But when i am creating the variable,the variable type "characteristic Value"  is by default selected and i am also unable to change the variable type to text variable.
    Please any body have the solution to resolve the error.
    Regards
    Debasish

    Hi,
    Just select a particular key figure and on the right side you will see its properties..
    Now just besides the description of the key figure you will find a symbol for create variables, just click on that.. It will create a text variable...
    Edited by: mansi dandavate on Aug 31, 2009 11:12 AM

  • 0FISCPER text variable "External Characteristic Value Key" has changed

    Hello!
    Could somebody help and tell, why in BI7.0 version (but 3.x RRMX version) the format of the 0FISCPER text variable (also other time characteristics) has changed from 001.2007 (version 3.x) to 0/1  .0700 (version 7.0)?
    I cannot understand the logic of the new Exterternal characteristic calue key. What can I do about it?
    Thanks for your help, gurus!
    BR, Auli Peltola

    I figured out myself the reason for the problem: in the new version the fiscal year variant has to be defined in report so that the 0FISCPER would work.

  • How to create Text Variables in BEx Query Designer

    How  can i create Text Variables in Bex Q.D.
    I am able to create characteristic variables
    but i can't find option to create text variables.
    What's the requirement to create Text variables in Bex Q.D.
    When i try to create Text variable for 0calDay.. the variable type is characteristic by Default and disabled.
    How can i create text variables related to 0CalDay with which i need to work in Customer Exit.

    Hi,
    You have to create characteristic variable processing by Customer Exit by considering 0CalDay as a Reference Characteristic
    After creation of the above variable, you restrict your KF with the above created variable.
    Now you can create a Text variable for the description of your KF. This way it works...........
    Regards,
    Suman

  • Text Variables are not being Displayed in the Output of the Query

    Hi All ,
    We have some column headings , which are populated through the Text Vaiables , But in the Query Ouptput only the tech names of the Text variables are being displayed . can anyone tell me why its happening like this . I want to debug the Query , please guide me in this regard
    Thanks in Advance.. Pls reply me as soon as possible

    Hi Nagarjuna reddy,
    Click on the properties of the infoobject enter the name of the description and next to that you can see the X/? buttion click on the this button and select the field/if the proper field is not there then create a field descriton and select. i hope this is works and correct me if i am wrong. for debuggin the query use a transaction code- RSRT.
    regs,
    Vachan

  • Why do text variables using Running Header character style translate forced returns as a word space in the running head on the first page but close up the space on subsequent pages?

    In an InDesign document that requires 3 different Chapter head paragraph styles (to cope with differrent length headings) I've set up the running heads on the master page with a text variable using the Running header (character style) option. The character style I've assigned to this is an empty character style that is applied to all 3 chapter head paragraph styles.
    Some chapter heads require a forced line break, so that the line breaks are aethesically pleasing. On the first page the text variable translates this forced line break as a word space in the running head, but on subsequent pages it ignores the forced line break. This means that if you have a word space before the forced line break, on the first page you get a double word space and on subsequent pages the running head sets correctly with a single word space. But if you remove the word space before the forced line break in the chapter head text, the first running head sets correctly with forced line break interpreted as a single word space, but on subsequest pages the space is closed up.
    This only seems to be a problem when the character style option is used for header text variables. If a paragraph style is used the forrced line break is interpreted as a a single word space in all instances, both on the foirst page and subsequent pages.
    This would appear to be a bug in how text variables are applied when using the Running header (character style) option. I can't see any other reason why the text variable would beheave differently on the first page and on subsequent pages. There is only one master page, so it isn't a case of their being an error between a main master page and a chapter opener master page.
    Does anyone have any solutionss, or know if this problem has been fixed in subsequent releases of InDesign (I'm using CS6 ID version 8.0)
    Thanks

    Ask in the ID forum...
    Mylenium

  • Text Variable not showing headers in Formula

    I have text variable in my report when I use in Formula its not working.Its a replacement path and if I used in normal col its showing header correctly.
    Any ideas guru's
    Thanks in Advance!
    Andy

    As I mentioned when I use in Formula to add up these text variables header is not showing.
    EG: &ZP_FPTA&  &ZP_FPTB&  &ZP_IPVERS& this is in one col and there is another Variable like this I am adding up in Formula ,Addition is working but header is not showing correct
    It shows as Tech name of variable only not picking up description from Variables..
    hope this is clear..
    Andy

  • Text Variable Not Refreshed

    Hello,
    I created a data text variable user exit.
    everyting works fine, but,
    1) Selection options:
    Year: 2010
    Month: 1 to 11
    The query and text variable return right values
    Year 2010
    Month: Jan to Nov
    but, if i want to make new selection
    2) Year : 2011
    month : 1 to 11
    the query results are fine, but, the variable text return its old : return:
    year: 2010
    month: Jan to nov
    3) when I do it again
    year: 2011
    month: 1 to 11
    The query and text variable return right values
    Year 2011
    Month: Jan to Nov
    Why this happen? why they string doesnt work it 1rst..?
    Thx
    Reg

    I assume , variable 'ZP_CALY2' , which you are reading is created on calyear/ month which stores data as '2011.001' for e.g.
    and you are extracting year from the same and writing the same in a variable for calyear .
    In that case correct the code as
    WHEN 'ZP_AN2'.
    LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'ZP_CALY2'.
    zt_dt1 = loc_var_range-low +0(4).
    l_s_range-low = zt_dt1.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    APPEND l_s_range TO e_t_range.
    ENDLOOP.
    Otherwise you can try this option ,
    You are entering year in the selection screen , so create a text variable with replacement path and give the replacement characteristic as fiscalyear info-object used in the report .also restrict fiscal year variable in the keyfigure . use this variable along with the keyfigure .
    It will give you the correct year .

  • Text variable is not displaying in the query result

    Hi All
    I am having problem here i have cteated a text variable on 0company with replacement, its not showing the name or key on the output when i run the qury it showing &ztxtvatc& so what might be the problem........pls can anybody tell me the solution for this and iam working on BI7.0, New version.
    Thanks in advance
    Srinivas

    Hello ,
              You can try this code, sorry if i am wrong,
    DATA: l_value(10)   TYPE c,
          l_s_comp     LIKE /BI0/TCOMPANY,
          l_t_comp     LIKE /BI0/TCOMPANY OCCURS 0.
    WHEN 'ZTXTCOMP'
    IF i_step = 2.
    LOOP AT i_t_var_range INTO loc_var_range
               WHERE vnam = ZCOMPANY'.
    SELECT * FROM  /BI0/TCOMPANY
                     INTO  l_t_comp
                 WHERE  /BI0/OICOMPANY = i_vnam.
    LOOP AT l_t_comp INTO  l_s_comp    
            CLEAR l_s_range.
            l_s_range-low  = l_s_comp-RSTXTMD.
            L_S_RANGE-SIGN = 'I'.
            L_S_RANGE-OPT = 'EQ'.
            APPEND L_S_RANGE TO E_T_RANGE
    END LOOP.
    EXIT.
    END LOOP.
    END IF.
    hope it helps,
    assign points if useful

  • Issue with text variable by replacement path

    Hello All
    I have a date field called ZDATE1 (it is based on 0DATE). I have used this this IO in a query and have create variables on it (ZSTARTDT and ZENDDT), Start and End date. And my KFs are based on these 2 dates: Quantity - Start Date & Quantity - End Date  / Product Value - Start Date & Product Value - End Date. Those are my descriptions for my KFs.
    Now, I want the replace the descriptions "Start Date and End Date" with the actual values that I am entering like 09/01/2010 and 09/10/2010. Ex: Quantity - 9/01/2010 & Quantity - 9/10/2010.
    Therefore, I create 2 Text Variables,
         1. ZSTART, Replacement Path, Ref Char (ZDATE1), Replace by Variable ZSTARTDT, with KEY, offset - blank
         2. ZEND, Replacement Path, Ref Char (ZDATE1), Replace by Variable ZENDDT,      with KEY, offset - blank
    And I put these text variables in the descriptions. But when I run the query, I still see: Quantity - &ZSTART& and Quantity - &ZEND&.
    Note that my ZDATE1 which is based on 0DATE does not have a master data table or text table; it is purely transaction data. Does that mean, my text replacement path variables wont work.
    Any suggestions??

    Hi,
    The text variable is replaced when the exact date is clear for this key figure column according to the restriction.
    To achive this, please make sure that either the variable is directly restricted in the key figure selection, or that the date characteristic is in drilldown.
    Regards,
    Patricia

  • How can I get an ampersand to show up when between two other letters, in a text variable?

    Using Indesign CC 2014, on Windows 7.
    Creating a catalog.
    The company name is used throughout.
    Since this catalog will be re-branded for distributors at random, the company name will change all the time.
    So, here's a text variable I'm defining:
    The issue is that when I attempt to use an ampersand (&) between two letter with no spaces, the ampersand disappears.

    Yes!! You got it!
    Works. Thank you!
    Wish I'd thought of that . . .

  • Complex Sap text variable in WEBI with replacement path

    Hi Gurus,
    Variables in Bex
    Present Fiscal Qtr : 2012Q4
    Fiscal Qtr-8    :        2010Q4
    My Output header(TEXT)  in Bex as follows.
    2010Q4_ ACT     2011Q1_ ACT     2011Q2_ ACT     2011Q3_ ACT     2011Q4_ ACT     
    2012Q1_ ACT     2012Q2_ ACT     2012Q3_ ACT     2012Q4 BOQ     2012Q4CONS     
    2012Q4_ACT      2013Q1 BOQ     2013Q1CONS
    It's Completly working in Bex. I have used text variable and used replacement path to calculate the above texts.
    WEBI : Even though the document from SAP says that the variables will work when it's derived through replacement path,
    it's not working.
    Question1 :
    How can i achive this in webi . I saw some of the posts in SDN . They suggested to use 'USER RESPONSE' command.
    Question 2 :
    Assume we are using USER RESPONCE , when the current QTR = 2013Q1 . How can we  derive the previous 8 Qtr 's , because
    every Qtr the values are changing .

    Hi,
    In which way is it not working?  What's your SP and Patch level ?
    the webi pre-defined cell you are enquiring about is  either =PromptSummary()   or =UserResponse()
    Regards,
    H

  • Used of Sap text variable with replacement path in Bo designer

    Dear experts,
    I created a univers based on a SAp BW query. In this query I used a text variable in order to get dynamic header columns.
    The text variable is done by using "replacement path" that is the text is derived automatically from the user input triggered by a sap bw variable.
    example :
    the query contains a restricted key figure which shows net values for a selected year based on variable PYEAR.
    The name of this restricted keyfigure is &ZYEAR& where ZYEAR is the text variable with replacement path from the variable PYEAR.
    When generated the univers based on this query I get component &YEAR&.
    When I use this unvers in WebI my result containts header with &YEAR& althougth I selected for example the year 2006.
    According to several how to and white papers on SDN , it seems that text variables with replacement path are supported. So I am disapointed by this result.
    Can you give me advise to get a rigth result ?
    thanks a lot
    Olivier Doubroff

    Hi Rishit,
    I am trying to achieve the same as you, but it seems like text variables in restricted key figures do not work. I am using BO XI3.1 SP3 and SAP BW 7.01 SP6.
    A work-around for me has been to use the "user response" function in webi to create a webi variable that holds the dynamic text title. If the user inputs Jan 2010, I change the input to a date using the "user response" and "ToDate" functions in the webi variable editor. After changing the input to a date I use the RelativeDate to extract 1 month (e.g. 25 days) from the user input. Then I have both Jan 2010 and Dec 2010 as webi variables to use as headers for my restricted key figures.
    The formulas can easily become a little long, but by tweaking the user response string, you should be able to get dynamic headings by using webi functionality. But be aware that you need one webi variable for each dynamic heading if you use this method.
    Let me know if it works or if I can help more:-)
    Best regards,
    Morten

Maybe you are looking for