CachedRowSet displaying 5 records at a time

hi all,
Iam working on CachedRowSet is it possible to records in groups of 5 from a whole lot of 100 records?? pls let me know...
thanks in advance
Karthik

<Statement>.setMaxRows(5);

Similar Messages

  • Displaying some records at a time

    does anyone know how to display only 10 records at one time from the database followed by the next button to display next 10 etc?

    can anyone check this:
    what does this mean?
    String sql_2=request.getParameter("sql_2");
    anything missing?
    <%@ page language="Java" import = "java.sql.*" %>
    <jsp:useBean id="myBean" scope ="session" class="bean.DataConnectionBean" />
    <html>
    <body bgcolor="#CCFFFF">
    <%
    String sql; //SQL string
    int rowPerPage=10; //Record size of one page
    int rowTotal; //Total records
    int pageTotal; //Total pages
    int pageIndex; //Pages waiting for display, from 1
    pageIndex = Integer.parseInt( request.getParameter("page") );
    rowTotal=Integer.parseInt( request.getParameter("rowTotal") );
    String sql_2=request.getParameter("sql_2");
    String sql_1= "select " +
    "vin, " +
    "ga_no, " +
    "ga_build_date, " +
    "deliver_date, " +
    "model, " +
    "year_code, " +
    "engine_no, " +
    "initial_mileage " +
    "from vehiclemaster " +
    "where ";
    sql=sql_1+sql_2;
    myBean.connect();
    ResultSet rs=myBean.executeQuery(sql);
    pageTotal = (rowTotal+rowPerPage-1) / rowPerPage; // Get total pages
    if(pageIndex>pageTotal) pageIndex = pageTotal;
    %>
    <table border="0" cellpadding="2" cellspacing="0">
    <tr>
    <td align="left">
    <div align="left">Total <%=rowTotal%> Records</div>
    </td>
    </tr>
    </table>
    <table border="0" width="844">
    <tr bgcolor="#669966">
    <th>VIN</th>
    <th>GA#</th>
    <th>build date</th>
    <th>deliver date</th>
    <th>model</th>
    <th>model year code</th>
    <th>engine#</th>
    <th>initial mileage</th>
    </tr>
    <%
    int absolute=(pageIndex-1) * rowPerPage;
    for(int k=0; k<absolute; k++) rs.next();
    int i = 0;
    String LineColor;
    while( rs.next() && i<rowPerPage && (absolute+i)<rowTotal ){
    String col1=( ( ( col1=rs.getString(1) ) == null || rs.wasNull() ) ? "" : col1 );
    String col2=( ( ( col2=rs.getString(2) ) == null || rs.wasNull() ) ? "" : col2 );
    String col3=( ( ( col3=rs.getString(3) ) == null || rs.wasNull() ) ? "" : col3 );
    String col4=( ( ( col4=rs.getString(4) ) == null || rs.wasNull() ) ? "" : col4 );
    String col5=( ( ( col5=rs.getString(5) ) == null || rs.wasNull() ) ? "" : col5 );
    String col6=( ( ( col6=rs.getString(6) ) == null || rs.wasNull() ) ? "" : col6 );
    String col7=( ( ( col7=rs.getString(7) ) == null || rs.wasNull() ) ? "" : col7 );
    String col8=( ( ( col8=rs.getString(8) ) == null || rs.wasNull() ) ? "" : col8 );
    if (i % 2 == 0) LineColor="#DBECFD";
    else LineColor="#C6E1FD";
    %>
    <TR bgcolor="<%= LineColor %>">
    <TD><%=col1%></TD>
    <TD><%=col2%></TD>
    <TD><%=col3%></TD>
    <TD><%=col4%></TD>
    <TD><%=col5%></TD>
    <TD><%=col6%></TD>
    <TD><%=col7%></TD>
    <TD><%=col8%></TD>
    </TR>
    <%i++;
    }%>
    </table>
    <div align="center">
    <table border="0" align="left">
    <tr>
    <td align="left">
    <div align="left">Page <%=pageIndex%> / <%=pageTotal%> 
    <%if(pageIndex<pageTotal){%>
    <a href="QueryVehicleResult.jsp?sql_2=<%=sql_2%>&rowTotal=<%=rowTotal %>&page=<%=pageIndex+1%>"><img src="images/next.gif" border="0">
    </a>
    <%}%>
    <%if(pageIndex>1){%>
    <a href="QueryVehicleResult.jsp?sql_2=<%=sql_2%>&rowTotal=<%=rowTotal %>&page=<%=pageIndex-1%>"><img src="images/prev.gif" border="0">
    </a>
    <%}%>
    </div>
    </td>
    </tr>
    </table>
    </div>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </body>
    </html>
    <%
    rs.close();
    myBean.close();
    %>

  • How can one display 1 record at a time

    How can one display a single record at a time.
    The next record should be displayed on the press of a button.
    Thanks in advance

    Vijaya,
    I have 3 regions, each contains a check box item,
    the label for which is dynamicaly generated through a SQL Select.
    ( &P1_ANSWER1. P1_ANSWER1 is the hidden item name)
    In the Region Source,
    I have put
    SELECT col1 from (SELECT col1, row_number() over(ORDER BY col1) row_number from prototype) WHERE row_number = :P1_QUESTION_NO;
    SELECT col3 from (SELECT col3, row_number() over(ORDER BY col3) row_number from prototype) WHERE row_number = :P1_QUESTION_NO;
    for each of the reqion that contains these items,
    Here the table is prototype and P1_QUESTION_NO is the hidden item.
    As directed I have included under Processes (after submit and computations) on button "Next Record" clicked:
    :P1_QUESTION_NO := ::P1_QUESTION_NO + 1;
    When I am doing this, the label seems to blank out.
    Thanks
    Message was edited by:
    faq123

  • Display saying record all the time

    Hi guys.
    I reported on here about 4 months ago that the display always says it recording all the time. I was told on here that the problem has been noted and would be fixed in a upcoming update, but it hadn't ?
    Anyone know when this is being fixed?

    Hi Markshim
    Are you still experiencing this issue?
    If so send us an email using the contact the mods link in my profile we can try to get more information on updates for you.
    Thanks
    Stuart
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • Need to display/update last date/time of an accessed record

    Hi All,
    I'm using ADF BC and I have a use case where I need to display the last date/time when a user access a record in a view. I have a user table that I access thru a view object where I can store the date/time of the fetched record. A viewLink from that view object gives me the detail information in that record.
    I generated a ViewRowImpl class and added this to the method that get the time and date (DtHeureDernAcces is a private variable in defined in the class):
    /**Gets the attribute value for the calculated attribute DtHreDernAcces
    public Date getDtHreDernAcces()
    if (DtHeureDernAcc==null)
    DtHeureDernAcc=(Date) getAttributeInternal(DTHREDERNACCES);
    setDtHreDernAcces(new Date(new java.sql.Timestamp(System.currentTimeMillis())));
    getApplicationModule().getTransaction().commit();
    return DtHeureDernAcc;
    This works fine until the user refresh the page, in this case the ViewObjImpl is recreated and DtHeureDernAcc is then null. So the date/time is updated after each refresh.
    How can I get around this problem ?

    The complication here is that &P7_DATE_SHIPPED. and &P7_DATE_ORDERED. are session-state variables - they don't actually get updated until the page submit completes, which is happening AFTER the dynamic action.
    JavaScript might provide an alternative method that will pick up the current values of those fields. You might try something like:
    HTML Header
    <script language="JavaScript" type="text/javascript">
    function check_hours(pThis){
      var v_shipdt = $v("P7_DATE_SHIPPED");
      var v_ordrdt = $v("P7_DATE_ORDERED");
      if(v_shipdt > v_ordrdt){
        alert("Shipping Date is before Order Date!");
      return true;
    </script>Put this in the HTML Form Elements Attributes of your page item:
    onchange="check_hours(this)"This is just pseudocode, but it may help get you started. Dates in JavaScript are a little tricky to deal with.

  • Displaying one record at a time

    Is any body able to help me? I need to display one record at a time from a Select statement.
    Could I copy the results of the Select query from a table into an array for later display or is there a better alternative.
    Please, any part knowledge with regard to the above would be usefull.
    Regards
    Eddie

    What application do you want to use to display the data?
    You can use "rownum" in your SQL statement to ensure that you only get record N of a query. Asktom has a good article on this sort of windowing
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:127412348064
    More commonly, however, you'll write a SQL query that returns all the rows, fetch a small number, display those to the user, and then fetch more records.
    Justin

  • Master_detail for more than one record at a time

    Hi,
    How can i display master_detail records for more than one records at a time, for example, i have two tables A and B , A has username and role and B has username and profile. here i wanted to display 10 users at a time on my 6i form with username, role and profile.
    i have created a master-detail relation ship with these tables when i'm executing F8 on blcok A , it displays 10 records on BlockA but, only one at a time on block B, how can i display all corresponding records on block B at a time.
    Thanks for your help.Bcj

    Thanks Roberts, that was realy informative due to some doubts i would like to confirm my requirements , i have two blocks A and B and each master record has only one detail record. but i wanted to display at least 10 master_detail relationships(records) on the form at a time, i would like to know is it possible to do without creating any table or view for example,
    data in table A,
    username role
    AAA R1
    BBB R2
    CCC R3
    data in table B,
    username profile
    AAA P1
    BBB P2
    CCC P3
    i wanted to display it on form like below,
    username role profile
    AAA R1 P1
    BBB R2 P2
    CCC R3 P3
    Also would like to know that how can i select data from dba_users, any restriction is there on forms 6i, i can select it on sqlplus.
    Thanks Again, Bcj

  • How can I display records dynamically in forms?

    Hi Friends,
    I want to display the number of records in the form dynamically. Suppose the back-end table is having only 5 records means it should display 5 records. If any new records is inserted later then it should show 6 records. It should display 10 records at a time with a scroll bar in case if a table is having more records.
    The best example is Data Grid in VB. The same kind of mechanism I want to provide in my form. How can I do that?
    Any suggestion would be greatly appreciated.
    Thank You.
    Gopinath Kona
    null

    Why not have number or records displayed as the number that best fits the space and then if less come back the scrollbar is disabled, and if more come back the scrollbar is enabled?

  • How can I display records quickly in order, using set_block_property

    Hi all,
    I want to display records in order when I click on button corresponding to that filed.I'm getting result by using set_block_property..but it is displaying records slowly,if number of records are more then it's taking more time to sort the records.
    I have written the following code in when-button-pressed trigger:
    begin
    if get_block_property('block_name',default_where) = 'column_name ASC' then
    set_block_property('block_name', default_where,'column_name DESC');
    else
    set_block_property('block_name',default_where, 'column_name ASC');
    end if;
    end;
    How can I get the result quickly can anyone please give me an idea to solve this.
    Thanks in advance.

    Hi user;
    I want to display records in order when I click on button corresponding to that filed.I'm getting result by using set_block_property..but it is displaying records slowly,if number of records are more then it's taking more time to sort the records.
    I have written the following code in when-button-pressed trigger:
    begin
    if get_block_property('block_name',default_where) = 'column_name ASC' then
    set_block_property('block_name', default_where,'column_name DESC');
    else
    set_block_property('block_name',default_where, 'column_name ASC');
    end if;
    end;
    How can I get the result quickly can anyone please give me an idea to solve this.Did you try to use index for related column? Also did you try to use order_by instead of default_where
    If its not help, I also suggest post your issue on :Forum Home » Developer Tools » Forms
    Hope it helps
    Regard
    Helios

  • Challenge involving creating a file on GUI & seeing one record at a time...

    Hi,
    If anyone can help me with this project I'd be most appreciative. I'll try and explain the problem the best I can. I'm adding students to a database at a university they're either a Graduate or an Undergraduate. I'm taking in first, lastname's, ssn, & ACT/SAT/GMAT test results. I have a GUI called StudentRecord that has all the JTextFields, JButton's, etc. I'm also writing it to a .txt file called StudentDA. For this I used a BufferedFile reader.
    What I really need is on my StudentRecord when I click the display button I want it to show one record at a time in another JFrame. This other JFrame I named it display. I'm trying to create an instance of JFrame inside of the actionPerformed for StudentRecord but when I click display nothing happens.
    I adding the students with a vector that I'm calling v. I want the Display to read from the .txt file and display one at a time hence next, and previous. I'm going to post the tidbit of relevant code. If anyone can help me you'd be my hero for the day for all time I've tried to get this to work.
    Here's the StudentRecord (GUI) display part:
          public void actionPerformed( ActionEvent event )
         try {
              Display d = new Display(StudentDA.v);
             }//end try
            //catch right here no problems with this..Here's the DataAccess part:
    public class StudentDA{
      static Vector v = new Vector();;
      static String pathName = "a:/Final Project/test1.txt";
      static File studentFile = new File(pathName);
      static String status;
      public StudentDA() {}
      public static void initialize() {
        if (studentFile.exists() && studentFile.length() !=0) {
         try{
          BufferedReader in = new BufferedReader(new
          FileReader(studentFile) );
          do{
             status = in.readLine();
              if(status.equals ("uGrad")) {
                uGrad u = new uGrad();
                u.setFName(in.readLine() );
                u.setLName(in.readLine() );
                u.setssNum(Integer.parseInt(in.readLine()) );
                u.setACT(Integer.parseInt(in.readLine() ));
                v.add(u);
                System.out.println(u + "inside ugrad");
              }//end if uGrad
              else{
                if(status.equals("Grad")) {
                //same process as uGrad
                v.add(g);
              }//end else Grad
          }while (status != null);
        }//end try statement
        catch (Exception e) {
          }//end catch
        }//end if there's something there
      }//end method initialize
      //creating the terminate method
      public static void terminate() {
        try{
          PrintStream out = new PrintStream ( new
          FileOutputStream (studentFile) );
          for (int i = 0; i < v.size(); i++) {
            Student s = (Student) v.elementAt(i);
            String p = s.printRecord();
            StringTokenizer rt = new StringTokenizer(p, "\t");
            while (rt.hasMoreTokens() ) {
              out.println(rt.nextToken() );
              }//end while
          }//end for loop
        }//end try loop
        catch (Exception e){
        }//end catch
      }//end terminate
    public static void add(Student s){// throws DuplicateException{
              boolean duplicate = false;
              for(int i = 0; i < v.size(); i++){
                   if(s.getssNum() == ((Student)(v.elementAt(i))).getssNum()){
                        duplicate = true;
                        break;
                   if(duplicate){
                        throw new DuplicateException("Student Already Exists");
                   else{
                        v.add(s);
    }//end add method
    }//end classHere's the display class:
    public class Display extends JFrame {
         private JButton Next, Previous;
         private JTextField statusField, firstField, lastField, socialField, advPlacementField, actField;
         private JLabel statusLabel, firstLabel, lastLabel, socialLabel, advPlacementLabel, actLabel;
         private JPanel fieldPanel, buttonsPanel;
         private JTextArea displayArea;
         static int count = 0;
         static String status;
         public Display(){}
    public Display(Vector v){
         //setting up the GUI components for the display class here
         //JTextAreas & JLabels
         buttonsPanel = new JPanel();
         buttonsPanel.setLayout(new GridLayout(1,2));
        Next = new JButton("Next");
        buttonsPanel.add(Next);
        Next.addActionListener(
        new ActionListener() {
          public void actionPerformed( ActionEvent event )
              //try to catch display errors
           try {
                        count++;
                     displayData(count);
                     //displayData();
          }//end try
              catch {
             }//end catch
          } // end actionPerformed
        } // end anonymous inner class
        ); // end call to addActionListener
        buttonsPanel.add(Next);
        Previous = new JButton("Previous");
        buttonsPanel.add(Previous);
        Previous.addActionListener(
        new ActionListener() {
          public void actionPerformed( ActionEvent event )
              //try to catch display errors
              try {
                   count--;
                   displayData(count);
                   //displayData();
             }//end try
              catch {
             }//end catch
          } // end actionPerformed
        } // end anonymous inner class
        ); // end call to addActionListener
    }//end display() constructor
    public void displayData(int count) {
         StudentDA.initialize();
           if (status.equals ("uGrad")) {
           //these are all part of the StudentRecord GUI not Display GUI
                fieldPanel.setVisible(true);
                buttonsPanel.setVisible(true);
                actLabel.setVisible(true);
                actField.setVisible(true);
                advPlacementLabel.setVisible(false);
                advPlacementLabel.setVisible(false);
           }//end if
           else {
                if(status.equals ("Grad")) {
                 fieldPanel.setVisible(true);
                 buttonsPanel.setVisible(true);
                 actLabel.setVisible(false);
                 actField.setVisible(false);
                 advPlacementLabel.setVisible(true);
                 advPlacementLabel.setVisible(true);
                  }//end if
           }//end else
    }//end method displayData()
    public static void main ( String args[] )
        Display application = new Display();
        application.addWindowListener(
              new WindowAdapter(){
                   public void windowClosing( WindowEvent e)
                        System.exit(0);
        application.setSize( 300, 200);
        application.setVisible( true );
    };//end main
    }//end class Display{}I know this is long but if anyone can help I'd greatly appreciate it. Please ask me if you need me to clarify something, I tried to not make it way too long. --rockbottom01
         

    I'm not really too sure what it is that you are after, but here is some code, that loads up an array with each line of a .txt file, then displays them. I hope you can make use of a least some of it.
    just ask if you don't understand any of the code.
    String array[];
    int i;
    public Test() {
              readFile("file.txt");
              i = 0;
              nextEntry();
         public void nextEntry() {
              Display display = new Display();
              display.show();
         class Display extends JFrame implements ActionListener {
              JLabel label1;
              JButton button;
              public Display() {
                   label1 = new JLabel(array);
                   button = new JButton("OK");
                   getContentPane().setLayout(new FlowLayout());
                   getContentPane().add(label1);
                   getContentPane().add(button);
                   button.addActionListener(this);
              public void actionPerformed(ActionEvent e) {
                   setVisible(false);
                   i++;
                   if(i < array.length) {
                        nextEntry();
         public void readFile(String fileName) {
              String s, s2 = "";
              int lineCount = 0;
              BufferedReader in;
              try {
                   in = new BufferedReader(new FileReader(fileName));
                   while((s = in.readLine()) != null) {
                        lineCount++;
                   array = new String[lineCount];
                   in.close();
                   in = new BufferedReader(new FileReader(fileName));
                   int j = 0;
                   while((s = in.readLine()) != null) {
                        array[j] = s;
                        j++;
              catch(IOException e) {
                   System.out.println("Error");

  • How to select only one record at a time in ALV

    Hi all,
    I have to use ALV report.  Each record on the report output should have a button (or radio button) which will allow the record to be selected.  My requirement is to select only one record at a time.
    please guide me how to proceed further.
    regards
    manish

    hi
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/sampleCheckBoxProgram
    Regards
    Pavan

  • How to save more than 2 records at a time in tabular form?

    I have a table name SAMPLE_TABLE, which has SNO,NAME items and one sequence name is SEQ_SAMPLE.
    i have one form based on SAMPLE_TABLE. my form is in tabular format, which has 5 records.
    in the layout wizard only NAME is displayed. SNO doesnot displayed.
    in the layout wizard, there is one push button named as SAVE.
    the code of SAVE button(When_Button_Pressed) is
    insert into sample_table values(seq_sample.nextval,:sample_table.name);
    clear_record;
    commit;
    my problem is :
    when ever i want to save one record at a time there is no problem.
    if i want to save more than 2 records at a time then sequence number is alloted for last record. other records have no sequence numbers.
    for example i want to insert 2 names as XYZ,PQR then
    the table look like this:
    sno name
    1 PQR
    XYZ
    if SNO is primary key then it doesnot work because of null value.
    can any one solve my problem?
    Thanks
    Meegada

    Is the block a database block or a control block,
    1. if database block, assign the primary key on a
    trigger like new record instance for each record
    enteredour's is a control block, ididnt get your point clearly
    could you make it clear how to assign a primary key on a trigger
    our criteria is we are having two block as lov_values and lov_name
    lov_values:
    lov_values_id (sequence generated)
    lov_id will be same for the all the values for a particular lov_name
    lov_values will be which we enter in the form which will be the only visuble colums on the form
    lov_name block:
    lov_name
    lov_id(sequence generated)
    could you help me with the code
    thanks
    prasad

  • How to create Child record at the time of master record creation.

    Hi,
    I have MasterVO and ChildVO. And association between both are 1 to *. I have a requirement like, I need to create row in ChildVO at the time of MasterVO row creation.
    I have used entity based association to create view link. This view link created ChildVO accessor in MasterRowImpl as type RowIterator.
    Actually my idea is to override create method in MasterVORowImpl and call ChildVO ViewObject and call .createRow() method on it. But I don't have access to ViewObject, instead it gave access to RowIterator.
    Could you please provide any pointer to achieve above functionality?
    Many thanks in advance.
    Jdev version - 11.1.1.7.0
    Regards,
    Dileep.

    Hi Tim,
    Now it is creating child record at the time of master row creation. But it is working only through BC tester. But when I drag the child VO instance in the jsff page, only master is get created as editable only, child is displayed as read only without populating any default values like child VO surrogate key and other default attributes. But through BC tester it is working fine.
    Am I missing anything here while implementing in UI?
    Thanks,
    Dileep.

  • Getting only a few records at a time.

    Using a Select * from. Is there an option where I get only so many records. This is for a console application. I wanted some thing where it will display only 3 records at a time. And then I have the option of viewing the next 3 and then the next 3 records
    and so on.
    Any one have any ideas.
    Merry Christmas EVERY ONE and thanks to all the members on msdn forums for helping me with my code.
    Joe Moody
    http://www.starfiresoft.com
    Pro-Forums
    Delta Force Barracks
    On the Frontlines

    Thanks. It doesn't matter as long as I can get it to work. The idea is to display 3 records at a time. Then the user should be able to go backward or forward in the list. Let me show you what I have. This will give you some idea on how I have it displaying
    the info.
    SqlCeCommand cm = new SqlCeCommand("SELECT * FROM users", cn);
    //cm.Parameters.AddWithValue("@tooid", num);
    //cm.Parameters.AddWithValue("@fromid", Id);
    SqlCeDataReader rd = cm.ExecuteReader();
    try
    while (rd.Read())
    Door.CursorRight(10);
    Door.WriteLn("|0C___________________________________________________");
    Door.CursorRight(10);
    Door.WriteLn("|0FId |04: |03" + rd["Id"].ToString() + " |0FName |04: |03" + rd["username"].ToString());
    Door.CursorRight(10);
    Door.WriteLn("|0FStatus |04: |03" + rd["status"] + " |0FDate Jointed |04: |03" + rd["joindate"]);
    Door.CursorRight(10);
    Door.WriteLn("|0C___________________________________________________");
    catch (Exception e)
    throw new Exception(e.Message);
    cn.Close();
    This is inside of a do loop. and at the bottom I have it waiting for user input. or the user can quit and return to the main menu.
    Door.WriteLn();
    Door.Write("|07Page |0F<|04||0F> |0FQ|09)|0BQuit |07Choice |04: |0C");
    cc = Char.ToUpper(Door.ReadKey());
    Above is my prompt. This waits for user input. and I use a switch to tell the software what to do. Any way if you want to know what Door.writeLn() is, Think of it like this "Console.Writeline()". This is just a library I use for the kind of programming I
    do.Any help would be great. Thanks and have a safe Xmas.
    Joe.
    http://www.df-barracks.com Delta Force Barracks
    http://www.starfiresoft.com Starfire Software

  • Alv display for the 2nd time.

    Hi everybody
    I have created a interactive alv report. when i am going for   first display it is giving correct result whne i go for 2nd time it is not initilizing the grids the records are displayed twice or same record is displayed. i have check BCALV_GRID_03 but i could not understand it properly so i am giving my code please help.
    *& Report  ZVTEST1                                                     *
    REPORT  ZVTEST1 .
    class lcl_event_receiver definition deferred.
    class cl_event_receiver definition deferred.
    TYPE-POOLS : SLIS.
    tables : ekko,ekpo,lfa1.
    data : begin of itab occurs 0,
             lifnr like ekko-lifnr,
             netwr like ekpo-netwr,
             name1 like lfa1-name1,
          end of itab.
    data : begin of inv_det occurs 0,
             ebeln like ekko-ebeln,
             bedat like ekko-bedat,
             lifnr like ekko-lifnr,
             netwr like ekpo-netwr,
             name1 like lfa1-name1,
           end of inv_det.
    data : begin of mat_det occurs 0,
             ebeln like ekko-ebeln,
             lifnr like ekko-lifnr,
             bedat like ekko-bedat,
             matnr like ekpo-matnr,
             menge like ekpo-menge,
             netpr like ekpo-netpr,
             NETWR LIKE EKPO-NETWR,
             maktx like makt-maktx,
           end of mat_det.
    DATA :TEST_GRID TYPE REF TO CL_GUI_ALV_GRID,
          TEST_CONT TYPE SCRFNAME VALUE 'TESTING_ALV',
          TEST_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          TEST_LAYOUT TYPE LVC_S_LAYO,
          TEST_FIELDCAT TYPE LVC_T_FCAT,
          ok_code like sy-ucomm,
          event_receiver type ref to lcl_event_receiver,
          event_receiver1 type ref to cl_event_receiver,
          TEST_GRID1 TYPE REF TO CL_GUI_ALV_GRID,
          TEST_CONT1 TYPE SCRFNAME VALUE 'PARTYWISE_DETAILS',
          TEST_CONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          ls_layout TYPE lvc_s_layo,
          TEST_LAYOUT1 TYPE LVC_S_LAYO,
          TEST_FIELDCAT1 TYPE LVC_T_FCAT,
          TEST_GRID2 TYPE REF TO CL_GUI_ALV_GRID,
          TEST_CONT2 TYPE SCRFNAME VALUE 'INVOICE',
          TEST_CONTAINER2 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          TEST_LAYOUT2 TYPE LVC_S_LAYO,
          TEST_FIELDCAT2 TYPE LVC_T_FCAT.
    select-options: s_bedat for ekko-bedat.
    CALL SCREEN 100.
    class LCL_EVENT_RECEIVER definition.
      public section.
          methods:
          handle_double_click
            for event double_click of cl_gui_alv_grid
                importing e_row e_column.
      private section.
    endclass.
    class LCL_EVENT_RECEIVER implementation.
    method handle_double_click.
        data: itab1 like line of itab.
        read table itab index e_row-index into itab1.
        perform select_table_invdet using itab1
                                   changing inv_det.
        call screen 200 starting at 10 5.
    endmethod.
    endclass.
    class CL_EVENT_RECEIVER definition.
      public section.
          methods:
           handle_hotspot_click
            for event hotspot_click of cl_gui_alv_grid
                importing e_row_id e_column_id es_row_no.
      private section.
    endclass.
    class CL_EVENT_RECEIVER implementation.
    method handle_hotspot_click.
        data: itab2 like line of inv_det.
        read table inv_det index e_row_id-index into itab2.
        perform select_matdet using itab2
                                   changing mat_det.
        call screen 300 starting at 15 5.
    endmethod.
    endclass.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'TEST'.
    PERFORM SELECT-DATA.  " FOR THE INITIAL LIST.
    PERFORM ALV_DISPLAY.   "TO DISPLAY INITIAL SCREEN.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
       WHEN 'BACK'.
         LEAVE TO SCREEN 0.
       WHEN 'EXIT'.
         LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  SELECT-DATA
          text
    -->  p1        text  DATA SELECTION FOR THE 1ST LIST
    <--  p2        text
    FORM SELECT-DATA .
    select alifnr sum( bnetwr ) as netwr
        into corresponding fields of itab
        from ekko as a inner join ekpo as b on bebeln = aebeln
         where abedat in s_bedat group by alifnr.
        select single name1 from lfa1 into itab-name1
           where lifnr = itab-lifnr.
    append itab.
    endselect.
    ENDFORM.                    " SELECT-DATA
    *&      Form  ALV_DISPLAY
          text
    -->  p1        text  DISPLAY THE LIST FIRST TIME.
    <--  p2        text
    FORM ALV_DISPLAY .
    IF TEST_GRID IS INITIAL.
         CREATE OBJECT TEST_CONTAINER
           EXPORTING
             CONTAINER_NAME              = 'TESTING_ALV'.
          CREATE OBJECT TEST_GRID
            EXPORTING
              I_PARENT          =  TEST_CONTAINER.
       PERFORM PROC_CATALOG CHANGING TEST_FIELDCAT.
       PERFORM PROC_LAYOUT CHANGING TEST_LAYOUT.
       CALL METHOD TEST_GRID->SET_TABLE_FOR_FIRST_DISPLAY
         EXPORTING
           IS_LAYOUT                     =  TEST_LAYOUT
         CHANGING
           IT_OUTTAB                     =  ITAB[]
           IT_FIELDCATALOG               =  TEST_FIELDCAT[].
    create object EVENT_RECEIVER.
        set handler EVENT_RECEIVER->handle_double_click for TEST_GRID.
    ENDIF.
    CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
      EXPORTING
        CONTROL           = TEST_CONTAINER.
    CALL METHOD CL_GUI_CFW=>FLUSH.
    ENDFORM.                    " ALV_DISPLAY
    *&      Form  PROC_CATALOG
          text
         <--P_TEST_FIELDCAT  text
    FORM PROC_CATALOG  CHANGING P_TEST_FIELDCAT type lvc_t_fcat.
    data: TEST_fieldcat type lvc_s_fcat.
    TEST_FIELDCAT-fieldname = 'LIFNR'.
    TEST_FIELDCAT-REF_TABLE = 'LFA1'.
    TEST_FIELDCAT-OUTPUTLEN = '12'.
    TEST_FIELDCAT-coltext   = 'VENDOR CODE'.
    TEST_FIELDCAT-SELTEXT   = 'VENDOR CODE'.
    *TEST_FIELDCAT-HOTSPOT   = 'X'.
    APPEND TEST_FIELDCAT TO P_TEST_FIElDCAT.
    CLEAR TEST_FIELDCAT.
    TEST_FIELDCAT-fieldname = 'NAME1'.
    TEST_FIELDCAT-REF_TABLE = 'LFA1'.
    TEST_FIELDCAT-OUTPUTLEN = '25'.
    TEST_FIELDCAT-coltext   = 'VENDOR NAME'.
    TEST_FIELDCAT-SELTEXT   = 'VENDOR NAME'.
    APPEND TEST_FIELDCAT TO P_TEST_FIElDCAT.
    CLEAR TEST_FIELDCAT.
    TEST_FIELDCAT-fieldname = 'NETWR'.
    TEST_FIELDCAT-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT-OUTPUTLEN = '20'.
    TEST_FIELDCAT-coltext   = 'PURCHASE AMOUNT'.
    APPEND TEST_FIELDCAT TO P_TEST_FIElDCAT.
    CLEAR TEST_FIELDCAT.
    ENDFORM.                    " PROC_CATALOG
    *&      Form  PROC_LAYOUT
          text
         <--P_TEST_LAYOUT  text
    FORM PROC_LAYOUT  CHANGING P_TEST_LAYOUT type lvc_s_layo.
    p_TEST_layout-zebra = 'X'.
    p_TEST_layouT-grid_title = 'TEST INTERACTIVE ALV'.
    p_TEST_layout-smalltitle = 'X'.
    p_TEST_layout-no_hgridln    = 'X'.
    p_TEST_layout-excp_conds  = 'X'.
    p_TEST_layout-numc_total  = 'X'.
    ENDFORM.                    " PROC_LAYOUT
    *&      Form  select_table_invdet
          text
         -->P_ITAB1  DATA SELECTION FOR THE 2ND LIST
         <--P_INV_DET  text
    FORM select_table_invdet  USING    P_ITAB1 like line of itab
                              CHANGING P_INV_DET.
    clear inv_det.
    select alifnr aebeln abedat sum( bnetwr ) as netwr
        into corresponding fields of inv_det
        from ekko as a inner join ekpo as b on bebeln = aebeln
         where  alifnr = p_itab1-lifnr and abedat in s_bedat group by
         alifnr  aebeln a~bedat.
        select single name1 from lfa1 into inv_det-name1
           where lifnr = inv_det-lifnr.
    append INV_DET.
    endselect.
    ENDFORM.                    " select_table_invdet
    *&      Module  STATUS_0200  OUTPUT
          text
    MODULE STATUS_0200 OUTPUT.
    IF TEST_GRID1 IS INITIAL.
        CREATE OBJECT TEST_CONTAINER1
           EXPORTING
             CONTAINER_NAME              = 'NEXT_CONT'.
        IF SY-SUBRC NE 0.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              TITEL         =  SY-REPID
              TXT1          =  SY-SUBRC
              TXT2          =  'THE CONTROL IS NOT CREATED'.
      ENDIF.
         CREATE OBJECT TEST_GRID1
           EXPORTING
             I_PARENT          = TEST_CONTAINER1.
       PERFORM PROC_CATALOG1 CHANGING TEST_FIELDCAT1.
       PERFORM PROC_LAYOUT1 CHANGING TEST_LAYOUT1.
        CALL METHOD TEST_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
            IS_LAYOUT                     =  test_layout1
          CHANGING
            IT_OUTTAB                     =  inv_det[]
            IT_FIELDCATALOG               =  TEST_FIELDCAT1[].
    create object EVENT_RECEIVER1.
        set handler EVENT_RECEIVER1->handle_hotspot_click for TEST_GRID1.
    ELSE.
       CALL METHOD TEST_GRID1->REFRESH_TABLE_DISPLAY.
    ENDIF.
    CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
      EXPORTING
        CONTROL           =  TEST_container1.
    CALL METHOD CL_GUI_CFW=>FLUSH.
    ENDMODULE.                 " STATUS_0200  OUTPUT
    *&      Module  USER_COMMAND_0200  INPUT
          text
    MODULE USER_COMMAND_0200 INPUT.
      case ok_code.
        when 'EXIT'.
    leave to screen 0.
      endcase.
      clear ok_code.
    ENDMODULE.                 " USER_COMMAND_0200  INPUT
    *&      Form  PROC_CATALOG1
          text
         <--P_TEST_FIELDCAT1  text
    FORM PROC_CATALOG1  CHANGING P_TEST_FIELDCAT1 type lvc_t_fcat.
    data: TEST_fieldcat1 type lvc_s_fcat.
    TEST_FIELDCAT1-fieldname = 'EBELN'.
    TEST_FIELDCAT1-REF_TABLE = 'EKKO'.
    TEST_FIELDCAT1-OUTPUTLEN = '12'.
    TEST_FIELDCAT1-coltext   = 'P.O NUMBER'.
    TEST_FIELDCAT1-SELTEXT   = 'P.O NUMBAR'.
    TEST_FIELDCAT1-HOTSPOT   = 'X'.
    APPEND TEST_FIELDCAT1 TO P_TEST_FIElDCAT1.
    CLEAR TEST_FIELDCAT1.
    TEST_FIELDCAT1-fieldname = 'BEDAT'.
    TEST_FIELDCAT1-REF_TABLE = 'EKKO'.
    TEST_FIELDCAT1-OUTPUTLEN = '10'.
    TEST_FIELDCAT1-coltext   = 'P.O.DATE'.
    TEST_FIELDCAT1-SELTEXT   = 'P.O.DATE'.
    APPEND TEST_FIELDCAT1 TO P_TEST_FIElDCAT1.
    CLEAR TEST_FIELDCAT1.
    TEST_FIELDCAT1-fieldname = 'NETWR'.
    TEST_FIELDCAT1-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT1-OUTPUTLEN = '20'.
    TEST_FIELDCAT1-coltext   = 'PURCHASE AMOUNT'.
    APPEND TEST_FIELDCAT1 TO P_TEST_FIElDCAT1.
    CLEAR TEST_FIELDCAT1.
    ENDFORM.                    " PROC_CATALOG1
    *&      Form  PROC_LAYOUT1
          text
         <--P_TEST_LAYOUT1  text
    FORM PROC_LAYOUT1  CHANGING P_TEST_LAYOUT1  type lvc_s_layo.
    p_TEST_layout1-zebra = 'X'.
    p_TEST_layouT1-grid_title = 'DATE WISE PURCHASE ORDERS'.
    p_TEST_layout1-smalltitle = 'X'.
    p_TEST_layout1-no_hgridln    = 'X'.
    p_TEST_layout1-excp_conds  = 'X'.
    p_TEST_layout1-numc_total  = 'X'.
    ENDFORM.                    " PROC_LAYOUT1
    *&      Form  select_matdet
          text
         -->P_ITAB2  text
         <--P_MAT_DET  text
    FORM select_matdet  USING    P_ITAB2 like line of inv_det
                        CHANGING P_MAT_DET.
    select ebeln bedat lifnr from ekko into corresponding fields of mat_det
        where ebeln = p_itab2-ebeln and bedat = p_itab2-bedat
          and lifnr = p_itab2-lifnr..
    select matnr menge netpr NETWR from ekpo
       into corresponding fields of mat_det
         where ebeln = mat_det-ebeln.
    select single maktx from makt into corresponding fields of mat_det
         where matnr = mat_det-matnr.
    append mat_DET.
    endselect.
    endselect.
    ENDFORM.                    " select_matdet
    *&      Module  STATUS_0300  OUTPUT
          text
    MODULE STATUS_0300 OUTPUT.
    set pf-status 'TEST1'.
    IF TEST_GRID2 IS INITIAL.
       CREATE OBJECT TEST_CONTAINER2
         EXPORTING
           CONTAINER_NAME              = 'INVOICE_DETAILS'.
        IF SY-SUBRC NE 0.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              TITEL         =  SY-REPID
              TXT1          =  SY-SUBRC
              TXT2          =  'THE CONTROL IS NOT CREATED'.
        ENDIF.
        CREATE OBJECT TEST_GRID2
          EXPORTING
            I_PARENT          = TEST_CONTAINER2.
         PERFORM PROC_CATALOG2 CHANGING TEST_FIELDCAT2.
         PERFORM PROC_LAYOUT2 CHANGING TEST_LAYOUT2.
         CALL METHOD TEST_GRID2->SET_TABLE_FOR_FIRST_DISPLAY
           EXPORTING
             IS_LAYOUT                     = test_layout2
           CHANGING
             IT_OUTTAB                     = mat_det[]
             IT_FIELDCATALOG               = test_fieldcat2[].
    else.
    CALL METHOD TEST_GRID2->GET_FRONTEND_LAYOUT
      IMPORTING
        ES_LAYOUT = ls_layout.
    CALL METHOD TEST_GRID2->SET_FRONTEND_LAYOUT
      EXPORTING
        IS_LAYOUT = ls_layout.
    ENDIF.
    CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
      EXPORTING
        CONTROL           = test_container2.
    CALL METHOD CL_GUI_CFW=>FLUSH.
    IF SY-SUBRC NE 0.
    CALL FUNCTION 'POPUP_TO_INFORM'
      EXPORTING
        TITEL         = SY-REPID
        TXT1          = SY-SUBRC
        TXT2          = 'ERROR IN FLUSH'.
    ENDIF.
    ENDMODULE.                 " STATUS_0300  OUTPUT
    *&      Module  USER_COMMAND_0300  INPUT
          text
    MODULE USER_COMMAND_0300 INPUT.
    case ok_code.
        when 'BACK'.
            leave to screen 0.
        WHEN 'CANCLE'.
          LEAVE PROGRAM.
      endcase.
      clear ok_code.
    ENDMODULE.                 " USER_COMMAND_0300  INPUT
    *&      Form  PROC_CATALOG2
          text
         <--P_TEST_FIELDCAT2  text
    FORM PROC_CATALOG2  CHANGING P_TEST_FIELDCAT2 TYPE LVC_T_FCAT.
    data: TEST_fieldcat2 type lvc_s_fcat.
    TEST_FIELDCAT2-fieldname = 'MATNR'.
    TEST_FIELDCAT2-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT2-OUTPUTLEN = '12'.
    TEST_FIELDCAT2-coltext   = 'MATERIAL NO'.
    TEST_FIELDCAT2-SELTEXT   = 'MATERIAL NO'.
    *TEST_FIELDCAT1-HOTSPOT   = 'X'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    TEST_FIELDCAT2-fieldname = 'MAKTX'.
    TEST_FIELDCAT2-REF_TABLE = 'MAKT'.
    TEST_FIELDCAT2-OUTPUTLEN = '30'.
    TEST_FIELDCAT2-coltext   = 'DESCRIPTION'.
    TEST_FIELDCAT2-SELTEXT   = 'DESCRIPTION'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    TEST_FIELDCAT2-fieldname = 'MENGE'.
    TEST_FIELDCAT2-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT2-OUTPUTLEN = '10'.
    TEST_FIELDCAT2-coltext   = 'QUANTITY'.
    TEST_FIELDCAT2-SELTEXT   = 'QUANTITY'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    TEST_FIELDCAT2-fieldname = 'NETPR'.
    TEST_FIELDCAT2-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT2-OUTPUTLEN = '20'.
    TEST_FIELDCAT2-coltext   = 'PURCHASE AMOUNT'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    TEST_FIELDCAT2-fieldname = 'NETWR'.
    TEST_FIELDCAT2-REF_TABLE = 'EKPO'.
    TEST_FIELDCAT2-OUTPUTLEN = '20'.
    TEST_FIELDCAT2-coltext   = 'PURCHASE AMOUNT'.
    APPEND TEST_FIELDCAT2 TO P_TEST_FIElDCAT2.
    CLEAR TEST_FIELDCAT2.
    ENDFORM.                    " PROC_CATALOG2
    *&      Form  PROC_LAYOUT2
          text
         <--P_TEST_LAYOUT2  text
    FORM PROC_LAYOUT2  CHANGING P_TEST_LAYOUT2  type lvc_s_layo.
    p_TEST_layout2-zebra = 'X'.
    p_TEST_layouT2-grid_title = 'PURCHASE ORDERS MATERIAL WISE DETAILS'.
    p_TEST_layout2-smalltitle = 'X'.
    p_TEST_layout2-no_hgridln    = 'X'.
    p_TEST_layout2-excp_conds  = 'X'.
    p_TEST_layout2-numc_total  = 'X'.
    ENDFORM.                    " PROC_LAYOUT2
    thanks
    Vinayak.

    Vinayak,
    Add the Code(ELSE part) into the Form ALV_DISPLAY.
    IF TEST_GRID IS INITIAL.
      CREATE OBJECT TEST_CONTAINER
        EXPORTING
          CONTAINER_NAME = 'TESTING_ALV'.
      CREATE OBJECT TEST_GRID
        EXPORTING
         I_PARENT = TEST_CONTAINER.
       PERFORM PROC_CATALOG CHANGING TEST_FIELDCAT.
       PERFORM PROC_LAYOUT CHANGING TEST_LAYOUT.
       CALL METHOD TEST_GRID->SET_TABLE_FOR_FIRST_DISPLAY
          EXPORTING
               IS_LAYOUT = TEST_LAYOUT
          CHANGING
               IT_OUTTAB = ITAB[]
               IT_FIELDCATALOG = TEST_FIELDCAT[].
        create object EVENT_RECEIVER.
        set handler EVENT_RECEIVER->handle_double_click
           for   TEST_GRID.
    <b>ELSE.
       CALL METHOD TEST_GRID->REFRESH_TABLE_DISPLAY(
                 "EXPORTING
                 "IS_STABLE =
                 "I_SOFT_REFRESH=
                            ).</b>
    ENDIF.
    Thanks
    Kam
    Note: Allot points for all worthful postings

  • How to display records in jsp

    i have 100 records can anybody tell me how i display records 10 at atime in jsp & by clicking the next button another 10 records displays in the same jsp. How i can do that thing.

    You have to implement a page breake yourself.
    Simple scenario would be to store a page number into a session:
    session.setAttribute("page", selectedPage)
    every time user clicks on a next page link
    When displaying the record read the page and display only those which should be on the page
    Integer selectedPage = session.getAttribute("page")
    if (selectedPage == null) selectedPage = 1;
    //display code goes here

Maybe you are looking for

  • Trying to update from os 9.2 to os 10.4.10

    Help wanted! Just found an imac g3 power pc, 700 mhzk, 1 gig of ram installed with os 9.2. Found 9.2 software and reinstalled it, also updated to firmware 4.1.9 successfully. Tried installing os 10.4.10 via firewire using my imac g5 power pc in targe

  • Copy level zero value member to other level zero members under a parent

    Hi, I am entering data against a dummy costcentre. I will need allocate the value to other costcentres which sit under a parent. I tried @relative("parent member",0) = '"dummy costcentre". I have this within a fix statement. I have tried datacopy but

  • Problem with clicking CheckBox eswith eCATT recording

    Hi All, Iam using SAP GUI 640,ECC500. Am trying to set some default setting in Finance Transaction FB00 with clicking some checkboxes. So,After i recorded with clicking checkboxes,For testing that recording i unchecked the check boxes manually and ex

  • Accessing files on a Pocket PC

    OS X seems to make it a breeze connecting to bluetooth devices. It works very well indeed however i noticed what appears to be a limitation. My humble HP2210 pocket PC doesn't have oodles of memory and so I prefer to save files on to a CF card. Doing

  • Get a process variable's value to set a task's time constraints

    Hi, I want to have my task expiration times determined by a process variable (Data Object Artifact) that defines a task's "time to live". The problem is that I don't have visibility of the process variables inside the Time Constraint's Expression edi