Need to add seek() in InputStream classes

I would like to add a seek method into a InputStream, however I have no idea how to do it. The inputstream is created from a File object, so buffering the whole file is out of the question because some of them may get large. I would very much like it to be similar if not the same as the seek function of a random access file. Any suggestions or pointers would be greatly appreciated. Or, if some one nows how to make the skip method skip back bytes as well as forward, that would be very helpful.
Ross

I thought I had written this once, here it is:
* RandomAccessInputStream.java
* Created on 15 October 2007, 14:34
* Copyright (c) Esmond Pitt, 2007. All rights reserved.
package com.verismart.io;
import java.io.DataInput;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
* @author Esmond Pitt
* @version $Revision: $
public class RandomAccessInputStream extends InputStream implements DataInput
     private RandomAccessFile     raf;
     private long     filePointer = -1L;
     /** Creates a new instance of RandomAccessInputStream */
     public RandomAccessInputStream(RandomAccessFile raf)
          this.raf = raf;
     public int available() throws IOException
          return (int)(raf.length()-raf.getFilePointer());
     public void close() throws IOException
          raf.close();
     public void mark(int readlimit)
          try
               this.filePointer = raf.getFilePointer();
          catch (IOException exc)
//               throw new MarkNotSupportedException(exc.getMessage());
     public boolean markSupported()
          return true;
     public int read() throws IOException
          return raf.read();
     public int read(byte[] buffer, int offset, int length) throws IOException
          return raf.read(buffer, offset, length);
     public int read(byte[] buffer) throws IOException
          return raf.read(buffer);
     public boolean readBoolean() throws IOException
          return raf.readBoolean();
     public byte readByte() throws IOException
          return raf.readByte();
     public char readChar() throws IOException
          return raf.readChar();
     public double readDouble() throws IOException
          return raf.readDouble();
     public float readFloat() throws IOException
          return raf.readFloat();
     public void readFully(byte[] b, int off, int len) throws IOException
          raf.readFully(b, off, len);
     public void readFully(byte[] b) throws IOException
          raf.readFully(b);
     public int readInt() throws IOException
          return raf.readInt();
     public String readLine() throws IOException
          return raf.readLine();
     public long readLong() throws IOException
          return raf.readLong();
     public short readShort() throws IOException
          return raf.readShort();
     public String readUTF() throws IOException
          return raf.readUTF();
     public int readUnsignedByte() throws IOException
          return raf.readUnsignedByte();
     public int readUnsignedShort() throws IOException
          return raf.readUnsignedShort();
     public void reset() throws IOException
          if (filePointer == -1L)
               throw new IOException("mark not set");
          raf.seek(filePointer);
     public void     seek(long position) throws IOException
          raf.seek(position);
          filePointer = -1L;
     public long skip(long n) throws IOException
          long     pointer = raf.getFilePointer();
          long     result = Math.min(raf.length()-pointer, n);
          raf.seek(pointer+result);
          return result;
     public int skipBytes(int n) throws IOException
          return raf.skipBytes(n);
}

Similar Messages

  • I need to add bullets to a list that already has a p class associated with it and they are links everything I try messes it all up

    Okay, so I am hating lists at this point! I have a set of links that have a class associated with them so they turn blue on rollover. Now I need to add those red bullets in front of the links. I Have the following css:
    .links a:link {
    text-decoration: none;
    color: #333333;
    text-align:left;
    .links a:visited {
    text-decoration: none;
    color: #000000;
    text-align: left;
    .links a:hover {
    text-decoration: underline;
    color:#003399;
    text-align: left;
    .links a:active {
    text-decoration: none;
    color:#333333;
    text-align: left;
    Then for the bullets I have:
    .classol {
    text-align:left;
    color: red;
    list-style-position: inside;
    This is the list on the page of links:
    <p class="links"><a href="http://www.cslb.ca.gov">California State Contractors License Board</a><p class="links"><a href="http://www.goodbuilders.org/index.asp">El Dorado Builders Exchange</a> </p>
              <p class="links"><a href="http://www.video.dot.ca.gov">Cal Trans Live Streaming Traffic Video</a></p>
              <p class="links"><a href="http://www.dgs.ca.gov/default.htm">California Department of General Services</a></p>h
    THE PROBLEM:
    If I add the <li class="classol"> in front of the links it messes the alignment up and the link turns red. I am sure this is a simple fix, but I am baffled by this whole list thing. I have tried every arrangement possible between these two and cannot get it to look and "act" correctly.
    As always any help is appreciated.
    THANK YOU!

    Your code has several violation errors in it, run your pages through this on-line validation tool:  http://validator.w3.org/
    Also, you're suffering from a common newbie mistake which is division-itis.  Try to simplify your layout by using a few key divisions for elements that will be used only once like the header, menu, content, footer.  Then use division classes for items you may use more than once per page. Lastly, you shouldn't try to fit content over a large background image.  Read why here:  http://alt-web.com/Backgrounds.shtml
    To answer your questions about lists, try this:
    CSS
    <style type="text/css">
    /**links**/
    a:link { color: #000000; /**black**/  text-decoration: none;}
    a:visited {color: #333333; /**charcoal**/  text-decoration: none;}
    a:hover {color: #FFFF00; /**yellow**/  text-decoration: underline;}
    a:active {color: #000000; /**black**/  text-decoration: none;}
    /**link list**/
    .link ul,.link li {color:red; line-height:1.5; font-family:Georgia, "Times New Roman", Times, serif; font-size:0.85em; list-style: square;}
    </style>
    HTML
    <ul class="link">
    <li><a href="http://www.cslb.ca.gov">California State Contractors License Board</a>
    </li>
    <li><a href="http://www.goodbuilders.org/index.asp">El Dorado Builders Exchange</a> </li>
    <li><a href="http://www.video.dot.ca.gov">Cal Trans Live Streaming Traffic Video</a></li>
    <li><a href="http://www.dgs.ca.gov/default.htm">California Department of General Services</a></li>
    <li><a href="http://www.cpuc.ca.gov/puc">California Public Utilities Commission</a></li>
    <li><a href="http://www.coldwatersaloon.com">Coldwater Saloon</a></li>
    </ul>
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/

  • Need to add a new row at the end of the table

    Experts,
    working jdev 11.1.1.3.0
    i am adding row programetically, my requirement need to add the row at after last row.
    i tried different ways.
    Row newLastRow = getPWBBidLaneVO().last();
    int lastRowIndex = getPWBBidLaneVO().getRangeIndexOf(newLastRow);
    getPWBBidLaneVO().insertRowAtRangeIndex(lastRowIndex - 1,
    laneRow);
    this is giving --- java.lang.ArrayIndexOutOfBoundsException: 0
    and
    http://kohlivikram.blogspot.com/2008/10/add-new-row-in-adf-table-on-button.html --- its giving index out of bound because vo.getRangeSize() is 25. We set this value at vo for performance improment suggestions.
    is there a way to add a new row at the end of the table?

    Add this to the view row impl class
           public void insertRow(Row row) {
               //go to the end of Rowset if it has rows
               Row lastRow = this.last();
               if (lastRow !=null){
                    //insert new row at the end and make it current
                   int indx = this.getRangeIndexOf(lastRow)+1;
                   this.insertRowAtRangeIndex(indx,row);
                   this.setCurrentRow(row);
               }else { // empty Rowset
               super.insertRow(row);
               }

  • [svn:fx-trunk] 5465: Now that padding set on a TextInput does not affect the inner textView, we need to add a custom TextInput skin for the TextInput a Spark NumericStepper contains .

    Revision: 5465
    Author: [email protected]
    Date: 2009-03-20 11:52:56 -0700 (Fri, 20 Mar 2009)
    Log Message:
    Now that padding set on a TextInput does not affect the inner textView, we need to add a custom TextInput skin for the TextInput a Spark NumericStepper contains. Jim ok'ed the addition of the new FxNumericStepperTextInputSkin.mxml class into the spark.skins and wireframe packaged.
    SDK-18275, SDK-19849
    Reviewer: Glenn
    Checkintests: Pass
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18275
    http://bugs.adobe.com/jira/browse/SDK-19849
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxNumericStepper.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxNumericStepperSkin.mxml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxNumericStepperSkin.mxml
    Added Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxNumericStepperTextInputSkin .mxml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxNumericStepperTextInputSkin. mxml

    Revision: 5465
    Author: [email protected]
    Date: 2009-03-20 11:52:56 -0700 (Fri, 20 Mar 2009)
    Log Message:
    Now that padding set on a TextInput does not affect the inner textView, we need to add a custom TextInput skin for the TextInput a Spark NumericStepper contains. Jim ok'ed the addition of the new FxNumericStepperTextInputSkin.mxml class into the spark.skins and wireframe packaged.
    SDK-18275, SDK-19849
    Reviewer: Glenn
    Checkintests: Pass
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18275
    http://bugs.adobe.com/jira/browse/SDK-19849
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxNumericStepper.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxNumericStepperSkin.mxml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxNumericStepperSkin.mxml
    Added Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxNumericStepperTextInputSkin .mxml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxNumericStepperTextInputSkin. mxml

  • Do I always need to add .JAR to ClassPath?

    My platform is Windows.
    I pack my .class files to a .Jar file. When I want to use this .Jar, I always have to add it to ClassPath. I think it doesn't make sense. Does anything I can do that can make me use .Jar more convenient ?
    Thanks

    Can you elaborate more?
    If you create an app and jar up all of the .class files in jar called myJar.jar for example, and then want to run that app, you just type in "java -jar myJar.jar" and its' not necessary to have myJar.jar in the classpath. (Remember to add a manifest with the Main-Class attribute defined! See java tutorial for more info on executable jars...)
    If, otoh, you have a bunch of classes in a jar, and then want to refer to those classes from some other external class(es)/jar(s), then yes, you'll need to add that jar to your classpath.
    -Ron

  • What library to I need to add for AbstractRemoteApplicationModuleImpl?

    JDev 9.0.5.2
    what library to I need to add for oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl?
    I am debugging a custom method in my app module. When it steps through a line with a VO.createRow() it complains about not being able to find the class
    oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl
    It I hit the "play" button, none of the remaining code in the method gets executed.
    What library should I add so that this can be resolved?
    Thanks

    ??!if thats in reply to why i posted mine after mlk, it
    was sposed to be
    after paul's, i was just slow....No, "??!" is the vaguest question of all. We have a winner!

  • What software do I need to add TouchEvents to app?

    I have just finished the development of version 1 of my application using Flash CS4. It's almost completely AS3 code with a SQL backend. For the next version  I want to look at adding TouchEvents for a mobile version of the application. But I'm confused as to what I need to add to my development software in order to develop apps that use touch.
    Do I just need to install the Flash 10.1 player beta in order to get access to classes such as  "flash.events.TouchEvent" or do I need to upgrade to Flash CS5?

    you need to upgrade is you want to use more than a press event.  otherwise, you can use a mousedown event for a finger press.

  • Urgent:Need to add Timeout for getting connection

    All,
    While using DriverManager.getConnection to get the connection,I need to add Timeout in my code so if I don't get a connection with in 30 seconds,I need to say'Operation Timed out.
    I was using DriverManager Api's setLoginTimeout method to set the desired time but it doesn't work.Can somebody tell me some other way to do it.

    If I use this method then if second thread reports
    Timed out after 30 seconds and then origional thread
    gets connection after 30 seconds then it'll also
    report.I dont want a connection if 30 second time
    passes.I think if second thread reports 'timed out'
    then I won't be able to explicitly kill the origional
    thread as stop method is deprecated in Thread
    class.Can you make it clear please?You can't stop the actual thread attempting the connection.
    It will require some thought on your part to correctly wrap it.
    It might not work at all because the getConnection() method, or something in it, might be synchronized.

  • Need to add new line in Service Provider Agreement

    Hi All,
    In Change Service Provider (T Code- EEDMIDESERVPROV02) screen, under the agreement tab (Payment and Billing Data) I need to add the agreement details for respective Service Provider which I am getting through WebService Call (ABAP Proxy).
    Need to update existing or add new record programatically.
    Is there any standard function module or method to do the same ?
    Thanks in advance.

    Hi Ankit,
    There is a standard class for this - CL_ISU_IDE_DEREGSPAGREEMENT, which I believe should help you.
    Regards,
    Asif

  • Need to Add a button in ALV Tool Bar

    Hi,
    I have a requirement where in i need to add a button to a standard ALV report. Its using the class CL_GUI_ALV_GRID. There is a Badi for the report. The Report is co05n and the Badi is WORKORDER_INFOSYSTEM . I am getting the handle of
    CL_GUI_ALV_GRID object reference before screen display. Any guidance on how to add new button now to that toolbar?
    Any help will be rewarded.
    Thank you.
    regards,
    Deepthi lakshmi.A.

    Dear Deepthi Lakshmi.A.,
    Refer the standard program BCALV_GRID_05                  Add a Self-Defined Button to the Toolbar.
    PROGRAM BCALV_GRID_05.
    Purpose:
    ~~~~~~~~
    Demonstrate the creation of an own toolbar button.
    To check program behavior
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    The report shows a list of flights of one airline.
    Select one or more lines and press the 'Detail'-Button to popup
    a dialog window with related bookings.
    Essential steps (Search for '§')
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1.Apply steps for event handling for events TOOLBAR and
      USER_COMMAND (see example for print events)
    2.In event handler method for event TOOLBAR: Append own functions
      by using event parameter E_OBJECT.
    3.In event handler method for event USER_COMMAND: Query your
      function codes defined in step 2 and react accordingly.
    4.Call method 'set_toolbar_interactive' to raise event TOOLBAR.
    INCLUDE .
    Predefine a local class for event handling to allow the
    declaration of a reference variable before the class is defined.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    DATA: ok_code LIKE sy-ucomm,
          gt_sflight TYPE TABLE OF sflight,
          gt_sbook TYPE TABLE OF sbook,
          g_repid LIKE sy-repid,
          g_max type i value 100,
          gs_layout   TYPE lvc_s_layo,
          cont_on_main   TYPE scrfname VALUE 'BCALVC_TOOLBAR_D100_C1',
          cont_on_dialog TYPE scrfname VALUE 'BCALVC_TOOLBAR_D101_C1',
          grid1  TYPE REF TO cl_gui_alv_grid,
          grid2  TYPE REF TO cl_gui_alv_grid,
          custom_container1 TYPE REF TO cl_gui_custom_container,
          custom_container2 TYPE REF TO cl_gui_custom_container,
          event_receiver TYPE REF TO lcl_event_receiver.
    Set initial dynpro
    SET SCREEN 100.
    LOCAL CLASSES: Definition
    *===============================================================
    class lcl_event_receiver: local class to
                            define and handle own functions.
    Definition:
    ~~~~~~~~~~~
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
                IMPORTING e_object e_interactive,
        handle_user_command
            FOR EVENT user_command OF cl_gui_alv_grid
                IMPORTING e_ucomm.
      PRIVATE SECTION.
    ENDCLASS.
    lcl_event_receiver (Definition)
    *===============================================================
    LOCAL CLASSES: Implementation
    *===============================================================
    class lcl_event_receiver (Implementation)
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_toolbar.
    § 2.In event handler method for event TOOLBAR: Append own functions
      by using event parameter E_OBJECT.
        DATA: ls_toolbar  TYPE stb_button.
    E_OBJECT of event TOOLBAR is of type REF TO CL_ALV_EVENT_TOOLBAR_SET.
    This class has got one attribute, namly MT_TOOLBAR, which
    is a table of type TTB_BUTTON. One line of this table is
    defined by the Structure STB_BUTTON (see data deklaration above).
    A remark to the flag E_INTERACTIVE:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            'e_interactive' is set, if this event is raised due to
            the call of 'set_toolbar_interactive' by the user.
            You can distinguish this way if the event was raised
            by yourself or by ALV
            (e.g. in method 'refresh_table_display').
            An application of this feature is still unknown...
    append a separator to normal toolbar
        CLEAR ls_toolbar.
        MOVE 3 TO ls_toolbar-butn_type.
        APPEND ls_toolbar TO e_object->mt_toolbar.
    append an icon to show booking table
        CLEAR ls_toolbar.
        MOVE 'BOOKINGS' TO ls_toolbar-function.
        MOVE icon_employee TO ls_toolbar-icon.
        MOVE 'Show Bookings'(111) TO ls_toolbar-quickinfo.
        MOVE 'Detail'(112) TO ls_toolbar-text.
        MOVE ' ' TO ls_toolbar-disabled.
        APPEND ls_toolbar TO e_object->mt_toolbar.
      ENDMETHOD.
      METHOD handle_user_command.
    § 3.In event handler method for event USER_COMMAND: Query your
      function codes defined in step 2 and react accordingly.
        DATA: lt_rows TYPE lvc_t_row.
        CASE e_ucomm.
          WHEN 'BOOKINGS'.
            CALL METHOD grid1->get_selected_rows
                     IMPORTING et_index_rows = lt_rows.
            CALL METHOD cl_gui_cfw=>flush.
            IF sy-subrc ne 0.
    add your handling, for example
              CALL FUNCTION 'POPUP_TO_INFORM'
                   EXPORTING
                        titel = g_repid
                        txt2  = sy-subrc
                        txt1  = 'Error in Flush'(500).
            else.
                      perform show_booking_table tables lt_rows.
            ENDIF.
        ENDCASE.
      ENDMETHOD.                           "handle_user_command
    ENDCLASS.
    lcl_event_receiver (Implementation)
    *===================================================================
          FORM EXIT_PROGRAM                                             *
    FORM exit_program.
    The instance grid2 is freed not until the program exits from the
    main screen.
    (It is created only once during the first selection of SBOOK,
    no matter how many times the second window is called).
      CALL METHOD custom_container1->free.
      IF not custom_container2 is initial.
        CALL METHOD custom_container2->free.
      ENDIF.
      CALL METHOD cl_gui_cfw=>flush.
      IF sy-subrc ne 0.
    add your handling, for example
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = g_repid
                  txt2  = sy-subrc
                  txt1  = 'Error in Flush'(500).
      ENDIF.
      LEAVE PROGRAM.
    ENDFORM.
    *&      Module  PBO_100  OUTPUT
          text
    MODULE pbo_100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      g_repid = sy-repid.
      IF custom_container1 is initial.
    select data from table SFLIGHT
        PERFORM select_table_sflight CHANGING gt_sflight.
    create a custom container control for our ALV Control
        CREATE OBJECT custom_container1
            EXPORTING
                container_name = cont_on_main
            EXCEPTIONS
                cntl_error = 1
                cntl_system_error = 2
                create_error = 3
                lifetime_error = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc ne 0.
    add your handling, for example
          CALL FUNCTION 'POPUP_TO_INFORM'
               EXPORTING
                    titel = g_repid
                    txt2  = sy-subrc
                    txt1  = 'The control could not be created'(510).
        ENDIF.
    create an instance of alv control
        CREATE OBJECT grid1
               EXPORTING i_parent = custom_container1.
    Set a titlebar for the grid control
        gs_layout-grid_title = 'Flights'(100).
    allow to select multiple lines
        gs_layout-sel_mode = 'A'.
        CALL METHOD grid1->set_table_for_first_display
             EXPORTING i_structure_name = 'SFLIGHT'
                       is_layout        = gs_layout
             CHANGING  it_outtab        = gt_sflight.
    ->Create Object to receive events and link them to handler methods.
    When the ALV Control raises the event for the specified instance
    the corresponding method is automatically called.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_user_command FOR grid1.
        SET HANDLER event_receiver->handle_toolbar FOR grid1.
    § 4.Call method 'set_toolbar_interactive' to raise event TOOLBAR.
        CALL METHOD grid1->set_toolbar_interactive.
      ENDIF.                               "IF grid1 IS INITIAL
      CALL METHOD cl_gui_control=>set_focus EXPORTING control = grid1.
    ENDMODULE.                             " PBO_100  OUTPUT
    *&      Module  PAI_100  INPUT
          text
    MODULE pai_100 INPUT.
      CASE ok_code.
        WHEN 'EXIT'.
          PERFORM exit_program.
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                             " PAI_100  INPUT
    *&      Module  PBO_0101  OUTPUT
          text
    MODULE pbo_0101 OUTPUT.
      IF custom_container2 is initial.
    (the data from sbook is already selected)
    create a custom container control for our ALV Control
        CREATE OBJECT custom_container2
            EXPORTING
                container_name = cont_on_dialog
            EXCEPTIONS
                cntl_error = 1
                cntl_system_error = 2
                create_error = 3
                lifetime_error = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc ne 0.
    add your handling, for example
          CALL FUNCTION 'POPUP_TO_INFORM'
               EXPORTING
                    titel = g_repid
                    txt2  = sy-subrc
                    txt1  = 'The control could not be created'(510).
        ENDIF.
    create an instance of alv control
        CREATE OBJECT grid2
               EXPORTING i_parent = custom_container2.
    change title
        gs_layout-grid_title = 'Bookings'(101).
        gs_layout-sel_mode = ' '.
        CALL METHOD grid2->set_table_for_first_display
             EXPORTING i_structure_name = 'SBOOK'
                       is_layout        = gs_layout
             CHANGING  it_outtab        = gt_sbook.
      ELSE.
        CALL METHOD grid2->refresh_table_display.
      ENDIF.                               "IF custom_container2 IS INITIAL.
      CALL METHOD cl_gui_control=>set_focus EXPORTING control = grid2.
      CALL METHOD cl_gui_cfw=>flush.
      IF sy-subrc ne 0.
    add your handling, for example
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = g_repid
                  txt2  = sy-subrc
                  txt1  = 'Error in Flush'(500).
      ENDIF.
    ENDMODULE.                             " PBO_0101  OUTPUT
    *&      Form  SELECT_TABLE_SFLIGHT
          text
         <--P_GT_SFLIGHT  text
    FORM select_table_sflight CHANGING p_gt_sflight LIKE gt_sflight[].
      SELECT * FROM sflight INTO TABLE p_gt_sflight up to g_max rows.
    ENDFORM.                               " SELECT_TABLE_SFLIGHT
    *&      Form  SELECT_TABLE_SBOOK
          text
         -->P_LS_SFLIGHT  text
         <--P_GT_SBOOK  text
    FORM select_table_sbook USING    p_ls_sflight LIKE LINE OF gt_sflight
                            CHANGING p_gt_sbook LIKE gt_sbook[].
      DATA: lt_sbook LIKE gt_sbook[].
    Select data from sbook according to a line of sflight
    and append that data to table p_gt_sbook
      SELECT * FROM  sbook INTO TABLE lt_sbook
             WHERE  carrid  = p_ls_sflight-carrid
             AND    connid  = p_ls_sflight-connid
             AND    fldate  = p_ls_sflight-fldate.
      APPEND LINES OF lt_sbook TO p_gt_sbook.
    ENDFORM.                               " SELECT_TABLE_SBOOK
    *&      Module  PAI_0101  INPUT
          text
    MODULE pai_0101 INPUT.
      CASE ok_code.
        WHEN 'RETURN'.
          LEAVE TO SCREEN 0.
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                             " PAI_0101  INPUT
    *&      Form  show_booking_table
          text
         -->P_ET_INDEX_ROWS  text
    FORM show_booking_table TABLES p_et_index_rows
                                    STRUCTURE lvc_s_row.
      DATA: ls_selected_line LIKE lvc_s_row,
            lf_row_index TYPE lvc_index,
            ls_sflight LIKE LINE OF gt_sflight.
      CLEAR gt_sbook[].
      LOOP AT p_et_index_rows INTO ls_selected_line.
        lf_row_index = ls_selected_line-index.
    read selected row from internal table gt_sflight
        READ TABLE gt_sflight INDEX lf_row_index INTO ls_sflight.
    select corresponding lines of table sbook
    and append new lines to global table
        PERFORM select_table_sbook USING ls_sflight
                                   CHANGING gt_sbook.
      ENDLOOP.
    call dialog screen and display new alv control
      CALL SCREEN 101 STARTING AT 10 5.
    ENDFORM.                               " show_booking_table
    Regards,
    Naveen.

  • Need to add new fields in transaction UDM_DISPUTE.

    Hi Friends,
    This is regarding UDM_DISPUTE transaction in FSCM.
    I need to add new fields (drop down lists) in transaction UDM_DISPUTE.
    Program Name: SAPLSRMCLFRM2
    Screen Number: 100
    Can any one please suggest me with the name of exit using which I can add these new fields.
    Or another way through which I can add these new fields viz., BADI or classes.
    Thank You in Advance!
    Regards,
    Tejaswini

    Execute the below code to find the userexits the t-code is using
    REPORT yuserexit_vin NO STANDARD PAGE HEADING.
    TABLES : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
    TABLES : tstct. DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
    DATA : field1(30).
    DATA : v_devclass LIKE tadir-devclass.
    PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
    SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.
    IF sy-subrc EQ 0.
      SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR' AND object = 'PROG' AND obj_name = tstc-pgmna.
      MOVE : tadir-devclass TO v_devclass.
      IF sy-subrc NE 0.
        SELECT SINGLE * FROM trdir WHERE name = tstc-pgmna.
        IF trdir-subc EQ 'F'.
          SELECT SINGLE * FROM tfdir WHERE pname = tstc-pgmna.
          SELECT SINGLE * FROM enlfdir WHERE funcname = tfdir-funcname.
          SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR' AND object = 'FUGR' AND obj_name EQ enlfdir-area.
          MOVE : tadir-devclass TO v_devclass.
        ENDIF.
      ENDIF.
      SELECT * FROM tadir INTO TABLE jtab WHERE pgmid = 'R3TR' AND object = 'SMOD' AND devclass = v_devclass.
      SELECT SINGLE * FROM tstct WHERE sprsl EQ sy-langu AND tcode EQ p_tcode.
      FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
      WRITE:/(19) 'Transaction Code - ', 20(20) p_tcode, 45(50) tstct-ttext.
      SKIP.
      IF NOT jtab[] IS INITIAL.
        WRITE:/(95) sy-uline.
        FORMAT COLOR COL_HEADING INTENSIFIED ON.
        WRITE:/1 sy-vline, 2 'Exit Name', 21 sy-vline , 22 'Description', 95 sy-vline.
        WRITE:/(95) sy-uline.
        LOOP AT jtab.
          SELECT SINGLE * FROM modsapt WHERE sprsl = sy-langu AND name = jtab-obj_name.
          FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
          WRITE:/1 sy-vline, 2 jtab-obj_name HOTSPOT ON, 21 sy-vline , 22 modsapt-modtext, 95 sy-vline.
        ENDLOOP.
        WRITE:/(95) sy-uline.
        DESCRIBE TABLE jtab.
        SKIP.
        FORMAT COLOR COL_TOTAL INTENSIFIED ON.
        WRITE:/ 'No of Exits:' , sy-tfill.
      ELSE.
        FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
        WRITE:/(95) 'No User Exit exists'.
      ENDIF.
    ELSE.
      FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
      WRITE:/(95) 'Transaction Code Does Not Exist'.
    ENDIF.
    AT LINE-SELECTION.
      GET CURSOR FIELD field1.
      CHECK field1(4) EQ 'JTAB'.
      SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
      CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
    * *---End of Program

  • I need to add a clickthrough(tracking code) to a button

    I've added a clickthrough to a banner that targets the stage before but now I need to add a clickthrough that targets a specific element and am not sure how to do this. This isn't a clicktag but actually code for mediamind/sizmek to traffic a bannner.
    here is the code that targets the whole banner
    <script type="text/javascript">
      function initEB(){
      if (!EB.isInitialized()){
      EB.addEventListener(EBG.EventName.EB_INITIALIZED, startAd);
      }else{
      startAd();
      function startAd(){
      document.getElementById("Stage").style.visibility = "visible";
      function handleClickthroughButtonClick(){
      EB.clickthrough();
      function handleUserActionButtonClick(){
      EB.userActionCounter("CustomInteraction");
    </script>
    <body style="margin:0;padding:0;" onload="initEB();" onclick="javascript:handleClickthroughButtonClick();">
      <div id="Stage" class="EDGE-21317836">
      </div>
    </body>

    Provide the name of the program you are using so a Moderator may move this message to the correct program forum
    The Cloud is not a program, it is a delivery process... a program would be Photoshop or InDesign or Muse or ???

  • Need to add 2 new columns to the existing table control of C223 transaction

    Hi ABAP Gurus,
    I have to do a screen enhancement for transaction C223.
    Below is the requirement:
    need to add 2 new columns to the existing table control of C223 transaction.
    there is no customer exits, screen exit or user exit present for this transaction C223, i have found one enhancement spot for this transaction.
    i dont have any idea how to do this in standard transaction C223, the table control in C223 saves the data to MKAL table and the table control uses the structure MKAL_EXPAND in the screen program.
    i have created an append structure for  the 2 fields to the standard table MKAL.
    Can anyone please suggest me how this can be done in standard screen C223, will the enhancement spot can be used to do this....
    please sugest...
    Thanks & Regards

    Hi Santosh,
    Thanks for the reply. I have looked into this Enhancement Spot CPFX_SCREEN_SET , inside this there is only one method INPUT_DISABLED having below parameters
    IM_MKAL     Importing     Type     MKAL                                                                                Production Version
    EX_MSGID     Exporting     Type     SY-MSGID                                                                                Messages, Message
    EX_MSGTY     Exporting     Type     SY-MSGTY                                                                                Messages, Message
    EX_MSGNO     Exporting     Type     SY-MSGNO                                                                                Messages, Message
    EX_MSGV1     Exporting     Type     SY-MSGV1                                                                                Messages, Message
    EX_MSGV2     Exporting     Type     SY-MSGV2                                                                                Messages, Message
    EX_MSGV3     Exporting     Type     SY-MSGV3                                                                                Messages, Message
    EX_MSGV4     Exporting     Type     SY-MSGV4                                                                                Messages, Message
    EX_INPUT_DISABLE     Exporting     Type     CHAR1                                                                                Display Only if X Was Set
    the BADI definition present here is a SAP internal so we cant implement the BADI , but we can created a enhancement spot implementation for this. as per my understanding on this the enhancement spot is only for making the table control fields display / change .  i dont think this can be used to add two new coloumns to C223 table control.
    I am not sure thats why seeking your help/valuable sugestion on this.
    Please provide your sugestion on this , so that i can come to conclusion on this issue.
    Thanks & Regards
    Siddhartha Mishra

  • Newbie: I needs to add a ID attribute to a TD cell tag

    Hi,
    I feel like I bug u to much... but I needs to hide columns and rows so I needs to add a ID attribute to a TD cell tag or a report region, report.
    I tried adding Column Attributes: CSS Class: myclass - it only affects the column text
    do I use "Element Attributes" or "Element Option Attributes" if so how?
    thanks. RJ

    Sorry I posted a little too quick. I see you want to hide a column in a report.
    Place this code in the HTML Header of the page
    <script language="JavaScript" type="text/javascript">
    function getCellIndex(pRow, pCell) {
      if (document.all ){ // if IE do things the MS way
        for (var i=0; i<pRow.cells.length; i++) {
          if (pRow.cells[i] == pCell) {
            lCount = i
      } else { // do things the standard way
        lCount = pCell.cellIndex;
      return lCount;
    function cellColumn(pId, pFunction) {
      var lCell      = $x(pId);
      var lTable     = $x_UpTill(lCell, 'TABLE');
      var lRows      = lTable.rows;
      var lCellIndex = getCellIndex(lCell.parentNode, lCell);
      for (var i=0; i<lRows.length; i++) {
        switch(pFunction){
          case 'TOGGLE':$x_Toggle(lRows.cells[lCellIndex]);break;
    case 'SHOW' :$x_Show (lRows[i].cells[lCellIndex]);break;
    case 'HIDE' :$x_Hide (lRows[i].cells[lCellIndex]);break;
    default:break;
    return;
    </script>
    If your table contained the EMP column you could hide or show with
        cellColumn('EMP', 'SHOW');
        cellColumn('EMP', 'HIDE');

  • IS there SEEK() in FileInputStream Class?

    Hi all
    I am reading a binary file with FileInputStream class which I told
    is faster than RandomAccessFile class when it comes to
    reading in chunks of data at a time.
    In my program I need to reset or go to the beginning of the file I am reading in
    and read it in again. As far as know there is no such method as seek() in
    FileInputStream class. How can I do this?
    Thanks

    In my program I need to reset or go to the beginning
    of the file I am reading in
    and read it in again. As far as know there is no such
    method as seek() in
    FileInputStream class. How can I do this?Close the input stream and create another one.

Maybe you are looking for

  • Problem in using org.jdom.Parent in my EJB

    Hi All, I am using a code below to read a EBM and replace some of the node values in it. For that , initiallly, i want to check whether the XPATH class is working .. While i run this code in my SOAP-UI i get teh No class definition found exception fo

  • How do i find the email address that my redemption code is attached to?

    Hello My name is Yakira and I'm a fashion design student. My school sent out emails that had links for students to follow in order to download a free copy of Adobe Suite.  I followed the instructions and Creative Cloud only allows me to use TRIAL ver

  • I removed cookies and now I can't get into Tagged. How do I undo this???

    I went to Tools, Options, Privacy, and removed all cookies. Now I can't get into Tagged. I don't know what I did different, because I have removed cookies before and this did not happen.

  • Creating dimension and levels

    Hi , I need drilling functionality in reporting...and i have tried few things but its not working...need ur help for the same.... I have two dimension table 1>Corporate 2>Departments I need drilling functionality...so that when i click on Corporate i

  • Spry Tabs - target different tab via url?

    I have a page that uses the Spry tabs. It's set to use the first tab (default). I have another page wherein I'd like to put a link to this page but have the link display the SECOND tab. Is this possible? How is it done?