Cannot get session variables

Hello to all.
I am developing a shopping cart application in which I use to store some session variables in session object.
The problem arise when I integrate paypal with my application.
I use following code to redirect to the paypal's site
baseURL="https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token="+ack+"&ITEM_NAME="+itmName+"&ITEM_NUMBER="+itnSrNo+"&ITEM_AMT="+paymentAmount;
response.sendRedirect(baseURL);When I return from the paypal's site my all session variables are nulled.
I read somewhere that "response.sendRedirect()" method kills the session.
So, please somebody suggest me the alternatives of this method so that I cannot lose my session.
Thank You

typurohit wrote:
rajskhr wrote:
I read somewhere that "response.sendRedirect()" method kills the session.
It is not true. response.sendRedirect() don't kills session at all.
rajskhr wrote:
When I return from the paypal's site my all session variables are nulled.When you go to PayPal and return to your actual webapp, It might take longer then your session-timeout configuration in web.xml.
Side effect of this is when you come back to your webapp, session which you left behind before moving to PayPal got expired and you are dealing with new session now.
Increasing session timeout configuration in web.xml might help you. You can also cross check session status by method session.isNew() when you return from PayPal.+Thanks a lot.
You are write my session might expires after returning from the paypals site and I used setMaxInactiveInterval and its working
Thanks again.

Similar Messages

  • Function to get session variable is not working

    I created a report based on the following sql query:
    SELECT EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO FROM SCOTT.EMP
    WHERE DEPTNO = empcust.current_deptno
    empcust.current_deptno is a function which returns the value of the session variable. However, nothing gets returned. The value of the session variable is not found.
    I know that the session variable is being set b/c i have a procedure that sets it and prints out the assigned.
    This is my code for the current_deptno function. If anyone can help, i'd greatly appreciate it!
    procedure current_deptno
    return VARCHAR2
    as
    v_Session portal.wwsto_api_session;
    v_Return VARCHAR2(20); --DEPT.DEPTNO%TYPE;
    begin
    v_Session := portal.wwsto_api_session.load_session('PORTAL','SESS_EMP');
    v_Return := v_Session.get_attribute_as_varchar2('DEPTNO');
    htp.p('Return session var'||v_Return);
    RETURN(v_Return);
    end;

    Hi Imtiaz,
    Could you verify that the variable has indeed a value? You could check via the Session Manager in the Admin Tool. You could also check the Query Log to verify whether the Initialization Block is working like expected.
    Thanks.
    Daan Bakboord
    http://obibb.wordpress.com

  • How to get session variable value in conditional formatting

    I am trying to format my column according to value of a session variable. Normally when comparing to a static value I select value from add button and write the value. What I want is to be able to do this using a session variable. I select variable presentation and as the variable expression I tried MYDAY, NQ_SESSION.MYDAY, VALUEOF(NQ_SESSION.MYDAY), VALUEOF(MYDAY) but nothing works. By the way it is a date value, I don't know it makes any difference
    Any help would be appriciated

    I am surprised that it is not possible to select a session variable when you want to use conditional formatting. Apparently you can only base conditional formatting on presentation variable or values within a column.
    As a workaround you can create an extra column in your request and use a CASE WHEN statement, where you compare the value of the date with the session variable. Then you can base your conditional formatting on that column.
    Regards,
    Stijn
    Message was edited by:
    Stijn Gabriels

  • Imexpire cannot get session lock when run with scheduler

    When imexpire runs at the scheduled time, it produces:
    [15/Nov/2007:22:01:00 -0800] vmpm1 imexpire[7946]: General Error: Could not get expire session lock. Possibly another imexpire is running
    I found an imexpire.lck file and deleted it, but got the same error the next day. Next, I restarted messaging, then ran imexpire interactively with no problems. The imexpire.lck file remained and was not removed afterward. Our imexpire policy was migrated from ims5.2 and is housed in configutil. Can you give me any suggestions for how to allow imexpire to run correctly via the scheduler?
    We're running ims 6 2005Q4:
    -bash-3.00$ ./imsimta version
    Sun Java(tm) System Messaging Server 6.2-8.04 (built Feb 28 2007)
    libimta.so 6.2-8.04 (built 19:28:07, Feb 28 2007)
    SunOS vmpm1 5.10 Generic_125100-10 sun4u sparc SUNW,Sun-Fire-V490
    David.

    dpelinka wrote:
    When imexpire runs at the scheduled time, it produces:
    [15/Nov/2007:22:01:00 -0800] vmpm1 imexpire[7946]: General Error: Could not get expire session lock. Possibly another imexpire is runningAre you sure another imexpire isn't running?
    Do you have coreadm enabled on your system and if so has any messaging server processes core dumped since you last restart messaging server?
    I found an imexpire.lck file and deleted it, but got the same error the next day. The imexpire.lck file is supposed to be there. Processes obtain a file-level lock on this file. If you run fuser /opt/SUNWmsgsr/config/imexpire.lck does it return a value?
    Next, I restarted messaging, then ran imexpire interactively with no problems. The imexpire.lck file remained and was not removed afterward. Our imexpire policy was migrated from ims5.2 and is housed in configutil. Can you give me any suggestions for how to allow imexpire to run correctly via the scheduler?You need to determine why the lock was left in the first place. Has it been working since you restarted messaging server i.e. do you see something like the following in your /opt/SUNWmsgsr/log/default log?:
    [17/Nov/2007:23:00:01 +1100] mailserver imexpire[26309]: General Notice: Expire
    started (0)
    [17/Nov/2007:23:00:01 +1100] mailserver imexpire[26309]: General Notice: Expire
    finished
    Regards,
    Shane.

  • Cannot Get Text Variable to Read Metadata

    Hi,
    I am having an issue loading XMP Metadata into a text variable. I have tried the following procedure on two computers and no result (Windows 7, InDesign 5.0 and 5.5)
    Here is the basic procedure:
    1. Create a new InDesign Document.
    2. Navigate to FILE > FILE INFO
    3. When the XMP data appears, place the word "Test", “Test1”, “Test 2”, and “Test 3” in the Document Title, Author, Author Title, and Description fields and push OK. See Screenshot.
    4. Make a text box.
    5. Place the text insert cursor in the text box then go to the menu and open TYPE> TEXT VARIABLES > DEFINE.
    6. Once the dialog box opens, select NEW...
    7. Name the New Text Variable "Author" and select "METADATA CAPTION" for TYPE: and "AUTHOR" for METADATA: then push OK.
    8. Press the INSERT button to place the new "Author" text variable into the text box.
    Every time I get a <no intersecting link> indication. Can someone help me figure out what I’m doing wrong here?

    Thanks Steve, you are right on. Was hoping that the Metadata information could be absorbed into the file somehow like you can do in MS Word with the document properties for Title, Date, Revision ect. I now will change my plans and I will put the document information on the Title Page and cross-link it to my headers and footers.
    Thanks for the help.

  • Nnot Get Session Key for Authentication

    I found in trace file of my application
    (TRACE_LEVEL_CLIENT = SUPPORT in sqlnet.ora):
    ORA-28035 Cannot Get Session Key for Authentication
    Cause: Client and server cannot negotiate shared secret during logon.
    What is the session key and how to obtain it?

    DISABLE_OOB = ON
    NAMES.DEFAULT_DOMAIN = domain
    NAMES.DIRECTORY_PATH= (TNSNAMES)
    SQLNET.CRYPTO_SEED = P9EBHPQFLEIAJNUFAZHQP8JBNES8EBEEHS895LCWW9UZKO9HR2R2E5GDN7JV15T27QJO97D89BQAWSRF
    # SQLNET.CRYPTO_CHECKSUM_SERVER = requested
    # SQLNET.CRYPTO_CHECKSUM_CLIENT = requested
    # SQLNET.ENCRYPTION_SERVER = requested
    # SQLNET.ENCRYPTION_CLIENT = requested
    SQLNET.RADIUS_AUTHENTICATION = ad1.domain
    # SQLNET.RADIUS_AUTHENTICATION_PORT = (PORT)
    SQLNET.RADIUS_AUTHENTICATION_TIMEOUT = 5
    SQLNET.RADIUS_AUTHENTICATION_RETRIES = 3
    SQLNET.RADIUS_ALTERNATE = ad2.nlmk
    # SQLNET.RADIUS_ALTERNATE_PORT = (1645)
    SQLNET.RADIUS_ALTERNATE_TIMEOUT = 5
    SQLNET.RADIUS_ALTERNATE_RETRIES = 3
    SQLNET.RADIUS_SEND_ACCOUNTING = ON
    # SQLNET.RADIUS_SECRET=(path/radius.key)
    SQLNET.AUTHENTICATION_SERVICES = (NTS, BEQ,RADIUS)
    # TRACE_LEVEL_CLIENT = SUPPORT
    # TRACE_LEVEL_SERVER = SUPPORT
    domain is the name of my windows domain
    TNSNAMES.ORA
    SERVER.DOMAIN =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = server.domain)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = server.domain)
    )

  • Session variable getting reset when leaving dashboard

    I have created a session variable with the 'Enable any user to set the value' option.  I'm using the session variable as the default for a dashboard prompt.  I'm able to set the variable with that  dasboard prompt, and I can confirm that it is indeed getting set properly.  So the interaction of the variable and the prompt seems to be in order.
    After I make a selection from the dashboard prompt, as long as I stay in the dashboard, the session variable stays set to my selection.  I can move from page to page and everything is fine.  The selection stays put as I have set it.  However, the moment I leave the dashboard, the session variable is reinitialized back to its default value as specified by the SQL in its initialization block.  I can go from dashboard to catalog and back to dashboard - boom, it's back to the default.  My selection has been replaced.  ???
    And here's an odd thing:  I can look in the query log and see the initialization block code getting run when I log in.  So far, so good.  I can run the dashboard, make a prompt selection, and see the query log updated just fine.  Still OK.  BUT... when I switch from dashboard to catalog and back to dashboard, the value of the session variable is reset (I see the default month in my analysis and as the prompt default upon redisplay of the dashboard page), but there's no indication in the query log that the initialization block SQL ran again.  The last SQL in the query log still shows my "selected" value in the SQL.  The dashboard page is showing the "default", while the last entry in the query log shows the "selected".
    Can anyone else confirm this odd behavior?  And is there a reason that a session variable should not retain its value throughout the session?  I've always viewed session variables as little buckets of single-cell data whose contents are consistent and static for the duration of a session, unless manually changed by a dashboard prompt.  If the behavior that I'm seeing is both replicatable and expected, it would appear that my understanding is flawed.
    Running 11.1.1.7.0 on Windows Server 2008.  Same behavior is occurring in both Firefox 21 and IE 9.

    Thank you for your answer MK,
    I try to write a SQL in my prompt but not work for me:
    -In default selection I choose SQL Results and I type: Year(Current_date) and save my prompt and I don't see any value in my dashboardpage, if I click in prompt I can see all members of my year dimension but by default is empty.
    I modify the other solution: I have 1hour refresh time and I change for 1 minute, but doesn't work.
    the default initializer is in RPD (variable year that belongs to BI_Year Block) and I have written 2009.

  • How to get the session variable value in JSF

    Hi
    This is Subbus, I'm new for JSF framewrok, i was set the session scope for my LoginBean in faces-config.xml file..
    <managed-bean-name>login</managed-bean-name>
    <managed-bean-class>LoginBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope> like that...
    So all parameter in LoginBean are set in session right ?... for example i used userId is the Parameter...
    Now i need to get the the userId parameter from that session in my another JSP page.. how i get that ?..
    Already i tried
    session.getAtrribute("userId");
    session.getValue("userId");
    but it retrieve only "null" value.. could u please help me.. it's very urgent one..
    By
    Subbus

    Where i use that..is it in jsp or backend bean...
    simply i use the following code in one backend bean and try to get the value from there bean in the front of jsp page...
    in LogoutBean inside
    public String getUserID()
         Object sessionAttribute = null;
         FacesContext facescontext=FacesContext.getCurrentInstance();
         ExternalContext externalcontext=facescontext.getExternalContext();
         Map sessionMap=externalcontext.getSessionMap();
         if(sessionMap != null)
         sessionAttribute = sessionMap.get("userId");
         System.out.println("Session value is...."+(String)sessionAttribute);
         return (String)sessionAttribute;
         return "fail";
    JSP Page
    <jsp:useBean id="logs" scope="session" class="logs.LogoutBean" />
    System.out.println("SS value is ...."+logs.getUserID());
    but again it retrieve only null value.. could u please tell me first how to set the session variable in JSF.. i did faces-config only.. is it correct or not..
    By
    Subbus

  • Get loggedin Session variables in Home Page

    I got a members directory where u login.
    1.How come they get killed when i refresh a page.
    2.How do i get the loggedin session variable the home page.
    so i know if current user is logged in.
    The Application.cfc of the members is
    <cfcomponent name="Application" displayname="Application
    Component for the Login Security Tutorial" >
    <cfset This.name = "NewLoveZoneAfrica">
    <cfset This.applicationTimeout =
    CreateTimeSpan(0,0,0,45)>
    <cfset This.sessionManagement = "true">
    <cfset This.sessionTimeout = CreateTimeSpan(0,0,0,30)>
    <cfset This.clientManagement = "false">
    <cfset This.loginstorage="session">
    <cffunction name="onApplicationStart"
    returntype="boolean" output="true">
    <!--- Set up Application variables. Locking the
    Application scope is not necessary in this method. --->
    application starting
    <cfset Application.configured = 1>
    <cfset Application.datetimeConfigured = TimeFormat(Now(),
    "hh:mm tt") & " " & DateFormat(Now(), "mm.dd.yyyy")>
    <cfset Application.currentSessions = 0>
    <!--- Begin Setting up request variables here. --->
    <cfscript>
    request.app = structNew();
    Application.dsn = "LoveZoneAfrica";
    Application.webRoot =
    "#getPageContext().getRequest().getContextPath()#/NewLoveZoneAfrica/";
    Application.machineRoot = "/NewLoveZoneAfrica/";
    Application.cfcRoot = "NewLoveZoneAfrica.com";
    Application.Domain = "NewLoveZoneAfrica.com";
    factory=CreateObject("java","coldfusion.server.ServiceFactory");
    sqlService = factory.getDataSourceService();
    dsn = duplicate(sqlService.datasources[Application.dsn]);
    if(dsn.driver eq "MSAccess" or dsn.driver eq "MSAccessJet"
    or dsn.driver eq "ODBCSocket")
    request.app.ucase = "ucase";
    request.app.isAccess = true;
    else
    request.app.ucase = "ucase";
    request.app.isAccess = false;
    </cfscript>
    <!--- End Setting up request variables here. --->
    <cfreturn true>
    </cffunction>
    <cffunction name="onRequestStart" returntype="boolean"
    output="true" >
    <cfargument name="requestname" required=true/>
    <cfif isDefined("form.j_username") and
    isDefined("form.j_password")>
    <!--- If either password or Username is empty go to
    login--->
    <cfif form.j_username is "" or form.j_password is "">
    <cfinclude
    template="#Application.webRoot#Login/Security/Login.cfm">
    <cfabort>
    </cfif>
    <!--- First Check to see wether there is need to log out
    user--->
    <cfscript>
    // create the Security object
    Security =
    createObject("component","#Application.cfcRoot#.security");
    // store authenticate method of security object as roles
    variable.
    LogQry=Security.authenticate(form.j_username,form.j_password);
    </cfscript>
    <cfif LogQry.recordcount> <!--- User has
    Successfully logged in #GetValidUser# --->
    <cfloginuser name="#form.j_username#"
    password="#form.j_password#" roles="#valuelist(LogQry.Role)#">
    <!--- Update the LastLogin timestamp. --->
    <cfscript>Update_LastLogin=Security.LastLogin(form.j_username);
    </cfscript>
    <cfset request.User.LoggedIn = "1">
    <cfset request.User.Username = form.j_username>
    <cfset request.User.LastLogin = LogQry.LastLogin_Date
    >
    <cfelse>
    <!---Destroy request --->
    <cflock scope="SESSION" throwontimeout="Yes" timeout="7"
    type="EXCLUSIVE">
    <cfset clearStruct = StructDelete(request, "User")>
    </cflock>
    <!---Destroy request --->
    <cflock scope="SESSION" throwontimeout="Yes" timeout="7"
    type="EXCLUSIVE">
    <cfset clearStruct = StructDelete(SESSION, "User")>
    </cflock>
    </cfif>
    <cfif NOT isDefined("request.User.LoggedIn")>
    <cfset request.loginMessage ="Your Login Username or
    Password is Invalid ">
    <cfinclude
    template="#Application.webRoot#Login/Security/Login.cfm">
    <cfabort>
    <cfelse>
    <!--- If the login procedure is passed duplicate the
    request structure into the Session scope. --->
    <cflock scope="SESSION" throwontimeout="Yes"
    timeout="107" type="EXCLUSIVE">
    <cfset Session.User = Duplicate(request.User)>
    </cflock>
    <cflock name="lck_currentSessions" throwontimeout="Yes"
    timeout="107" type="EXCLUSIVE">
    <!---THIS has BE CHANgED : bEGIN- original COPY IS @ THE
    FOOT --->
    <!--- Copy identifying session information into the
    Application scope. --->
    <cfif NOT isDefined("Application.sessionData")>
    <!--- Increment the number of current sessions. --->
    <cfset Application.currentSessions =
    Application.currentSessions + 1>
    <cfset Application.sessionData = ArrayNew(1)>
    <cfset Arraysize = 0>
    <cfset Application.sessionData[Arraysize+1] =
    form.j_username>
    <CFELSE>
    <!---check to see wether this "Username" appears in the
    Application.sessionData.
    If so, ignore. If no then append the name to the array so we
    have a unique list of usernames--->
    <cfset Arraysize = ArrayLen(Application.sessionData)>
    <cfset Application.temp = ArrayNew(1)>
    <cfif Arraysize>
    <cfloop index = "LoopCount" from = "1" to =
    "#Arraysize#">
    <cfset #ArrayAppend(Application.temp,
    Application.sessionData[LoopCount])#>
    </cfloop>
    <cfdump var="#Application.sessionData#" >
    <cfset Isloggedin =
    ListFind(ArrayToList(Application.temp), form.j_username)>
    <cfif Isloggedin is 0>
    <cfset Application.sessionData[Arraysize+1] =
    form.j_username>
    <!--- Increment the number of current sessions. --->
    <cfset Application.currentSessions =
    Application.currentSessions + 1>
    </cfif>
    <cfelse>
    <!--- Increment the number of current sessions since twas
    empty. --->
    <cfset Application.currentSessions =
    Application.currentSessions + 1>
    <cfset Application.sessionData[Arraysize+1] =
    form.j_username>
    </cfif>
    </cfif>
    </cflock>
    </cfif>
    <cfelse>
    <cfif not ListLast(CGI.SCRIPT_NAME, "/") EQ
    "logout.cfm">
    <!---Check wether the username appears on the list
    Application.currentSessions is 0 --->
    <cfif NOT isDefined("Session.User.LoggedIn") >
    <cfinclude
    template="#Application.webRoot#Login/Security/login.cfm">
    <cfabort>
    </cfif>
    </cfif>
    </cfif>
    <!--- Check to see if a user is logged in on *every* cfm
    page request. --->
    <cfif not ListLast(CGI.SCRIPT_NAME, "/") EQ
    "logout.cfm">
    <cflock scope="SESSION" throwontimeout="Yes" timeout="7"
    type="READONLY">
    <cfif NOT isDefined("Session.User.LoggedIn")>
    <cfinclude
    template="#Application.webRoot#Login/Security/login.cfm">
    <cfabort>
    </cfif>
    </cflock>
    </cfif>
    <cfreturn true>
    </cffunction>
    <cffunction name="onSessionEnd" returntype="void">
    <cfargument name="SessionScope" required="true">
    <cfargument name="ApplicationScope" required="true">
    <cfset request.loginMessage="Nimeingia onSessionEnd">
    <cflock name="lck_currentSessions" throwontimeout="Yes"
    timeout="7" type="EXCLUSIVE">
    <cfset sessionPosition =
    ListFind(ArrayToList(arguments.ApplicationScope.sessionData),
    arguments.SessionScope.sessionid)>
    <cfif sessionPosition neq 0>
    <cfset
    ArrayDeleteAt(arguments.ApplicationScope.sessionData,
    sessionPosition)>
    <cfset arguments.ApplicationScope.currentSessions =
    arguments.ApplicationScope.currentSessions - 1>
    </cfif>
    </cflock>
    </cffunction>
    <cffunction name="onSessionStart" returntype="void">
    <cfset request.loginMessage="Nimeingia onSessionEnd">
    </cffunction>
    <cffunction name="onRequestEnd" returntype="void">
    <!--- Write any code that needs to run when the page
    request ends. This replaces onRequestEnd.cfm --->
    </cffunction>
    </cfcomponent>

    Answered my own quests
    http://www.rewindlife.com/archives/000046.cfm

  • I am getting an error cannot resolve symbol variable?

    I am trying to run a PdfFormGenerator.java file and am using the iText API, hence have included
    the iText.jar file. When I compile the code I keep getting the following two errors:
    cannot resolve symbol variable CLASS_LOCATION
    cannot resolve symbol variable FORM_LOCATION
    can anyone guide me what I may have done wrong.
    Thanks,
    Zub

    Hi! To be more specific its these to line of the code is were I am going the errors:
        private String classLocation = Constants.CLASS_LOCATION;
        private String formLocation = Constants.FORM_LOCATION;Thanks

  • (OS 10.6.8 Imac)I cannot open an adobe file on wels fargo online getting Session-1.cgi could not be open unknowe error etc.. on othe browsers it works (safari,Chorme)

    Question
    (OS 10.6.8 Imac)I cannot open an adobe file on wels fargo online getting Session-1.cgi could not be open unknown error etc.. on othe browsers it works (safari,Chrome)

    If anyone is reading this still looking for what caused the issue and how to fix it here is what I discovered.
    The antivirus program our company uses, Bitdefender Antivirus Plus, was causing some of the PDF files not to open. After troubleshooting the different modules and settings the culprit was..
    Scan SSL in Privacy Control Settings. Turning it OFF solved the problem and all the PDF files that previously would not open now open just fine. This issue has been sent to Bitdefender for them to review. If you use a different antivirus program and are having this issue try locating the Scan SSL setting and see if turning it off solves the problem.

  • How to get and set a session variable from backing bean?

    Hi im using Jdev 11.1.1.2.0 and i need to set and get a session variable from backing Bean.
    Any idea?

    the class :
    package arq.resources;
    import javax.faces.context.FacesContext;
    import javax.servlet.http.HttpSession;
    public class SesionSigef {
    public FacesContext context;
    public HttpSession session;
    public SesionSigef() {
    super();
    context = FacesContext.getCurrentInstance();
    session = (HttpSession)(context.getExternalContext().getSession(true));
    public Object getVariableSesion(String atributo){
    return session.getAttribute(atributo);
    public void setVariableSesion(String atributo,Object valor){
    session.setAttribute(atributo, valor);
    the example of use :
    SesionSigef se = new SesionSigef();
    DatosRec da = new DatosRec();
    da.setDocumentoCip("Aprobar");
    se.setVariableSesion("DatosRec", da);
    thanks
    Joaquin

  • HT4623 For an Ipad purchaced from Apples store November 2012, was working on line, finished session, turned ipad off now cannot get it to turn on or register the charger

    For an Ipad purchaced from Apples store November 2012, was working on line, finished session, turned ipad off now cannot get it to turn on or register the charger can anybody help

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • NullPointerException - Cannot get the value from variable f_cashGiven

    In SubCheckout.java (a POS), what I want is when Payment button (f_cashPayment) is pressed, the action "Cash" is performed, get the value from Cash Given (f_cashGiven), do the subtraction and post the value as Cash Return (f_cashReturn). The code is filled in actionPerformed. But I cannot get the value by using f_cashGiven.getValue() from VNumber class. It returns NULL. This should be quite straight forward, but I do not know what is wrong. Please help!
    Enclosed please find the source code of SubCheckout.java and VNumber.java
    This is the code of SubCheckout.java :
    * The contents of this file are subject to the   Compiere License  Version 1.1
    * ("License"); You may not use this file except in compliance with the License
    * You may obtain a copy of the License at http://www.compiere.org/license.html
    * Software distributed under the License is distributed on an  "AS IS"  basis,
    * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
    * the specific language governing rights and limitations under the License.
    * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
    * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
    * are Copyright (C) 1999-2005 Jorg Janke.
    * All parts are Copyright (C) 1999-2005 ComPiere, Inc.  All Rights Reserved.
    * Contributor(s): ______________________________________.
    package org.compiere.pos;
    import java.awt.*;
    import java.awt.event.*;
    import java.math.BigDecimal;
    import javax.swing.border.*;
    import org.compiere.grid.ed.*;
    import org.compiere.swing.*;
    import org.compiere.util.*;
    *     POS Checkout Sub Panel
    *  @author Jorg Janke
    *  @version $Id: SubCheckout.java,v 1.3 2005/03/11 20:28:22 jjanke Exp $
    public class SubCheckout extends PosSubPanel implements ActionListener
          *      Constructor
          *     @param posPanel POS Panel
         public SubCheckout (PosPanel posPanel)
              super (posPanel);
         }     //     PosSubCheckout
         private CButton f_register = null;
         private CButton f_summary = null;
         private CButton f_process = null;
         private CButton f_print = null;
         private CLabel f_lcreditCardNumber = null;
         private CTextField f_creditCardNumber = null;
         private CLabel f_lcreditCardExp = null;
         private CTextField f_creditCardExp = null;
         private CLabel f_lcreditCardVV = null;
         private CTextField f_creditCardVV = null;
         private CButton f_cashPayment = null;
         private CLabel f_lcashGiven = null;
         private VNumber f_cashGiven = null;
         private CLabel f_lcashReturn = null;
         private VNumber f_cashReturn = null;
         private CButton f_creditPayment = null;
         /**     Logger               */
         private static CLogger log = CLogger.getCLogger(SubCheckout.class);
          *      Initialize
         public void init()
              //     Title
              TitledBorder border = new TitledBorder(Msg.getMsg(Env.getCtx(), "Checkout"));
              setBorder(border);
              //     Content
              setLayout(new GridBagLayout());
              GridBagConstraints gbc = new GridBagConstraints();
              gbc.insets = INSETS2;
              //     --     0
              gbc.gridx = 0;
              f_register = createButtonAction("Register", null);
              gbc.gridy = 0;
              add (f_register, gbc);
              f_summary = createButtonAction("Summary", null);
              gbc.gridy = 1;
              add (f_summary, gbc);
              f_process = createButtonAction("Process", null);
              gbc.gridy = 2;
              add (f_process, gbc);
              f_print = createButtonAction("Print", null);
              gbc.gridy = 3;
              add (f_print, gbc);
              //     --     1 -- Cash
              gbc.gridx = 1;
              gbc.gridheight = 2;
              gbc.fill = GridBagConstraints.BOTH;
              gbc.weightx = .1;
              CPanel cash = new CPanel(new GridBagLayout());
              cash.setBorder(new TitledBorder(Msg.getMsg(Env.getCtx(), "Cash")));
              gbc.gridy = 0;
              add (cash, gbc);
              GridBagConstraints gbc0 = new GridBagConstraints();
              gbc0.insets = INSETS2;
              gbc0.anchor = GridBagConstraints.WEST;
              f_lcashGiven = new CLabel(Msg.getMsg(Env.getCtx(),"CashGiven"));
              cash.add (f_lcashGiven, gbc0);
              f_cashGiven = new VNumber("CashGiven", false, false, true, DisplayType.Amount,
                   Msg.translate(Env.getCtx(), "CashGiven"));
              f_cashGiven.addActionListener(this);
              f_cashGiven.setColumns(10, 25);
              cash.add (f_cashGiven, gbc0);
              f_cashGiven.setValue(Env.ZERO);
              f_lcashReturn = new CLabel(Msg.getMsg(Env.getCtx(),"CashReturn"));
              cash.add (f_lcashReturn, gbc0);
              f_cashReturn = new VNumber("CashReturn", false, true, false, DisplayType.Amount,
                   "CashReturn");
              f_cashReturn.setColumns(10, 25);
              cash.add (f_cashReturn, gbc0);
              f_cashReturn.setValue(Env.ZERO);
              f_cashPayment = createButtonAction("Payment", null);
              f_cashPayment.setActionCommand("Cash");
              gbc0.anchor = GridBagConstraints.EAST;
              gbc0.weightx = 0.1;
              cash.add (f_cashPayment, gbc0);
              //     --     1 -- Creditcard
              CPanel creditcard = new CPanel(new GridBagLayout());
              creditcard.setBorder(new TitledBorder(Msg.translate(Env.getCtx(), "CreditCardType")));
              gbc.gridy = 2;
              add (creditcard, gbc);
              GridBagConstraints gbc1 = new GridBagConstraints();
              gbc1.insets = INSETS2;
              gbc1.anchor = GridBagConstraints.WEST;
              gbc1.gridx = 0;
              gbc1.gridy = 0;
              f_lcreditCardNumber = new CLabel(Msg.translate(Env.getCtx(), "CreditCardNumber"));
              creditcard.add (f_lcreditCardNumber, gbc1);
              gbc1.gridy = 1;
              f_creditCardNumber = new CTextField(18);
              creditcard.add (f_creditCardNumber, gbc1);
              gbc1.gridx = 1;
              gbc1.gridy = 0;
              f_lcreditCardExp = new CLabel(Msg.translate(Env.getCtx(),"CreditCardExp"));
              creditcard.add (f_lcreditCardExp, gbc1);
              gbc1.gridy = 1;
              f_creditCardExp = new CTextField(5);
              creditcard.add (f_creditCardExp, gbc1);
              gbc1.gridx = 2;
              gbc1.gridy = 0;
              f_lcreditCardVV = new CLabel(Msg.translate(Env.getCtx(), "CreditCardVV"));
              creditcard.add (f_lcreditCardVV, gbc1);
              gbc1.gridy = 1;
              f_creditCardVV = new CTextField(5);
              creditcard.add (f_creditCardVV, gbc1);
              gbc1.gridx = 3;
              gbc1.gridy = 0;
              gbc1.gridheight = 2;
              f_creditPayment = createButtonAction("Payment", null);
              f_creditPayment.setActionCommand("CreditCard");
              gbc1.anchor = GridBagConstraints.EAST;
              gbc1.weightx = 0.1;
              creditcard.add (f_creditPayment, gbc1);
         }     //     init
          *      Get Panel Position
         public GridBagConstraints getGridBagConstraints()
              GridBagConstraints gbc = super.getGridBagConstraints();
              gbc.gridx = 0;
              gbc.gridy = 3;
              return gbc;
         }     //     getGridBagConstraints
          *      Dispose - Free Resources
         public void dispose()
              super.dispose();
         }     //     dispose
          *      Action Listener
          *     @param e event
         public void actionPerformed (ActionEvent e)
              String action = e.getActionCommand();
              if (action == null || action.length() == 0)
                   return;
              log.info( "PosSubCheckout - actionPerformed: " + action);
              if (e.getSource() == f_cashGiven) {
                   f_cashGiven.setValue(f_cashGiven.getValue());
                   System.out.println("f_cashGiven"+f_cashGiven.getDisplay());
              //     Register
              //     Summary
              //     Print
              if (action.equals("Cash")) {
                   BigDecimal CashGiven, GrandTotal, CashReturn;
                   System.out.println("Cash given is "+f_cashGiven.getDisplay());
                   CashGiven = (BigDecimal)f_cashGiven.getValue();
                   GrandTotal = (BigDecimal)p_posPanel.f_curLine.getOrder().getGrandTotal();
                   CashReturn = CashGiven.subtract(GrandTotal);
                   f_cashReturn.setValue(CashReturn);
              //     Cash (Payment)
              //     CreditCard (Payment)
         }     //     actionPerformed
    }     //     PosSubCheckoutThis is the code of VNumber.java :
    * The contents of this file are subject to the   Compiere License  Version 1.1
    * ("License"); You may not use this file except in compliance with the License
    * You may obtain a copy of the License at http://www.compiere.org/license.html
    * Software distributed under the License is distributed on an  "AS IS"  basis,
    * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
    * the specific language governing rights and limitations under the License.
    * The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
    * Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
    * are Copyright (C) 1999-2005 Jorg Janke.
    * All parts are Copyright (C) 1999-2005 ComPiere, Inc.  All Rights Reserved.
    * Contributor(s): ______________________________________.
    package org.compiere.grid.ed;
    import java.awt.*;
    import java.awt.event.*;
    import java.beans.*;
    import java.math.*;
    import java.text.*;
    import java.util.logging.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import org.compiere.apps.*;
    import org.compiere.model.*;
    import org.compiere.swing.*;
    import org.compiere.util.*;
    *     Number Control
    *      @author      Jorg Janke
    *      @version      $Id: VNumber.java,v 1.41 2005/09/03 01:57:16 jjanke Exp $
    public final class VNumber extends JComponent
         implements VEditor, ActionListener, KeyListener, FocusListener
         /**     Number of Columns (12)          */
         public final static int SIZE = 12;
          *  IDE Bean Constructor
         public VNumber()
              this("Number", false, false, true, DisplayType.Number, "Number");
         }   //  VNumber
          *     Create right aligned Number field.
          *     no popup, if WindowNo == 0 (for IDs)
          *  @param columnName column name
          *  @param mandatory mandatory
          *  @param isReadOnly read only
          *  @param isUpdateable updateable
          *  @param displayType display type
          *  @param title title
         public VNumber(String columnName, boolean mandatory, boolean isReadOnly, boolean isUpdateable,
              int displayType, String title)
              super();
              super.setName(columnName);
              m_columnName = columnName;
              m_title = title;
              setDisplayType(displayType);
              LookAndFeel.installBorder(this, "TextField.border");
              this.setLayout(new BorderLayout());
    //          this.setPreferredSize(m_text.getPreferredSize());          //     causes r/o to be the same length
    //          int height = m_text.getPreferredSize().height;
    //          setMinimumSize(new Dimension (30,height));
              //     ***     Text     ***
              m_text.setBorder(null);
              m_text.setHorizontalAlignment(JTextField.TRAILING);
              m_text.addKeyListener(this);
              m_text.addFocusListener(this);
              //     Background
              setMandatory(mandatory);
              this.add(m_text, BorderLayout.CENTER);
              //     ***     Button     ***
              m_button.setIcon(Env.getImageIcon("Calculator10.gif"));
              m_button.setMargin(new Insets(0, 0, 0, 0));
              m_button.setFocusable(false);
              m_button.addActionListener(this);
              this.add (m_button, BorderLayout.EAST);
              //     Prefereed Size
              this.setPreferredSize(this.getPreferredSize());          //     causes r/o to be the same length
              //  Size
              setColumns(SIZE, CComboBox.FIELD_HIGHT-4);     
              //     ReadWrite
              if (isReadOnly || !isUpdateable)
                   setReadWrite(false);
              else
                   setReadWrite(true);
         }     //     VNumber
          *  Dispose
         public void dispose()
              m_text = null;
              m_button = null;
              m_mField = null;
         }   //  dispose
          *     Set Document
          *  @param doc document
         protected void setDocument(Document doc)
              m_text.setDocument(doc);
         }     //     getDocument
         private String               m_columnName;
         protected int               m_displayType;     //  Currency / UoM via Context
         private DecimalFormat     m_format;
         private String               m_title;
         private boolean               m_setting;
         private String               m_oldText;
         private String               m_initialText;
         private boolean               m_rangeSet = false;
         private Double               m_minValue;
         private Double               m_maxValue;
         private boolean               m_modified = false;
         /**  The Field                  */
         private CTextField          m_text = new CTextField(SIZE);     //     Standard
         /** The Button                  */
         private CButton              m_button = new CButton();
         private MField          m_mField = null;
         /**     Logger               */
         private static CLogger log = CLogger.getCLogger(VNumber.class);
          *      Set no of Columns
          *     @param columns columns
         public void setColumns (int columns, int height)
              m_text.setPreferredSize(null);
              m_text.setColumns(columns);
              Dimension size = m_text.getPreferredSize();
              if (height > size.height)               //     default 16
                   size.height = height;
              if (CComboBox.FIELD_HIGHT-4 > size.height)
                   size.height = VLookup.FIELD_HIGHT-4;
              this.setPreferredSize(size);          //     causes r/o to be the same length
              this.setMinimumSize(new Dimension (columns*10, size.height));
              m_button.setPreferredSize(new Dimension(size.height, size.height));
         }     //     setColumns
          *     Set Range with min & max
          *  @param minValue min value
          *  @param maxValue max value
          *     @return true, if accepted
         public boolean setRange(Double minValue, Double maxValue)
              m_rangeSet = true;
              m_minValue = minValue;
              m_maxValue = maxValue;
              return m_rangeSet;
         }     //     setRange
          *     Set Range with min & max = parse US style number w/o Gouping
          *  @param minValue min value
          *  @param maxValue max value
          *  @return true if accepted
         public boolean setRange(String minValue, String maxValue)
              if (minValue == null || maxValue == null)
                   return false;
              try
                   m_minValue = Double.valueOf(minValue);
                   m_maxValue = Double.valueOf(maxValue);
              catch (NumberFormatException nfe)
                   return false;
              m_rangeSet = true;
              return m_rangeSet;
         }     //     setRange
          *  Set and check DisplayType
          *  @param displayType display type
         public void setDisplayType (int displayType)
              m_displayType = displayType;
              if (!DisplayType.isNumeric(displayType))
                   m_displayType = DisplayType.Number;
              m_format = DisplayType.getNumberFormat(displayType);
              m_text.setDocument (new MDocNumber(displayType, m_format, m_text, m_title));
         }   //  setDisplayType
          *     Set ReadWrite
          *  @param value value
         public void setReadWrite (boolean value)
              if (m_text.isReadWrite() != value)
                   m_text.setReadWrite(value);
              if (m_button.isReadWrite() != value)
                   m_button.setReadWrite(value);
              //     Don't show button if not ReadWrite
              if (m_button.isVisible() != value)
                   m_button.setVisible(value);
         }     //     setReadWrite
          *     IsReadWrite
          *  @return true if rw
         public boolean isReadWrite()
              return m_text.isReadWrite();
         }     //     isReadWrite
          *     Set Mandatory (and back bolor)
          *  @param mandatory mandatory
         public void setMandatory (boolean mandatory)
              m_text.setMandatory(mandatory);
         }     //     setMandatory
          *     Is it mandatory
          *  @return true if mandatory
         public boolean isMandatory()
              return m_text.isMandatory();
         }     //     isMandatory
          *     Set Background
          *  @param color color
         public void setBackground(Color color)
              m_text.setBackground(color);
         }     //     setBackground
          *     Set Background
          *  @param error error
         public void setBackground (boolean error)
              m_text.setBackground(error);
         }     //     setBackground
          *  Set Foreground
          *  @param fg foreground
         public void setForeground(Color fg)
              m_text.setForeground(fg);
         }   //  setForeground
          *     Set Editor to value
          *  @param value value
         public void setValue(Object value)
              log.finest("Value=" + value);
              if (value == null)
                   m_oldText = "";
              else
                   m_oldText = m_format.format(value);
              //     only set when not updated here
              if (m_setting)
                   return;
              m_text.setText (m_oldText);
              m_initialText = m_oldText;
              m_modified = false;
         }     //     setValue
          *  Property Change Listener
          *  @param evt event
         public void propertyChange (PropertyChangeEvent evt)
              if (evt.getPropertyName().equals(org.compiere.model.MField.PROPERTY))
                   setValue(evt.getNewValue());
         }   //  propertyChange
          *     Return Editor value
          *  @return value value (big decimal or integer)
         public Object getValue()
              if (m_text == null || m_text.getText() == null || m_text.getText().length() == 0)
                   return null;
              String value = m_text.getText();
              //     return 0 if text deleted
              if (value == null || value.length() == 0)
                   if (!m_modified)
                        return null;
                   if (m_displayType == DisplayType.Integer)
                        return new Integer(0);
                   return Env.ZERO;
              if (value.equals(".") || value.equals(",") || value.equals("-"))
                   value = "0";
              try
                   Number number = m_format.parse(value);
                   value = number.toString();      //     converts it to US w/o thousands
                   BigDecimal bd = new BigDecimal(value);
                   if (m_displayType == DisplayType.Integer)
                        return new Integer(bd.intValue());
                   if (bd.signum() == 0)
                        return bd;
                   return bd.setScale(m_format.getMaximumFractionDigits(), BigDecimal.ROUND_HALF_UP);
              catch (Exception e)
                   log.log(Level.SEVERE, "Value=" + value, e);
              if (m_displayType == DisplayType.Integer)
                   return new Integer(0);
              return Env.ZERO;
         }     //     getValue
          *  Return Display Value
          *  @return value
         public String getDisplay()
              return m_text.getText();
         }   //  getDisplay
          *      Get Title
          *     @return title
         public String getTitle()
              return m_title;
         }     //     getTitle
          *      Plus - add one.
          *      Also sets Value
          *     @return new value
         public Object plus()
              Object value = getValue();
              if (value == null)
                   if (m_displayType == DisplayType.Integer)
                        value = new Integer(0);
                   else
                        value = Env.ZERO;
              //     Add
              if (value instanceof BigDecimal)
                   value = ((BigDecimal)value).add(Env.ONE);
              else
                   value = new Integer(((Integer)value).intValue() + 1);
              setValue(value);
              return value;
         }     //     plus
          *      Minus - subtract one, but not below minimum.
          *      Also sets Value
          *     @param minimum minimum
          *     @return new value
         public Object minus (int minimum)
              Object value = getValue();
              if (value == null)
                   if (m_displayType == DisplayType.Integer)
                        value = new Integer(minimum);
                   else
                        value = new BigDecimal(minimum);
                   setValue(value);
                   return value;
              //     Subtract
              if (value instanceof BigDecimal)
                   BigDecimal bd = ((BigDecimal)value).subtract(Env.ONE);
                   BigDecimal min = new BigDecimal(minimum);
                   if (bd.compareTo(min) < 0)
                        value = min;
                   else
                        value = bd;
              else
                   int i = ((Integer)value).intValue();
                   i--;
                   if (i < minimum)
                        i = minimum;
                   value = new Integer(i);
              setValue(value);
              return value;
         }     //     minus
          *     Action Listener
          *  @param e event
         public void actionPerformed (ActionEvent e)
              log.config(e.getActionCommand());
              if (ValuePreference.NAME.equals(e.getActionCommand()))
                   if (MRole.getDefault().isShowPreference())
                        ValuePreference.start (m_mField, getValue());
                   return;
              if (e.getSource() == m_button)
                   m_button.setEnabled(false);
                   String str = startCalculator(this, m_text.getText(), m_format, m_displayType, m_title);
                   m_text.setText(str);
                   m_button.setEnabled(true);
                   try
                        fireVetoableChange (m_columnName, m_oldText, getValue());
                   catch (PropertyVetoException pve)     {}
                   m_text.requestFocus();
         }     //     actionPerformed
          *     Key Listener Interface
          *  @param e event
         public void keyTyped(KeyEvent e)    {}
         public void keyPressed(KeyEvent e)  {}
          *     Key Listener.
          *          - Escape           - Restore old Text
          *          - firstChange     - signal change
          *  @param e event
         public void keyReleased(KeyEvent e)
              log.finest("Key=" + e.getKeyCode() + " - " + e.getKeyChar()
                           + " -> " + m_text.getText());
              //  ESC
              if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
                   m_text.setText(m_initialText);
              m_modified = true;
              m_setting = true;
              try
                   if (e.getKeyCode() == KeyEvent.VK_ENTER)     //     10
                        fireVetoableChange (m_columnName, m_oldText, getValue());
                        fireActionPerformed();
                   else     //     indicate change
                        fireVetoableChange (m_columnName, m_oldText, null);     
              catch (PropertyVetoException pve)     {}
              m_setting = false;
         }     //     keyReleased
          *     Focus Gained
          *  @param e event
         public void focusGained (FocusEvent e)
              if (m_text != null)
                   m_text.selectAll();
         }     //     focusGained
          *     Data Binding to MTable (via GridController.vetoableChange).
          *  @param e event
         public void focusLost (FocusEvent e)
         //          log.finest(e.toString());
              //     APanel - Escape
              if (e.getOppositeComponent() instanceof AGlassPane)
                   m_text.setText(m_initialText);
                   return;
              try
                   fireVetoableChange (m_columnName, m_initialText, getValue());
                   fireActionPerformed();
              catch (PropertyVetoException pve)     {}
         }   //  focusLost
          *     Invalid Entry - Start Calculator
          *  @param jc parent
          *  @param value value
          *  @param format format
          *  @param displayType display type
          *  @param title title
          *  @return value
         public static String startCalculator(Container jc, String value,
              DecimalFormat format, int displayType, String title)
              log.config("Value=" + value);
              BigDecimal startValue = new BigDecimal(0.0);
              try
                   if (value != null && value.length() > 0)
                        Number number = format.parse(value);
                        startValue = new BigDecimal (number.toString());
              catch (ParseException pe)
                   log.info("InvalidEntry - " + pe.getMessage());
              //     Find frame
              Frame frame = Env.getFrame(jc);
              //     Actual Call
              Calculator calc = new Calculator(frame, title,
                   displayType, format, startValue);
              AEnv.showCenterWindow(frame, calc);
              BigDecimal result = calc.getNumber();
              log.config( "Result=" + result);
              calc = null;
              if (result != null)
                   return format.format(result);
              else
                   return value;          //     original value
         }     //     startCalculator
          *  Set Field/WindowNo for ValuePreference
          *  @param mField field
         public void setField (MField mField)
              m_mField = mField;
              if (m_mField != null
                   && MRole.getDefault().isShowPreference())
                   ValuePreference.addMenu (this, popupMenu);
         }   //  setField
          *      Remove Action Listner
          *      @param l Action Listener
         public void removeActionListener(ActionListener l)
              listenerList.remove(ActionListener.class, l);
         }     //     removeActionListener
          *      Add Action Listner
          *      @param l Action Listener
         public void addActionListener(ActionListener l)
              listenerList.add(ActionListener.class, l);
         }     //     addActionListener
          *      Fire Action Event to listeners
         protected void fireActionPerformed()
              int modifiers = 0;
              AWTEvent currentEvent = EventQueue.getCurrentEvent();
              if (currentEvent instanceof InputEvent)
                   modifiers = ((InputEvent)currentEvent).getModifiers();
              else if (currentEvent instanceof ActionEvent)
                   modifiers = ((ActionEvent)currentEvent).getModifiers();
              ActionEvent ae = new ActionEvent (this, ActionEvent.ACTION_PERFORMED,
                   "VNumber", EventQueue.getMostRecentEventTime(), modifiers);
              // Guaranteed to return a non-null array
              Object[] listeners = listenerList.getListenerList();
              // Process the listeners last to first, notifying those that are interested in this event
              for (int i = listeners.length-2; i>=0; i-=2)
                   if (listeners==ActionListener.class)
                        ((ActionListener)listeners[i+1]).actionPerformed(ae);
         }     //     fireActionPerformed
    }     //     VNumber

    If getValue() returns null, you need to trace the execution of the code and figure out which sequence of code is leading to the return of null. This method looks complex - a lot of if statements. If you do not have a debugger, put System.out.println statements inside the method to figure out what's going on.

  • To pass new session variable value to stored proc before running a report.

    Hi,
    Below is summary of the report requirement -
    Database level design
    1. Created a view and a global temporary table (GTT)
    2. Created an Oracle package procedure to accept from and to business dates on basis of which it will fetch, process and populate the GTT.
    Repository level design
    1. Created a business model containing the view and the GTT (mentioned above)
    2. Created two SESSION variables "from_dt" and "to_dt" to be initialized by their respective init blocks. Each of the variable is initialized with a DATE column value (of type DATETIME) from a database lookup table. I have also set the option "Enable that variable to be set by any user" for both variables.
    Query for these variables :
    from_dt = select from_date from <table>
    to_dt = select add_months(from_date,12) from <table>
    Presentation level design
    1. Using a text box, i display the default/initialized values of these variables like this -
    Current business date:@{biServer.variables['NQ_SESSION.from_dt']} Future business dt:@{biServer.variables['NQ_SESSION.to_dt']}
    Dates get displayed in YYYY-MM-DD 00:00:00 format
    The text msg displays these default dates and allows the user to specift different date range for which i create prompts as shown below.
    2. Using any random two columns of date type from the business model, i create two date dashboard prompts with labels "From Dt" and "To Dt".
    i select Calender Controls for both; setting Default To = Report Defaults.
    The Set Variable is set to Presentation variables - such that pv_from_dt maps to "From Dt" and pv_to_dt maps to "To Dt".
    3. i create the report using the business model created above. In the report "Advanced Tab" => "Prefix" field i specify the following -
    SET VARIABLE from_dt='@{pv_from_dt}',to_dt='@{pv_to_dt}';
    Note : The logic here is to display the default dates and allow user to specify different date values which will be stored in presentation variables.
    If the user does specify different "from dt" and "to dt" values, then using the presentation variables, i want to "write" back these new values to the corresponding session variables mentioned above.
    If the user does not specify different date range, then the default/initialized dates must be considered.
    I also display the default and new date values in the report title.
    Back to Repository level design
    To execute the stored procedure that will load the GTT before running the report I need to pass two date parameters to the stored procedure on basis of which it will fetch data, process and populate the GTT.
    In the Connection Pool --> Connection Script Tab --> Execute before query, I wrote the below query using the repository variables FROM_DT and TO_DT to execute the procedure -
    DECLARE
    v_from_dt date;
    v_to_dt date;
    BEGIN
    v_from_dt := VALUEOF(From_Dt);
    v_to_dt := VALUEOF(To_Dt);
    package_name1.package_body(v_from_dt,v_to_dt);
    END;
    Now when i try to run the report i get the following error :
    [nQSError: 10058] A general error has occurred. [nQSError: 23006] The session variable, NQ_SESSION.to_dt, has no value definition. (HY000)..
    Need help on this.
    Is it possible to "write back" a new value to a session variable ?
    Any other alternatives.
    Thanks
    Nusrat
    Edited by: user10309945 on Jan 24, 2011 10:08 PM

    Sandeep, I found a several topics where users describe saving values in DB through stored procedure or function. For example, [How to store OBIEE presentation level variable values in DB |http://forums.oracle.com/forums/thread.jspa?threadID=892006] I tried it and get an error
    *10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 14551, message: ORA-14551: cannot perform a DML operation inside a query ORA-06512*
    It's not a BI error. This error are generated by Oracle DB. If I write next:
    SELECT MyPLSQLFunction(p1,p2) FROM DUAL
    I get the same error.
    Oracle doesn't allow DML operations in SELECT.
    Did you relalize this feature yourself? Where did I mistake?

Maybe you are looking for

  • Function module to get GR IR details for Purchase Order

    Hi Is there any function module available in SAP to get the list of Goods Received and Invoice Reciept for a purchase order. One way to create a custom fuction to fetch the details from MSEG and BKPF. Can somebody suggest a better solution. Thanks in

  • How do I import video off a DVD?

    Is there a way to import video from a DVD directly into Final Cut Pro Express or do I need to download another program in order to do so. The DVDs are no copyrighted they are actually DVD I burned myself. If I do need to download another program whic

  • ITunes will not allow photos to sync

    iPod Touch 1 gen, 09 Mac Mini, Snow Leopard, iTunes claims that there is not enough space on my iPod for Photos, it removed the photos that were already present. I want to put about 10 MB of photos, there is 230 MB of space. What to do???

  • Is BOM required in both plants in strock transfer scenario

    Dear SAP Gurus, In Make to Order Scenario,  Plant1 is Process Plant and Plant 2 is Sales Plant.  Actually Customer place the order from Plant2,  Material require Sales BOM,  how do we transfer the stock from Plant1 to Plant2. In Plant2 client only ma

  • Beginner Q: timebase signal and clock

    What is the internal clock of DAQ MIO-16EX-50? Does it mean when you don't define your own clock, it will use the internal clcok to sample data? What is the rate of this internal clock? I am contuing other people's Labview DAQ program. he used extern