Using Objects in Prompts

Hi,
I have a requirement.
In OBIEE prompts, can we make use of 2 Objects. ie,
For eg:
Can we have a Prompt like,
*"EmpNo" is greater than "EmpAge"* like this, here "EmpNo" and "EmpAge" are both objects of a class, Is it possible to create a prompt like this in OBIEE,
If possible , pls let me know how?
Thanks in Advance.

Yes, this is possible....Its all OBIEE game...make use of SQLs and Presentation variable and you are done.
Looks like you are putting up OBIEE interview questions here :)

Similar Messages

  • Using a Variable Prompt - In an analysis using Top N filter (URGENT)

    Hi Experts
    I have created a variable prompt that is setup in the following way :
    Prompt Name : Number_of_rows
    User Input : Radio Buttons
    Radio Button Values : *1/ 2* (Custom Values)
    Variable Data Type : Number
    Default Selection : *1* (Specific Custom Value)
    I have an analysis/ report that has the following columns Customer ID | Number of Orders
    I have applied a top N filter to this report using the varibale prompt :
    *Number of Orders  is in top  @{Number_of_rows}* (which is equivelent to Number of Orders is in top 1 or 2)
    However when I view the report im getting the following error
    View Display Error
    Error getting drill information: SELECT "Customer"."Customer ID" saw_0, "Sales Facts"."Number of Orders" saw_1 FROM "Sales" WHERE TOPN("Sales Facts"."Number of Orders",Number_of_rows) <= Number_of_rows
    Error Details
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Location: saw.views.evc.activate, saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool, saw.threadpool, saw.threads
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 27005] Unresolved column: "Number_of_rows". (HY000)
    SQL Issued: {call NQSGetLevelDrillability('SELECT "Customer"."Customer ID" saw_0, "Sales Facts"."Number of Orders" saw_1 FROM "Sales" WHERE TOPN("Sales Facts"."Number of Orders",Number_of_rows) <= Number_of_rows')}
    Please can you help
    Kind Regards
    Hiten
    Edited by: #:::HITEN:::# on 29-Nov-2012 04:24

    I'll put this as below
    My prompt will have the TopN which can be formated by TopN Orders and setting this as Presentation variable as N
    SELECT TOPN("#Sales",10) FROM "SA" order by Product
    In the report I'm using same column (Orders) with expression as below.
    TOPN("#Sales", cast(@{N}{2} as int))
    If this is not helpful for you then try to pass some default value for the Presentation variable

  • How to display horizontal line in top-of-page by using object oriented ALV?

    How to display horizontal line in top-of-page by using object oriented ALV.
    I am created top-of-page in object oriented alv.
    But not be successes in showing horizontal line in it.
    Can any one pls give solution for this..
    Thanks and regards..

    Hi
    Try like this
    data: gt_list_top_of_page type slis_t_listheader. " Top of page text. 
    Initialization. 
    perform comment_build using gt_list_top_of_page[]. 
    form top_of_page. 
    * Note to self: the gif must be loaded into transaction OAOR with 
    * classname 'PICTURES' AND TYPE 'OT' to work with ALV GRID Functions. 
    * I Loaded NOVALOGO2 into system. 
    call function 'REUSE_ALV_COMMENTARY_WRITE' 
         exporting 
    * I_LOGO = 'NOVALOGO2' 
    * i_logo = 'ENJOYSAP_LOGO' 
             it_list_commentary = gt_list_top_of_page. 
    endform. " TOP_OF_PAGE 
    form comment_build using e04_lt_top_of_page type slis_t_listheader. 
    data: ls_line type slis_listheader. 
          clear ls_line. 
          ls_line-typ = 'A'. 
          ls_line-info = 'Special'(001). 
          fgrant = xgrant. 
          concatenate ls_line-info fgrant 
          'Stock Option Report to the board'(002) 
                 into ls_line-info separated by space. 
                        condense ls_line-info. 
          append ls_line to e04_lt_top_of_page. 
    endform. " COMMENT_BUILD
    Use following syntex for footer print in alv:
    * For End of Page
    form END_OF_PAGE.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    *  For End of Report
    form END_OF_LIST.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    check this link
    http://abapprogramming.blogspot.com/
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5dc3e690-0201-0010-1ebf-b85b3bed962d
    Changing width of a custom container dynamically
    Display Page numbers in ALV
    Insert picture in selection screen.
    Logo in OO ALV Grid
    Reward all helpfull answers
    Regards
    Pavan

  • Creation of Disctribution Model view using Distribution using object classe

    Hi All ,
             Can anybody tell me how to create distribution model through  Distribution using object classes option in SALE transaction(Path : SALE - > Modelling and implementing Business processes - > master data Distribution - > Distribution using object classes).What is the difference between normal distribution model creation through BD64 and creating in the above way?
    Please help me its urgent.Thanks in advance.
    Regards,
    Rakesh.

    Hi All ,
             Can anybody tell me how to create distribution model through  Distribution using object classes option in SALE transaction(Path : SALE - > Modelling and implementing Business processes - > master data Distribution - > Distribution using object classes).What is the difference between normal distribution model creation through BD64 and creating in the above way?
    Please help me its urgent.Thanks in advance.
    Regards,
    Rakesh.

  • Sum in ALV grid display using objects

    Hi Experts,
    I have created a Report with ALV using objects and also am able to get SUM for some fields using do_sum = 'X'.
    My problem is i want to do some calculation using the total amount which i have got, how can i do that (or can it be done??).
    Thanks in Advance...
    Santosh

    Hi this may be of some help.
    ABAP List Viewer
    The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).
    This helps us to implement all the features mentioned very effectively.
    Using ALV, We can have three types of reports:
    1. Simple Report
    2. Block Report
    3. Hierarchical Sequential Report
    There are some function modules which will enable to produce the above reports without much effort.
    All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.
    1. SIMPLE REPORT.
    The important function modules are
    a. Reuse_alv_list_display
    b. Reuse_alv_fieldcatalog_merge
    c. Reuse_alv_events_get
    d. Reuse_alv_commentary_write
    e. Reuse_alv_grid_display
    A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
    The important parameters are :
    I. Export :
    i. I_callback_program : report id
    ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
    iii. I_callback_user_command : routine where the function codes are handled
    iv. I_structure name : name of the dictionary table
    v. Is_layout : structure to set the layout of the report
    vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
    vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
    II. Tables :
    i. t_outtab : internal table with the data to be output
    B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
    The Important Parameters are :
    I. Export :
    i. I_program_name : report id
    ii. I_internal_tabname : the internal output table
    iii. I_inclname : include or the report name where all the dynamic forms are handled.
    II Changing
    ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
    declared in the type pool SLIS.
    C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
    Parameters :
    I. Import :
    Et_Events : The event table is returned with all possible CALLBACK events
    for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
    II. Export :
    I_List_type :
    0 = simple list REUSE_ALV_LIST_DISPLAY
    1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
    2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
    3 = hierarchical-sequential block list
    REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
    Parameters :
    I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
    This internal table has three fields :
    Typ : ‘H’ – header, ‘S’ – selection , ‘A’ - action
    Key : only when typ is ‘S’.
    Info : the text to be printed
    E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
    Parameters : same as reuse_alv_list_display
    This is an example for simple list.
    2. BLOCK REPORT
    This is used to have multiple lists continuously.
    The important functions used in this report are:
    A. REUSE_ALV_BLOCK_LIST_INIT
    B. REUSE_ALV_BLOCK_LIST_APPEND
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    A. REUSE_ALV_BLOCK_LIST_INIT
    Parameters:
    I. I_CALLBACK_PROGRAM
    II. I_CALLBACK_PF_STATUS_SET
    III. I_CALLBACK_USER_COMMAND
    This function module is used to set the default gui status etc.
    B. REUSE_ALV_BLOCK_LIST_APPEND
    Parameters :
    Export :
    I. is_layout : layout settings for block
    II. it_fieldcat : field catalog
    III. i_tabname : internal table name with output data
    IV. it_events : internal table with all possible events
    Tables :
    i. t_outtab : internal table with output data.
    This function module adds the data to the block.
    Repeat this function for all the different blocks to be displayed one after the other.
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    This function module is used for hierarchical sequential blocks.
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    Parameters : All the parameters are optional.
    This function module display the list with data appended by the above function.
    Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
    3. Hierarchical reports :
    Hierarchical sequential list output.
    The function module is
    A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
    Parameters:
    I. Export:
    i. I_CALLBACK_PROGRAM
    ii. I_CALLBACK_PF_STATUS_SET
    iii. I_CALLBACK_USER_COMMAND
    iv. IS_LAYOUT
    v. IT_FIELDCAT
    vi. IT_EVENTS
    vii. i_tabname_header : Name of the internal table in the program containing the
    output data of the highest hierarchy level.
    viii. i_tabname_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    ix. is_keyinfo : This structure contains the header and item table field
    names which link the two tables (shared key).
    II. Tables
    i. t_outtab_header : Header table with data to be output
    ii. t_outtab_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using ‘REUSE_ALV_FIELDCATALOG_MERGE’.
    Important Attributes :
    A. col_pos : position of the column
    B. fieldname : internal fieldname
    C. tabname : internal table name
    D. ref_fieldname : fieldname (dictionary)
    E. ref_tabname : table (dictionary)
    F. key(1) : column with key-color
    G. icon(1) : icon
    H. symbol(1) : symbol
    I. checkbox(1) : checkbox
    J. just(1) : (R)ight (L)eft (C)ent.
    K. do_sum(1) : sum up
    L. no_out(1) : (O)blig.(X)no out
    M. outputlen : output length
    N. seltext_l : long key word
    O. seltext_m : middle key word
    P. seltext_s : short key word
    Q. reptext_ddic : heading (ddic)
    R. ddictxt(1) : (S)hort (M)iddle (L)ong
    S. datatype : datatype
    T. hotspot(1) : hotspot
    with regards,
    Hema Sundara.
    pls reward if u find it helpful.

  • Set cursor alv grid (not using objects)

    I got a question on ALV GRID (not using objects), please let me know if you have pointers. Thanks.
    Output has 2 screens both has different contents. The output is generated using internal table1 and 2 and using FM  'REUSE_ALV_GRID_DISPLAY_LVC'  (both screen use same FM).
    First screen has multiple pages of output (say 10 pages). User scrolled page 5 and line 10 of first screen and then double clicked it takes to screen #2. After completion of screen #2, the back arrow should get back to page 5 and line 10 of screen #1. Currently the back arrow gets to screen#1 page 1 and line 1. How to remember the cursor position in alv grid and instruct the cursor to go there?
    Appreciate the input.
    Note: I tried "set cursor line n" with "Scroll" command but no luck. http://help.sap.com/saphelp_nw70/helpdata/EN/9f/dba47e35c111d1829f0000e829fbfe/content.htm

    Thanks for the inputs.
    FYI, I got it implemented using method  CALL METHOD <ref.var. to CL_GUI_ALV_GRID > ->set_current_cell_via_id
    The method is called by 'REUSE_ALV_GRID_DISPLAY_LVC' form 'PF_STATUS_SET' when the ALV grid output is presented each time.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_bypassing_buffer       = 'X'
          i_callback_program       = gc_repid
          i_callback_pf_status_set = 'PF_STATUS_SET'
          i_callback_user_command  = 'USER_COMMAND'
          is_layout_lvc            = lwa_layout
          it_fieldcat_lvc          = git_fc_lvc
          i_default                = ' '
        TABLES
          t_outtab                 = git_data
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      FORM alv_event_pf_status_set USING rt_extab                
                                 TYPE slis_t_extab.
      DATA lo_ref1 TYPE REF TO cl_gui_alv_grid.
    *Get the reference to class "lo_ref1" for the ALV report
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = lo_ref1.
    *set the focus of cursor in ALV
      CALL METHOD lo_ref1->set_current_cell_via_id
        EXPORTING
          is_row_no = gv_row. "row number where you want to focus the cursor
      ENDFORM.

  • Downloading ALV Grid (using objects) output to Excel

    Hi all,
    I'm using objects for ALV Grid. I have few other fields (few are above and few are below the custom control) on screen other than custom control. I want to download the entire screen to excel (including other fields). But using Export option I'm able to download only ALV Grid. I did tried with Excel in place option which is not pulling data from ALV Grid control.
    Please suggest me the solution.
    Regards
    Jaker.

    hi
    use this code in ALV format
    TABLES USR03.
    DATA: BEGIN OF ISAPDAT OCCURS 0,
              BNAME LIKE USR03-BNAME,
              NAME1 LIKE USR03-NAME1,
              NAME2 LIKE USR03-NAME2,
          END OF ISAPDAT.
    PARAMETERS P_FNAME LIKE RLGRAP-FILENAME
                        DEFAULT 'd:\sapdata.xls' OBLIGATORY.
    SELECT * FROM USR03 INTO CORRESPONDING FIELDS OF TABLE ISAPDAT.
    SORT ISAPDAT.
    CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
         EXPORTING
              I_FILENAME        = P_FNAME
         TABLES
              I_TAB_SAP_DATA    = ISAPDAT
         EXCEPTIONS
              CONVERSION_FAILED = 1
              OTHERS            = 2.
    IF SY-SUBRC EQ 0.
      WRITE:/ 'Download to Excel complete'.
    ELSE.
      WRITE:/ 'Error with download'.
    ENDIF.
    Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:34 PM

  • How to use objects as a message type in WSDL?

    How can I use object as a type for the message in WSDL?
    For example, I want to achieve something like this:
    <message name="DBConnection">
    <part name="conn" type="???"/>
    </message>
    In the above example, for any operation getConnection(), the return type would be an object of the type Connection.
    Any suggestions ?
    Thanks,
    Dhaval

    Hi,
    Listed below is the step by step intructions to configure the Nokia device as a modem to a mac.
    Steps:
    Connecting your Mac to the internet is convenient and easy with your a compatible Nokia S60 device. You'll need a Nokia S60 device that supports a 2G or 3G data connection (such as GPRS or HSDPA), a compatible Mac (with the latest OS X), a USB cable for your Nokia device or a Bluetooth-enabled Mac, and a network subscription with your mobile service provider.
    To set up your device you'll need to know your operator's Access Point Name (APN) and have the packet data service enabled. For help with this please contact your operator.
    In Settings select and open Connection >Select and open Packet data > Select and open Access point >Type in your operator's Access Point Name
    Exit Settings. Your device is now ready to be used as a modem for your Mac!
    Bluetooth Connection: Pairing between Mac and Device using bluetooth, follow the instruction from here: http://europe.nokia.com/get-support-and-software/download-software/device-as-a-modem/connect-to-your...
    Note: Preferred mode is USB as it much faster than Bluetooth.
    Connect the device and then go to System preferences- >Network- >Select Device (Nokia XXX)
    Click on Advanced Tab > Modem tab
    - Vendor : Nokia
    -Model:GPRS (GSM/3G)
    -Telephone Number: *99***1# (contact your operator to get this settings)
    -APN: airtelgprs.com (contact your operator to get this settings)
    CID: 1
    Once connected it will be highlighted in green.
    Hopefully this helps.
    Cheers
    Sandy
    Message Edited by sandy2410 on 30-Mar-2009 04:52 AM
    Helpful information, then dont forget to hit the kudos star :-) Or say it accepted solution and thanks

  • How to embed jnlp file into html page using object tag

    hi everyone,
    i have written one jnlp file like this.
    <?xml version="1.0" encoding="utf-8" ?>
    <!-- JNLP file for Demo applicaion -->
    <jnlp spec="1.0+" codebase="http://localhost:9080/base/" href="SampleExample.jnlp">
         <information>
              <title>Demo Application</title>
              <vendor> </vendor>
              <description>Sample Demo Application</description>
              <offline-allowed/>
         </information>
         <security/>
         <resources>
              <j2se version="1.3+" />
              <jar href="common.jar" main="true" download="eager" />
              <jar href="classes12.jar" download="eager" />
              <jar href="toplink.jar" download="eager"/>
              <package name="com.applet.*" part="applet" recursive="true"/>
         </resources>
         <applet-desc name="grid" main-class="com.applet.PriceGrid" width="1000" height="300"/>
    </jnlp>
    i am trying embed that jnlp file using object tag like
    <OBJECT
    classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH="1000" HEIGHT="300" NAME="grid">     
    <PARAM NAME="jnlp" VALUE="http://localhost:9080/base/SampleExample.jnlp">
    </OBJECT>
    but i am not able to load the applet using Web Start.
    Can anyone please help me. This is very Urgent for me.
    Thanks & Regards,
    Shiva.

    thanks.
    i am giving my problem clearly. i have one applet. Previously i am loading the applet in my html page using object tag like this...
    <OBJECT
    classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH="1000" HEIGHT="300" NAME="grid">
    <PARAM NAME="CODE" VALUE="com.adp.base.applet.PriceGrid.class" >
         <PARAM NAME="ARCHIVE" VALUE="common.jar,classes12.jar,toplink.jar" >
         <PARAM NAME="NAME" VALUE="grid" >
    <PARAM NAME="type" VALUE="application/x-java-applet">
    <PARAM NAME= "cache_option" VALUE ="no">
    </OBJECT>
    now what i need to do is
    i need load the applet only first time using web start and when ever the applet code changes in the server i need to reload the applet.
    for that i kept all the applet resources in .jnlp file.i want to cache all the resources which are in .jnlp file and applet must be displayed within a web page within a browser.
    Webstart always open a new application windows.
    I need to run an Applet embedded within a web page within a browser.
    Is there a way to still use Webstart?

  • File I/O Using Object Streams

    My program is supposed to be a Driving instructor program that allows someone to enter a Name and Lesson Number, and it will pull up the Date, and Comments that the lesson took place. The information is saved in a file with the person's name, and saved as an array. We are required to use Object Streams for the file i/o. The only part of the program that I don't have working is the actual file i/o. The large commented section that I have in the datamanager class is the notes from the professor on the board and I haven't removed them yet. There are 4 classes for this file.
    The main class that creates the program and calls the other classes.
    import java.awt.*;
    import javax.swing.*;
    public class main {
    /** Creates a new instance of main */
    public main() {
    * @param args the command line arguments
    public static void main(String[] args)
    guiLayout labelFrame = new guiLayout(); // creates LabelFrame
    labelFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE);
    labelFrame.setSize(600, 200);
    labelFrame.setVisible(true);
    } The second class is the GUI class and event handler class.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class guiLayout extends JFrame{
        private JPanel centertop;
        private JPanel centermiddle;
        private JPanel centerbottom;
        private JLabel dateLabel;
        private JLabel nameLabel;
        private JLabel lessonLabel;
        private JLabel commentsLabel;
        private JTextArea DateTextArea;
        private JTextArea NameTextArea;
        private JTextArea LessonTextArea;
        private JTextArea CommentsTextArea;
        private JButton Save;
        private JButton Retrieve;
        private String tempDay[];
        private DataManager DMO;
        /** Creates a new instance of guiLayout */
        public guiLayout()
            super("Drive Application");
            setLayout(new FlowLayout());
            dateLabel = new JLabel("Date (mm/dd/yy)");
            nameLabel = new JLabel("Name");
            lessonLabel = new JLabel("Lesson (1-10)");
            commentsLabel = new JLabel("Comments");
            DateTextArea = new JTextArea(1, 7);
            NameTextArea = new JTextArea(1, 15);
            LessonTextArea = new JTextArea(1, 2);
            CommentsTextArea = new JTextArea(6, 30);
            Save = new JButton( "Save");
            Retrieve = new JButton( "Retrieve");
            //insert into GUI
            //TOP
            centertop = new JPanel();
            centertop.add(nameLabel);
            centertop.add(NameTextArea);
            centertop.add(lessonLabel);
            centertop.add(LessonTextArea);
            centertop.add(dateLabel);
            centertop.add(DateTextArea);
            centertop.setLayout(new GridLayout(6,1));
            add(centertop, BorderLayout.NORTH);
            centermiddle = new JPanel();
            centermiddle.setLayout(new GridLayout(1,1));
            centermiddle.add(CommentsTextArea);
            add(centermiddle, BorderLayout.CENTER);
            centerbottom = new JPanel();
            centerbottom.setLayout(new GridLayout(1,3));
            centerbottom.add (Save);
            centerbottom.add(Retrieve);
            add(centerbottom, BorderLayout.SOUTH);
            ButtonHandler handler = new ButtonHandler();
            Save.addActionListener( handler);
            Retrieve.addActionListener(handler);
        private class ButtonHandler implements ActionListener
            public void actionPerformed(ActionEvent event)
                String Namein = NameTextArea.getText();
                String Datein = DateTextArea.getText();
                String Commentsin = CommentsTextArea.getText();
                int Lessonin = Integer.parseInt(LessonTextArea.getText());
                if(event.getSource()==Save)
                   DMO.Save(Namein, Datein, Commentsin, Lessonin);
                if(event.getSource()==Retrieve)
                    if(Lessonin >= 1 && Lessonin <= 10)
                       LessonRecord r = (DMO.Retrieve(Namein, Lessonin));
                    else
                        String errormess = "Lesson Number must be between 1 and 10!";
                        CommentsTextArea.setText(errormess);
    }The third class is the DataManager class which handles the actual file i/o.
    import java.io.*;
    import java.util.*;
    public class DataManager implements Serializable
        //private String Path = "P:\\D00766703\\CET431\\Assign5";
        private String Path = "C:\\Java";
        FileInputStream fin;
        FileOutputStream fout;
        ObjectInputStream oin;
        ObjectOutputStream oout;
        public String Retrieve(String name, int lesson)
            String itemFile = Path + name + ".ser";
            File f = new File(itemFile);
            if (f.exists() == true)
                try
                    if(fin == null)
                        fin = new FileInputStream(itemFile);
                        oin = new ObjectInputStream(fin);
                    LessonRecord r[] = oin.readObject();
                    if(fin.available() == 0)
                        oout.close();
                        fout.close();
                        return r[lesson - 1];
                catch(IOException ioe)
                    System.out.print(ioe);
            else
                LessonRecord LR = new LessonRecord();
                LR.date = " ";
                LR.comment = "File Not Found";
                return LR;
        /*create file object for Path\\Name
         *if file exists
         *  create fileinputstream
         *  create objectinputstream - oin
         *  read array of lesson records
         *  LessonRecord |r[] = oin.readObject();    need cast to array here
         *  close object input stream and file input stream
         *  return |r[lesson - 1];
         *else file does NOT EXIST
         *  LessonRecord LR = new LessonRecord();
         *  LR.date = " ";
         *  LR.comment = error message;
         *  return LR;
        public void Save(String name, String date, String comment, int lesson)
            String itemFile = Path + name + ".ser";
            File f = new File(itemFile);
            LessonRecord |r[];
            if (f.exists() == true)
                try
                    fin = new FileInputStream(itemFile);
                    oin = new ObjectInputStream(fin);
                    LessonRecord r[] = oin.readObject();
                catch(IOException ioe)
                    System.out.print(ioe);
            else
                r = new LessonRecord[10];
            r[lesson - 1] = new LessonRecord(date, comment);
            fout = new FileOutputStream(itemFile, true);
            oout = new ObjectOutputStream(fout);
            oout.write(r);
            oout.close();
            fout.close();
        /*create file object for Path\\Name
         *LessonRecord |r[];
         *if file exists
         *  create fileinputstream
         *  create objectinputstream - oin
         *  read array of lesson records
         *  LessonRecord |r[] = oin.readObject();    need cast to array here
         *  close object input stream and file input stream
         *else
         *  |r = new LessonRecord[10];
         *|r[lesson - 1] = new LessonRecord(date, comment);
         *createfileoutputstream(BaseDir\\Name);
         *createobjectoutputstream - oout
         *oout.write(|r);
         *closeobjectstream
         *closefilestream
    }And the fourth class is the LessonRecord class which is serializable and has the date and comments variables.
    import java.io.Serializable;
    public class LessonRecord implements Serializable
        public String Date;
        public String Comment;
        /** Creates a new instance of LessonRecord */
        public LessonRecord()
            Date = "";
            Comment = "";
        public LessonRecord(String Datein, String Commentin)
            Date = Datein;
            Comment = Commentin;
    }I could have sworn that the professor said to make it |r for the account records variable names, but I always get errors when I do that, and I need to know how to cast to an array too.

    hi Friend,
    I have made some modification to your code. and try this...I think it will help you...
    /*guiLayout.java*/
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class guiLayout extends JFrame{
        private JPanel centertop;
        private JPanel centermiddle;
        private JPanel centerbottom;
        private JLabel dateLabel;
        private JLabel nameLabel;
        private JLabel lessonLabel;
        private JLabel commentsLabel;
        private JTextArea DateTextArea;
        private JTextArea NameTextArea;
        private JTextArea LessonTextArea;
        private JTextArea CommentsTextArea;
        private JButton Save;
        private JButton Retrieve;
        private String tempDay[];
        private DataManager DMO;
        /** Creates a new instance of guiLayout */
        public guiLayout()
            super("Drive Application");
            DMO=new DataManager();
            setLayout(new FlowLayout());
            dateLabel = new JLabel("Date (mm/dd/yy)");
            nameLabel = new JLabel("Name");
            lessonLabel = new JLabel("Lesson (1-10)");
            commentsLabel = new JLabel("Comments");
            DateTextArea = new JTextArea(1, 7);
            NameTextArea = new JTextArea(1, 15);
            LessonTextArea = new JTextArea(1, 2);
            CommentsTextArea = new JTextArea(6, 30);
            Save = new JButton( "Save");
            Retrieve = new JButton( "Retrieve");
            //insert into GUI
            //TOP
            centertop = new JPanel();
            centertop.add(nameLabel);
            centertop.add(NameTextArea);
            centertop.add(lessonLabel);
            centertop.add(LessonTextArea);
            centertop.add(dateLabel);
            centertop.add(DateTextArea);
            centertop.setLayout(new GridLayout(6,1));
            add(centertop, BorderLayout.NORTH);
            centermiddle = new JPanel();
            centermiddle.setLayout(new GridLayout(1,1));
            centermiddle.add(CommentsTextArea);
            add(centermiddle, BorderLayout.CENTER);
            centerbottom = new JPanel();
            centerbottom.setLayout(new GridLayout(1,3));
            centerbottom.add (Save);
            centerbottom.add(Retrieve);
            add(centerbottom, BorderLayout.SOUTH);
            ButtonHandler handler = new ButtonHandler();
            Save.addActionListener( handler);
            Retrieve.addActionListener(handler);
        private class ButtonHandler implements ActionListener
            public void actionPerformed(ActionEvent event)
                String Namein = NameTextArea.getText();
                int Lessonin = Integer.parseInt(LessonTextArea.getText());
                if(event.getSource()==Save)
                    String Datein = DateTextArea.getText();
                     String Commentsin = CommentsTextArea.getText();
                   DMO.Save(Namein, Datein, Commentsin, Lessonin);
                if(event.getSource()==Retrieve)
                    if(Lessonin >= 1 && Lessonin <= 10)
                       LessonRecord r = (DMO.Retrieve(Namein, Lessonin));
                       System.out.println("Retrieve:"+ r.Comment+":"+r.Date);
                    else
                        String errormess = "Lesson Number must be between 1 and 10!";
                        CommentsTextArea.setText(errormess);
    /*DataManager.java*/
    import java.io.*;
    import java.util.*;
    public class DataManager implements Serializable
        //private String Path = "P:\\D00766703\\CET431\\Assign5";
        private String Path = "C:/Java";
        FileInputStream fin;
        FileOutputStream fout;
        ObjectInputStream oin;
        ObjectOutputStream oout;
        public LessonRecord Retrieve(String name, int lesson)
            String itemFile = Path + name + ".ser";
            File f = new File(itemFile);
            LessonRecord[] r=null;
            if (f.exists() == true)
                try
                    if(fin == null)
                        fin = new FileInputStream(itemFile);
                        oin = new ObjectInputStream(fin);
                    r= (LessonRecord[])oin.readObject();
                    System.out.println(r[lesson-1].Comment+":"+r[lesson-1].Date);
                catch(IOException ioe)
                    System.out.print(ioe);
                  catch(ClassNotFoundException c){
                    c.printStackTrace();
                finally
                    try {
                        if(fin!=null)fin.close();
                        if(oin!=null)oin.close();
                    } catch (IOException ex) {
                        ex.printStackTrace();
            else
                LessonRecord LR = new LessonRecord();
                LR.Date = " ";
                LR.Comment = "File Not Found";
                return LR;
        /*create file object for Path\\Name
         *if file exists
         *  create fileinputstream
         *  create objectinputstream - oin
         *  read array of lesson records
         *  LessonRecord |r[] = oin.readObject();    need cast to array here
         *  close object input stream and file input stream
         *  return |r[lesson - 1];
         *else file does NOT EXIST
         *  LessonRecord LR = new LessonRecord();
         *  LR.date = " ";
         *  LR.comment = error message;
         *  return LR;
      return r[lesson - 1];
        public void Save(String name, String date, String comment, int lesson)
            String itemFile = Path + name + ".ser";
            File f = new File(itemFile);
            LessonRecord r[]=new LessonRecord[10];
            if (f.exists() == true)
                try
                    fin = new FileInputStream(itemFile);
                    oin = new ObjectInputStream(fin);
                     r = (LessonRecord[])oin.readObject();
                catch(IOException ioe)
                    System.out.print(ioe);
                catch(ClassNotFoundException c){
                    c.printStackTrace();
                finally
                    try {
                        if(fin!=null)fin.close();
                        if(oin!=null)oin.close();
                    } catch (IOException ex) {
                        ex.printStackTrace();
            else
                r = new LessonRecord[10];
       try
            r[lesson - 1] = new LessonRecord(date, comment);
            fout = new FileOutputStream(itemFile);
            oout = new ObjectOutputStream(fout);
            oout.writeObject(r);
            oout.flush();
       catch(IOException ioe)
            finally
                try {
                    if(fout!=null)fout.close();
                    if(oout!=null)oout.close();
                } catch (IOException ex) {
                    ex.printStackTrace();
        /*create file object for Path\\Name
         *LessonRecord |r[];
         *if file exists
         *  create fileinputstream
         *  create objectinputstream - oin
         *  read array of lesson records
         *  LessonRecord |r[] = oin.readObject();    need cast to array here
         *  close object input stream and file input stream
         *else
         *  |r = new LessonRecord[10];
         *|r[lesson - 1] = new LessonRecord(date, comment);
         *createfileoutputstream(BaseDir\\Name);
         *createobjectoutputstream - oout
         *oout.write(|r);
         *closeobjectstream
         *closefilestream
    }main.java and LessonRecord.java does not have any changes so you use the old code....
    Thanks
    Edited by: rajaram on Sep 28, 2007 1:24 PM

  • Is there any procedure to get the memory warning levels using objective C

    I want know the different levels of memory warnings programmatically using objective C.Is there any procedure to get that.

    AmirTs wrote:
    my device connects to my server and need to authenticate with a unique number
    and i need access to the number to add it in the server.

  • How to capture index/row no of row in table using object oriented alv.

    i have a table with many fields. i have an alv grid table displayed using object oriented alv. when i double click on a record, i call another screen. there i want to display the record number. eg, if i doubleclick on the third row, i will go to next screen and display 3 there.
    please let me know how it is done as it is urgent.
    thanks in advance.

    Hi,
    Use the following code to get rowno.
    CLASS lcl_grid_events DEFINITION DEFERRED.
    DATA:
      grid1_events      TYPE REF TO lcl_grid_events.
    CLASS lcl_grid_events DEFINITION.
      PUBLIC SECTION.
        METHODS:
          dbclk
           FOR EVENT double_click  OF cl_gui_alv_grid
           IMPORTING e_row
                     e_column
                     es_row_no.
    ENDCLASS.                    "lcl_grid_events DEFINITION
    CLASS lcl_grid_events IMPLEMENTATION.
      METHOD dbclk.
    *access e_row variable, which contains the record no.
      ENDMETHOD.                    "dbclk
    ENDCLASS.                    "lcl_grid
    write the following code after method call of set_table_for_first_display
        CREATE OBJECT grid1_events.
        SET HANDLER grid1_events->dbclk
                    FOR grid1.
    reward point if useful.

  • I have "CC" now but when I use CS6 it prompts me for my serial #, why?

    I have "CC" now but when I use CS6 it prompts me for my serial #, why?

    Ask for serial number http://forums.adobe.com/thread/1234635 has a FAQ link
    or
    Online Chat Now button near the bottom for Activation and Deactivation problems may help
    http://helpx.adobe.com/x-productkb/policy-pricing/activation-deactivation-products.html

  • Approval Status using Object ID

    Hi Experts,
    I am creating a Backend Report which gives the SC Status. I have Shopping Cart number, Based on the SC# how can I find the status like who approved or with whom the SC is waiting for approval. I dont have Work Item ID here.
    Pls let me know which table / FM I can use to get the above status using Object ID( SC# ).
    Thanks in Advance.
    Rupachandran G

    Hi,
       Please refer the link..
    How to Get WorkItem ID
    Saravanan

Maybe you are looking for

  • Catch event when Application Server is shutdown

    Hi All, Actually I want to catch an event do something when weblogic server is shutdown. How can I catch the event. Any help would be highly appreciated. I tried by implementing ServletContextListener interface, but in that I can only catch the event

  • How To Debug Adobe Form in Production ?

    Hi gurus,             Could anybody please help to debug a adobe form in production system. what is the procedure to debug in production. Thanks & Regards, Suman Kumar

  • Suitable Prog For Printing VHS and DVD Case Covers

    I'm trying to do with Tiger in my MacPro what i'm used to doing in OS9.2.2 and OSX.3.9 which is produce DVD and VHS case covers with printed material usually frame grabbed from relevant films in FCP then titled up to finish off the product. The cover

  • My iTunes does not recognize my iPod all of a sudden

    Hello, My iTunes does not recognize my iPod all of a sudden.  Today before I went running I downloaded some new podcasts to listen to.  I plugged in my iPod and for some reason iTunes could not recognize my iPod nano.  I run iTunes on Windows 8.1 on

  • With Lion, should I now switch to JAVA SE 7.0?

    JAVA 7.0 was just released. Should we wait for Apple to revise the JAVA update pointer to point at JAVA 7; I.e., after Apple has tested it and blessed it? Should we use JAVA 7.0 at this time?