Use global variable in reports which is declared in forms

Hi All,
I have declared and used a global variable in Forms and after that I'm running a report and I want to use the same variable in reports.
How can I use that.
Regards
Praveen Kr. Arora

Hi Rizwan,
Thanks for prompt reply.
Can you explain in more detail with example.
Though I'm calling report from menu item and I have created report file with three parameters.
In menu item I have created a parameter list with same three parameters but whenever I tried to run then it gives Invalid ID error for all three parameters.
Regards
Praveen Kr. Arora

Similar Messages

  • Syntax for declaring global variable in report

    Hello all,
    Kindly let me know syntax for declaring global variable in report?
    Thnks,
    SUnny

    Hi Sunny,
    All data declaration in the main program is global.
    Only if you do some data declaration withtin the subroutines then the scope of the variable is limited to that FORM ....ENDFORM.
    As you read in the above reply for a global variable in FM you need to declare in the top include.
    This means that you want this variable to be made available to all the Function Modules in that Function Group.
    If you want to make the variabe be available only within that FM then do the declaration in the source code itself.
    hope this explaination helps,
    Taher.

  • Using Global variable in Record Group

    Hi,
    I have a requirement where in I need to pull a column name from a table and then use that value in the select statement of a record group. I have tried using global variables but it is not working. Here is the record group I would like to use.
    RG_DOMAIN is based on LOV_DOMAIN
    SELECT :GLOBAL.DOMAIN_COLUMN_NAME, DESCRIPTION FROM
    DM_T_DOMAIN_VALUES
    WHERE DOMAIN_NAME := BLOCK.ATTRIBUTE;
    In the Key-Listval I have a select statement in which does this :
    SELECT DOMAIN_COLUMN
    INTO :GLOBAL.DOMAIN_COLUMN_NAME
    FROM DM_T_DOMAIN_RULES WHERE DOMAIN_NAME = :BLOCK.ATTRIBUTE;
    SHOW_LOV('LOV_DOMAIN');
    The problem is I am not getting the value I am just getting the Domain_column name. For example for Domain_name 'CALC_TYP' the Domain_column is COLUMN_10 and I just see COLUMN_10 my LOV when I want to see the value of COLUMN_10 from the DM_T_DOMAIN_VALUES table.
    I tried using Name_in and Copy but not working. Can anyone suggest a solution?
    Thanks

    Francois ,
    I tried this but I am getting error saying record group does not exist. Can you tell me what should I go in Populate_group... and show_lov..maybe I am doing something wrong?
    Declare
    LC$Req Varchar2(512) ;
    Begin
    LC$Req := 'SELECT ' || :GLOBAL.DOMAIN_COLUMN_NAME || ' FROM ....' ;
    Create_Group_From_Query( rg_group, LC$Req ) ;
    Populate_group(RG_DOMAIN); ?? --- is this correct?
    Show_Lov(LOV_DOMAIN) ; -- and is this correct?
    End;

  • How to use Value Variable in Report Painter Column defined as Formula

    Hi Gurus,
    In report painter, how can I add one field (exchange rate) in selection screen, so that user can provide the exchange rate to be used, then execute the report, the exchange rate will used to multiple local currency amount.
    The reason for this is we want use provided exchange rate to convert the amount from once currency to the other currency.
    Alternatively I am studying the functionality of "Value Variable" and found that I can perform the task from this. I have created the value variable but when I am using the variable in Report Painter columns as "&ZVALVAR", system is giving me error. I read the help and it states that use the variable with "&" and do it as it is mentioned.
    Can anybody suggest what I need to do to make it workable.
    Thanks

    I did try using the presentation variable, but that does not work too. I am setting session variable in the dashboard prompt (select 'request variable'). When I use presentation variable, it hard codes the value of the variable name.
    sql is
    select date from work_order where facility = @{p_facility}
    the physical log sql is
    select date from work_order where facility = 'p_facility'

  • Global Variable in report

    i am working with some global variables in all of my application including forms and reports. the global variables are created in the when new-form-instance trigger of the main form. the global variables are accessible throught the forms but i d,not know how i can access the same global variables in my reports. pls some one help me to solve the problem.

    If you only want to read the global parameters in Reports, you can pass them as parameters. Otherwise, you must put your global variables into a database table, for forms and reports are not sharing the same session.

  • Using Global Variables in Data Quality Address Cleanse Transforms

    I am currently developing in Data Services 12.2.
    I am trying to dynamically populate the List Owner information in the option tabs of the USA Regulatory Address Cleanse by using global variables.  It populates the 3553 with the variable name instead of the value assigned.
    According to the Technical Manual, it is possible to use global variables in Data Quality Address Cleanse transforms:
    However, you can use substitution parameters in all places where global variables are supported, for example:
    Query transform WHERE clauses
    Mappings
    SQL transform SQL statement identifiers
    Flat-file options
    User-defined transforms
    Address cleanse transform options
    Matching thresholds
    Does anyone know if it is possible to use global variables in the option tab of the Address Cleanse; if so, can you describe how it is done?
    Thanks in advance,
    Rick

    Hi,
    U can refer to the following links in help.sap.com
    GlobalContainer Object
    http://help.sap.com/saphelp_nw04/helpdata/en/75/8e0f8f3b0c2e4ea5f8d8f9faa9461a/content.htm
    Container Object
    http://help.sap.com/saphelp_nw04/helpdata/en/78/b4ea10263c404599ec6edabf59aa6c/content.htm
    Also some of the RUN TIME CONSTANTS are available in your BPM. So if you are trying to retrieve those variables in your Mapping(that is used in BPM), also read the following thread.
    Re: Message id in BPM
    Cheers,
    Siva Maranani.

  • Can i use global variable in web forms

    guys can any one tell me if i can use global variables when i am
    deplying the forms on the web,.....
    thank you
    vas
    null

    Global variables work in their perfection even when you deploy
    your forms on the WEB.
    null

  • VALUE USING GLOBAL VARIABLE

    Hello
    I made a Global Variable XX_DATE in Transaction Form Personalization with a value =:TACC_ACC_ASSGN.GL_POSTED_DATE.
    I'm planning to get the value from XX_DATE to one of the fields in Receipts thru Receipt Personalization.
    But a got the following error when I validate the value in Actions
    FRM-40815: Variable GLOBAL.XX_DATE does not exist.
    The String =:GLOBAL.XX_DATE could not be evaluated because of an errorAny help on this please?
    I just wanted to transfer data (GL_POSTED_DATE) from Transactions to Receipts using Global Variable.
    Any other ideas?
    Thanks a lot
    emgeee

    In WHEN_NEW_FORM_INSTANCE set the property INITIAL_VALUE for the global variable.

  • Using global variable in package

    Hi. I have created a function (Retrieve_SerialNo) which returns a variable, which I use throughout my package. I would like to assign this variable as a global variable to be used by all functions and procedures in the package. Can someone help me in the declaration of this variable as a global variable? Also, is it necessary for me to initialize this variable whenever the package executes. If yes, how would I do this?
    CREATE OR REPLACE PACKAGE BODY Supply_Item_Interface AS
    FUNCTION Retrieve_SerialNo RETURN VARCHAR2 IS
        v_serial_no VARCHAR2(20);
        CURSOR Serial_Code IS
          SELECT S.Serial_Code
            FROM Spare_Parts s, Orders r
           WHERE s.serial_code = r.serial_code;
      BEGIN
        OPEN Serial_Code;
        LOOP
          FETCH Serial_Code
            INTO v_serial_no;
          EXIT WHEN Serial_Code%NOTFOUND;
          v_serial_no := v_serial_no;
        END LOOP;
        CLOSE Serial_Code;
        RETURN v_serial_no;
      EXCEPTION
        WHEN OTHERS THEN
          RETURN NULL;
      END;

    user13415143 wrote:
    Hi. I have created a function (Retrieve_SerialNo) which returns a variable, which I use throughout my package. I would like to assign this variable as a global variable to be used by all functions and procedures in the package.All variables have scope or "visibility". A variable defined in a procedure is only visible within that procedure.
    A variable defines in a package body. is visible within that package body (i.e. procedures and functions in that package body can "see" that variable.
    A variable defined in the package definition? Well, who can see the definitions of procedures and function in a a package header/definition? Everyone else basically (other PL/SQL packages and procedures and functions). So this is also true for variables defined in the package interface. These are global variables that not only can be used by the code in that package's body, but also can be used by other packages and PL/SQL code.
    So when you create a global variable you need to decide on its scope:
    - define it in package header for global usage in all PL/SQL code
    - define it in package body for global usage within that package only
    CREATE OR REPLACE PACKAGE BODY Supply_Item_Interface AS
    ..snipped..Ugly code as there is no need to use an explicit cursor if returning a value from a single row. Also buggy code. If there are multiple rows returned by the cursor, the function returns the serial of the last random row. How does this make sense?
    This is what I would expect to see from a function like this. You pass it a unique identifier and it returns the applicable attribute (column) value for it.
    E.g.
    create or replace function GetSerialNo( orderNo number ) return number is
      serialNo number;
    begin
      select
        s.serial_code into serialNo
      from spare_parts s,
           orders o  
      where s.serial_code = o.serial_code
      and o.order_no = orderNo;
      return( serialNo );
    exception when NO_DATA_FOUND then
      return( null )
    end;Also note that there is no need to write ugly uppercase code. This is not a proper coding standard. Programming standards for all languages (ranging from C# to Java to Delphi to Visual Basic to C/C++) specify that camelcase should be used for variables and pascalcase for procedures/functions/methods. Uppercase is very seldom used and then only for constant names and compiler options/flags for example.
    Coding reserved words in uppercase? That is just plain silly - and not found in today's programming languages. Do yourself a favour and forget the idiotic standards used by some for PL/SQL and look at the standards for Java and .Net/C# - as the latter are the de facto standards for programming (and have been for the last 2 decades and more).

  • Using global variable read status

    Hi Experts,
    I need to change the Note based o the Service Ticket status. I declared global variable as a string in ZL_ICCMP_BT_BTSHEADER_IMPL (Component: ICCMP_BTSHEAD; View: BTSHeader)
    And I am passing the Status to this global variable using the GET and SET methods of the STRUCT.ACT_STATUS attribute in BTSTATUSH node in same component and view.
    I referred this global variable in DO_PREPARE_OUTPUT of the component ICCMP_BTTEXT/TextView to set the Note as shown below.
    if ZL_ICCMP_BT_BTSHEADER_IMPL=>GC_STATUS = 'E0001'.
    I would like to know whether this approach is the best way to read status or any other optimistic  approach is there to follow for my this scenario. Please advise me.
    Thanks
    Chand

    Hi Basha,
    If you are using static variables, i wouldn't recommend using this approach.. there are better approach to get/set values in web client session which avoids setting/clearing static variables etc..
    you can follow below approach..
    1. To Get/set the variable in ic session to avoid the static variable.. for eg global cuco is available which you can use for this purpose.
    lr_bdc type ref to if_crm_ui_data_context.
    lr_bdc = cl_crm_ui_data_context_srv=>get_instance( me ).
    check lr_bdc is bound.
    Using SET_DATA_ATTRIBUTE set the attribute value and using GET_DATA_ATTRIBUTE get the attribute valueu2026get_attribute, set_attribute
    read current BuAg if exist
    lr_buag ?= lr_bdc->GET_DATA_ATTRIBUTE( 'CURRENTBUAG' ).
    Here "CURRENTBUAG" is the attribute name, you can give any attribute name while setting and get the same attribute value via get_data_attribute.
    Cheers,
    Sumit Mittal

  • BADI for BI  Global Variables in Reporting

    Hi all,
    We have requirement in our project like, we want to write BADI for all BI Global Variable. As already Customer exit is available for all the BI global variable , but as there is limitation of IF-ENIF Statements in Include program of Customer Exit Function module , So we are planning to go BADI. Does any one have idea on BADI for BI global variable.
    Thanks in advance

    Kindly check below link for your kind information.
    http://www.scribd.com/doc/40764652/SAP-BI-Global-Report-Variable-User-Exit-Modularization
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60e34f63-f44c-2c10-488e-c89b04e0ca7c?quicklink=index&overridelayout=true
    How to declare Global variable in BADI
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30de01e0-b6f5-2b10-fba1-b9193b82da2a?quicklink=index&overridelayout=true
    Re: virtual keyfigure using BADI
    Regards,
    Kamruz

  • What are the best practices to use GLOBAL Variables

    Hi,
    Please guide how Global Variables can be declared and how they can be initialized.
    Further please guide what are the impacts of Global Variables(if any) on the memory of CLIENT or SERVER, if they are not initialized or freed up after usage.
    Thanks.
    Regards.

    spilgrim wrote:
    My preference is not to use them and to use parameters or package variables. There is not real control on globals so you can end up with an applicatios that has lots of them that are only used once but persist for the user session.I second that. I don't know how often I searched for bugs caused by typos in the names of global variables. Plus the fact that they are only of datatype VARCHAR2. If you are using share_library_data you could also use Package globals in a forms library to share data between called and calling forms. Or you could use a database package...
    cheers

  • Using Global variables in business rules

    In EAS after expanding the Business Rules section there is a Global Variables section. I have created some global variables in this section and I am trying to use them in the Rule editor and not having much luck. Are they retrieved differently to local variables...Currently this is how I am calling them within a FIX....
    FIX([Global_Varaiable])
    calculation;
    EndFix
    Please correct me if I am wrong, also can any one provide some good documentation and some gd links for writing business rules. I'm just starting out to create some business rule which runs on save on some input forms I am creating and finding it rather difficult.... :-(..
    Many Thanks
    Stephen

    Hi,
    Global variables will work in the same way as local variables so you are using them correctly.
    Business rules are just really glorified calc scripts, if you want to know about calc script commands have a read of the tech ref :- http://download.oracle.com/docs/cd/E12825_01/epm.111/esb_techref/frameset.htm?launch.htm
    It will have all the calculation commands and functions and descriptions on how they work.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Question on how to use a variable in report object's horizontal formula to shift back and forth at refresh interval.

    Hello All;
    I have an SSRS Report that displays some slider objects. The report auto-refreshes every 5 minutes.
    This report is displayed on a big screen TV and I want to shift the images back and forth every time it refreshes to prevent possible burn-in on the screen.
    I see you can use a formula on the Horizontal position of objects, and I think a variable that gets added 10 and then subtracted by 10 every refresh could be used to display the objects in different positions each iteration, but I don't know how to do that
    in SSRS. I have read up on variables, and I think I need a global variable, but not sure how to update it on each refresh iteration.
    I read the links on using Silverlight to shift things, but that adds a whole other level of complexity.
    I could even do something in the DB and then pull that into the formula field if needed.
    Thanks in advance.
    George Hicks

    Hello All;
    I have an SSRS Report that displays some slider objects. The report auto-refreshes every 5 minutes.
    This report is displayed on a big screen TV and I want to shift the images back and forth every time it refreshes to prevent possible burn-in on the screen.
    I see you can use a formula on the Horizontal position of objects, and I think a variable that gets added 10 and then subtracted by 10 every refresh could be used to display the objects in different positions each iteration, but I don't know how to do that
    in SSRS. I have read up on variables, and I think I need a global variable, but not sure how to update it on each refresh iteration.
    I read the links on using Silverlight to shift things, but that adds a whole other level of complexity.
    I could even do something in the DB and then pull that into the formula field if needed.
    Thanks in advance.
    George Hicks

  • Is there a way to use Global variable in HANA

    Hi Developers,
    Is there anything like a Global variable in SAP HANA which can be used to pass data from one procedure to another (Visible to all the procedures in a session)?
    Thanks
    S.Srivatsan

    Hi Sundar,
    In best of my understanding, there is no context variable or global variable available under SQL SCRIPT scope . You may need to maintain the variable as a parameter in the procedure interface and pass it to the procedures where ever you need it to be available . Or,(DB table is in memory, so its just memory unit) you can create a DB table to store the variable(s) and access it anywhere .
    Sreehari

Maybe you are looking for