How to declare a variable in form

how to declare a variable in form?

Hi,
   do you want to create variable in script or smartform?
In scripts to define a variable use the following declaration statement.
DEFINE &<VARIABLE_NAME>&
place this statement as command. we can assign initial value for this by adding VALUE ' ' to above statement.
If your requirement is for smartforms go to global declaration, create a variable there that will be applicable only for smartform.
Hope this will help you,
Regards,
Aswini.

Similar Messages

  • How to declare custom structure in form interface in smartforms?

    Hi,
    How to declare custom structure in form interface in smartforms?
    Thanks.

    Create a structure in SE11 and use that in Form Interface - > Tables tab in smartforms.
    Pranav

  • How to declare class variable with generic parameters?

    I've got a class that declares a type parameter T. I know how to declare a static method, but this doesn't work for a static variable:
    public class Test< T >
        * Map of String to instances of T.
        * error: '(' expected (pointing to =)
        * <identifier> expected (pointing to () )
       private final static < T > Map< String, T > MAP = new HashMap< String, T >();
        * Get instance of type T associated with the given key.
       public final static < T > T getType( String key )
          return MAP.get( key );
    }Edited by: 845859 on Mar 20, 2011 11:46 AM

    jveritas wrote:
    I'm trying to create a generic polymorphic Factory class that contains boilerplate code.
    I don't want to have to rewrite the registration code every time I have a different return type and parameter.I haven't seen a case yet where that is reasonable.
    If you have hundreds of factories then something is wrong with your code, design and architecture.
    If you have a factory which requires large number of a varying input types (producing different types) then something is probably wrong with your code and design.
    A reasonable factory usage is one where you have say 20 classes to be created and you need to add a new class every 3 months. Along with additional functionality represented by the class itself and perhaps variances in usage. Thus adding about 3 lines of code to one class is trivial. Conversely if you have hundreds of classes to be created by the factory and you are adding them daily then it is likely that
    1. Something is wrong with the architecture which requires a new class every day.
    2. You should be using a dynamic mechanism for creation rather than static because you can't roll out a static update that often.
    More than that the idiom that leads to factory creation is different for each factory. A factory that creates a database connection is substantially different than the one used in dynamic rules logic processing. A generic version will not be suitable for both.
    Actualy the only case I know of where such a factory might be seem to be a 'good' idea is where someone has gotten it into their head that every class should be represented by an interface and every class created by a factory (its own factory.) And of course that is flawed.

  • How to declare local variables in PL/SQL stored programs

    Where do I declare local variables in a PL/SQL stored program?
    I get compiler errors with either of the options below:
    FUNCTION GET_PRINCIPAL_BALANCE (CUT_OFF_DATE IN DATE, TITLE_SN IN DATE, TOTAL_BALANCE OUT NUMBER) RETURN NUMBER IS
    TOTAL_BALANCE NUMBER;
    BEGIN
    RETURN TOTAL_BALANCE;
    END;
    FUNCTION GET_PRINCIPAL_BALANCE (CUT_OFF_DATE IN DATE, TITLE_SN IN DATE, TOTAL_BALANCE OUT NUMBER) RETURN NUMBER IS
    BEGIN
    TOTAL_BALANCE NUMBER;
    RETURN TOTAL_BALANCE;
    END;

    Your local variable cannot have the same name as the formal out parameter. This is a procedure example, but since functions should not have out parameters anyway ...
    session2> CREATE PROCEDURE p (p_id IN NUMBER, p_did OUT NUMBER) AS
      2     p_did NUMBER;
      3  BEGIN
      4     p_did := p_id * 2;
      5  END;
      6  /
    Warning: Procedure created with compilation errors.
    session2> show error
    Errors for PROCEDURE P:
    LINE/COL ERROR
    0/0      PL/SQL: Compilation unit analysis terminated
    1/1      PLS-00410: duplicate fields in RECORD,TABLE or argument list are
             not permittedThe proper way to create a function would be something like:
    CREATE FUNCTION f (p_id IN NUMBER) RETURN NUMBER AS
       l_did NUMBER;
    BEGIN
      l_did := p_id * 2;
      RETURN l_did;
    END;You should really assign a value to the variable before you return it.
    John

  • SSIS Programming- How to declare a variable of type Object?

    Hello, I have a very specific coding question. I am trying to create a pkg using SSIS Object model. I am trying to create a variable of type Object. But I could not find any reference in KB or forums on creating variable of this data type.
    Example:
    // Create the package.
    Application a = new Application();
    Package p = new Package();
    p.Name = "MyDataExtractPkg";
    //Add Variables to the pkg
    Variables pkgVars = p.Variables;
    Variable var8 = p.Variables.Add("varHour", false, "User", (System.Int16)0);
    Variable var9 = p.Variables.Add("varHourDiff", false, "User", 0);
    Variable var10 = p.Variables.Add("varIntervalWaitInMS", false, "User", 5000);
    Variable var11 = p.Variables.Add("varJobCnt", false, "User", 0);
    Variable var12 = p.Variables.Add("varjobID", false, "User", 0);
    Variable var13 = p.Variables.Add("varJobRS", false, "User", (System.Object)0);
    Variable var14 = p.Variables.Add("varProcessDate", false, "User", "abc");
    As you can see I was able to successfully variables of Type Int16, Int32(default) & String.
    But I need to create a variable of type Object for "varJobRS" and above code is generating int. Appreciate any direction or help on how to create Object variable type.
    Thanks,
    DW Guy

    I have been continuing with my work with intention to approch MS, but I came across the solution in one of the Blog site. The solution is :
    var13.Value =
    new
    Object();
    This converts the variable of type Object.
    The link that gave this soluion is:
    http://ssisbi.com/building-ssis-packages-programmatically-part-5/
    Thanks,
    DW Guy

  • How to access Workflow variables in Form Designer?

    Hello,
    I am wanting to set certain subforms to readonly depending on which part of the workflow the form is currently on. I already have the JavaScript code working to set the subform fields to readonly, but now I cannot figure out how to trigger this and where do I keep a variable to keep track of which part of the workflow I am currently in.
    I assume I will have a variable in the workflow itself and then I can use the Set Value QPAC to change the variable for each workflow step before it goes to the User QPAC, but what about within the form? I don't understand how the form javascript will know to execute, so how does my workflow "talk" to the form to set these fields to readonly?
    Right now the JavaScript code is sitting in the root::initialize part of the form. I was assuming I could have something like "if my workflow variable is equal to XX then set this subform to read only". But, how do I access my workflow variable in the form designer?
    Also, since I have digital signatures, I am having to pass all the form data in document variables, will this affect how I need to do this? I was also thinking of possibly accessing/setting a hidden field in the form, but thought the above way may be better.
    I hope that made sense!
    Thank you,
    Jennifer

    To follow-up, I spoke with Adobe support this morning and they said that I cannot access Workflow variables within Designer (besides those Workflow variables that are already provided).
    He mentioned that if I use the hidden fields, that I would need to Render the form each time before going to the User to trigger this to happen. So, I am not sure what I will do just yet. I probably not worry about making the fields readonly for the time being; it was a little extra thought I had and isn't required for our process.
    Thank you,
    Jennifer

  • How to declare bind variable in package

    hi,
    i have created one package with insert and returning the value in procedure using bind variable.
    -- spec part.
    SET SERVEROUTPUT ON
    VARIABLE id NUMBER
    CREATE OR REPLACE PACKAGE pack_sale AS
    PROCEDURE pro_insert_SOHeader (
    SO_HEADER_ID NUMBER,
    SO_NO VARCHAR2,
    SO_TYPE VARCHAR2,
    SO_APPROVED_FLAG VARCHAR2,
    SO_DATE DATE,
    CUST_HEADER_ID NUMBER);
    END pack_sale;
    -- body part
    CREATE OR REPLACE PACKAGE BODY pack_sale AS
    PROCEDURE pro_insert_SOHeader (
    SO_HEADER_ID NUMBER,
    SO_NO VARCHAR2,
    SO_TYPE VARCHAR2,
    SO_APPROVED_FLAG VARCHAR2,
    SO_DATE DATE,
    CUST_HEADER_ID NUMBER) IS
    BEGIN
    INSERT INTO SO_Header VALUES (SEQ_SOHEADER.NEXTVAL,SO_NO,SO_TYPE,SO_APPROVED_FLAG,SO_DATE,CUST_HEADER_ID)
    RETURNING SEQ_SOHEADER.CURRVAL INTO :id;
    COMMIT;
    END pro_insert_SOHeader;
    END pack_sale;
    I have run this package in sql*plus,it will return the warning message like
    PLS-00049: bad bind variable 'ID'.
    i do not know how to rectify this error
    and how to execute this procedure in sql*plus.
    please help me...

    hi,
    when i was running the body script the error is displayed in
    sql*plus like
    SQL> @"D:\Viji Share\ex_body"
    SP2-0042: unknown command "" - rest of line ignored.
    15 /
    Warning: Package Body created with compilation errors.
    SQL> show error
    Errors for PACKAGE BODY PACK_SALE:
    LINE/COL ERROR
    11/30 PLS-00049: bad bind variable 'ID'

  • How to declare global variables using another global variable in ODI

    I am declaring a gloabal variable using another global variable.
    say for example:
    I have a global variable empid.
    I am decalaring another global variable empname in refreshing tab of global variables and the select statment is
    select empname from emp where empno = #GLOBAL.empid -------if i write like this i am getting error as invalid character.
    select empname from emp where empno = '#GLOBAL.empid'-------if i write like this i am getting error as invalid number.
    I have kept the datatype as numeric and action as non persistent
    Please help
    Thank you in advance.

    Hi,
    You cant test/refresh empname standalone.
    You need to create a new package drag and drop both variables and make them as refresh variable and execute that package and test.
    Flow,
    empid----> empname
    Thanks,
    Guru

  • How to declare a variable available for across all applications??

    Dear Friends,
    If i declare a global variable in the component controller it will be available during its runtime and its value get expired if i open same webdynpro component application in different log-in.I need to access one variable across all login of users and across many webdynpro applications created.What should i do??
    Please advice me.Thanks in advance.

    Thanks  Mr.Gardiner for your reply,
    I do not know much about this Shared Memory Objects can you please help me.
    My requirement is that my application which is attached to the portal has access to many concurrent users. I have a screen for which there is a edit button,  on click of which i need to restrict other users from edit . This is based on portal ID and another unique id for that screen.I thought of lock object but  i guess that wouldnt help me b'se i am not writing anything to the database but need to restrict users in controlling the editability of the UI element.In this scenario user can be same user with different application or another user using this application.
    So if i save those unique ID's acrros applications,  i can validate and throw a message for other users when they try to do edit action when one user is already doing it.

  • How to declare a variable in Custom column formula?

    I'm adding a new column and I have a formula like it:
    if Text.Length(Text.Replace(Text.Replace([Text], "-", ""), " ", "") ) = 4
    then "CB0" & Text.Range(Text.Replace(Text.Replace([Text], "-", ""), " ", "") , 2)
    else Text.Replace(Text.Replace([Text], "-", ""), " ", "")
    i want to do something like it:
    string = Text.Replace(Text.Replace([Text], "-", ""), " ", "") ) 
    if Text.Length(string) = 4
    then "CB0" & Text.Range(string, 2)
    else string

    The issue you have is that you haven't output 'string' anywhere.  You can create a column with the manipulated text and then reference that column when applying the if statement.
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    String = Table.AddColumn(Source, "ReplacedText", each Text.Replace(Text.Replace([Text], "-", ""), " ", "")),
    AddColumn = Table.AddColumn(String, "EndResult", each if Text.Length([ReplacedText]) = 4
    then "CB0" & Text.Range([ReplacedText], 2)
    else [ReplacedText])
    in
        AddColumn

  • How declear global variable in form and use all form

    hi master,
    sir,
    how i declear global variable in form and how use this variable in all form
    i have year table and pik current year or date form table and move in global variable and use in all form
    please give ma idea
    thanking you
    Aamir

    Ok, so, what characterset was your database created with?
    Does that characterset have a representation of that character?
    -Mark

  • How to define a variable name in ABAP?

    Field name         numer
                             1.000
                             5.000
                             3.000
    How to declare this variable x_numer?
    "select single numer into <b>x_numer</b> from TableName"
    Thanks!

    While declaring, you assign type. You can also assign default value or make it constanrt also.
    Like this:
    DATA: USER LIKE SY-UNAME.
    DATA: text_buffer TYPE string VALUE `Text`,
          count TYPE i VALUE 1,
          price TYPE p DECIMALS 2 VALUE '1.99'.
    Go to Se37 or Se38.
    Type RS* and drop down and you will see bunch of programs and FMs. choose any of them.
    this will display the program.
    In that press f1 and you will get the abap help and you can search by key words.
    Ravi Thothadri

  • Pass variables between form

    Hi,
    I'm using oracle forms 6i.
    How can i pass variables between forms?
    Consider the scenarion of a login form.
    After a user logged in successfully, a new form appears , where his name should be displayed
    like 'Welcome <user>'
    So name should be passed form login form to the home page.
    Is it possible with Oracle?
    Divya

    Arif,
    -- Your CodeTo format a number of lines, write  at the ending and to begin the code area write .
    -- Line of Code
    And if you want only 1 line to be formatted then use >.
    Regards,
    Manu.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • APEX: Declare global variable in APEX

    Hello All,
    Can anyone tell me how to declare global variable in Process(Pl/sql code) in Oracle APEX.
    Thanks,
    Jiten

    There is nothing like Global Variable that can be declared in Process in Apex.
    Look up Shared Components > Application Item. Maybe that is something that meets your requirement.
    Alternate, use Page 0 items.
    Regards,

  • Declare bind variables

    Hi All,
    I have one application(Java) in which the front end sends a list of values to backend(Oracle). The issue is i dont know how many number of parameters(values) would be there, it depends all on front end. But i want these values in my backend processing and want to use them as bind variables, so that i can build dynamic sqls and make dynamic calls.
    Is there any way that i can declare all the values what i get from front end as bind variables so that they would be available for that user session and the backend can directly refer them as a normal variable, without referring to any other object.
    Thanks in advance.

    Dear,
    Thanks for your answer, but the problem here is how to declare those variables ? if i declare them in a store procedure they would be local to that procedure and wont be available as bind variables.No.
    When using PL/SQL (static SQL) you will never encounter issues related to bind variables. PL/SQL itself takes care of yourcode and uses bind variables behind the scene.
    So, if you declare your variables inside a stored procedure, they will be automatically considered as bind variables. You don't have to care about. This is how PL/SQL (static SQL) works.
    The only situation where you have to look carefully to the use of bind variable within PL/SQL is when you use Dynamic sql into stored procedures or functions (this is in fact another reason to avoid using dynamic SQL).
    However, you need take care of the application which is calling your stored procedure. This calling application should call your stored procedure using input parameters as bind variables.
    Otherwise, the library cache of your shared pool will be full of calls to your stored procedure.
    Put it simply,
    (a) do what you want inside your PL/SQL strored procedure (static SQL and not Dynamic SQL)
    (b) call your stored procedure using bind variables
    Hope this helps
    Mohamed Houri

Maybe you are looking for