Select stmt offset - how can I use select stmt to fetch data.

kna1-name2 contains store#XXXXXXX where XXXXXXX is a store number.  example : store#3564261.
I must fetch this.  how can i fetch this ?
Can I use
WHERE substr(name2,7,10) CS gt_soldto1-store_no
or can I use
WHERE name2+7(10) CS gt_soldto1-store_no
along with for all entries IN gt_soldto1
in the below select stmt.
    *SELECT *               
      FROM kna1
      INTO corresponding fields of TABLE gt_kna1
     FOR ALL ENTRIES IN gt_soldto1
      WHERE substr(name2,7,10) as gt_soldto1-store_no
      OR      j_3astcu    = gt_soldto1-store_no
THANKS IN ADV

Easiest way would be to create another field in your table gt_soldto1 as NAME2.
update all entries in gt_SOLD2-NAME2 as  cocatenation of  'store#' + gt_SOLD2-STORE_no
then use your select statment
SELECT *
FROM kna1
INTO corresponding fields of TABLE gt_kna1
FOR ALL ENTRIES IN gt_soldto1
WHERE  NAME2 =   gt_soldto1-name2

Similar Messages

  • How can I use Automator to extract specific Data from a text file?

    I have several hundred text files that contain a bunch of information. I only need six values from each file and ideally I need them as columns in an excel file.
    How can I use Automator to extract specific Data from the text files and either create a new text file or excel file with the info? I have looked all over but can't find a solution. If anyone could please help I would be eternally grateful!!! If there is another, better solution than automator, please let me know!
    Example of File Contents:
    Link Time =
    DD/MMM/YYYY
    Random
    Text
    161 179
    bytes of CODE    memory (+                68 range fill )
    16 789
    bytes of DATA    memory (+    59 absolute )
    1 875
    bytes of XDATA   memory (+ 1 855 absolute )
    90 783
    bytes of FARCODE memory
    What I would like to have as a final file:
    EXCEL COLUMN1
    Column 2
    Column3
    Column4
    Column5
    Column6
    MM/DD/YYYY
    filename1
    161179
    16789
    1875
    90783
    MM/DD/YYYY
    filename2
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    MM/DD/YYYY
    filename3
    xxxxxx
    xxxxx
    xxxx
    xxxxx
    Is this possible? I can't imagine having to go through each and every file one by one. Please help!!!

    Hello
    You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
    set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
    if f ends with "/" then set f to f's text 1 thru -2
    do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
    use strict;
    use open IN => ':crlf';
    chdir $ARGV[0] or die qq($!);
    local $/ = qq(\\0);
    my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
    local $/ = qq(\\n);
    #     CSV spec
    #     - record separator is CRLF
    #     - field separator is comma
    #     - every field is quoted
    #     - text encoding is UTF-8
    local $\\ = qq(\\015\\012);    # CRLF
    local $, = qq(,);            # COMMA
    # print column header row
    my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
    print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    # print data row per each file
    while (@ff) {
        my $f = shift @ff;    # file path
        if ( ! open(IN, '<', $f) ) {
            warn qq(Failed to open $f: $!);
            next;
        $f =~ s%^.*/%%og;    # file name
        @dd = ('', $f, '', '', '', '');
        while (<IN>) {
            chomp;
            $dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
            ($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
            ($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
            ($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
            ($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
            last unless grep { /^$/ } @dd;
        close IN;
        print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    EOF
    Hope this may help,
    H

  • How can I use table control to enter data

    Hi all,
    I want to use table control to enter data, instead of using textboxes.
    So that the user can enter many data at once and just click the save button at the end of the work, only one click.
    How can I use the table control at this context?
    Thanks.
    Deniz.

    Hi deniz,
    go through it:
    /people/ravishankar.rajan/blog/2007/02/23/an-easier-way-of-displaying-and-editing-data-using-table-control
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/code%2bto%2bhandle%2bmultiple%2brecords%2bin%2bbdc%2btable%2bcontrol
    Regards,

  • How can I use javascript to access netui data-repeater item?

    I have a 2-dim table of <netui: checkbox> using a <netui data-repeater> to interate over a contact email (column) and an event (rows).
              My problem is that I need to have a select all checkbox at the bottom of each column (per email) and be able to select all event for an email (when checked) and deselect all when the checkbox is unchecked.
              I can do it in java page flow but I can't have a page refresh.
              I want to do it on the page with javascript. The problem is that using
              document[getNetuiTagName("aform", this)][getNetuiTagName("email1", this)].checked
              with the "tagId" in each <netui> tag I can't access each iteration of the data repeater (I only get the last one).
              What I need is a reference to each repeater element. I do not know how many rows or columns I will have (based on the data).
              Is there any way to reference the obeject itself in javascript so I can loop through the items in the netui data-repeater?
              This is what is rendered in the html netui mapping:
              netui_names.con1="portlet_2_3wlw-checkbox_key:{actionForm.opts[4].cons[1].selContact}"
              I really want to be able to access this and loop through the arrays for opts (event) and cons(email)
              Here's the code:
              <netui:form action="submitEvents" tagId="eform" focus="">
              <table>
              <tr>
              <td>
              <table id="eTable" cellpadding="2" cellspacing="1" border="0">
              <tr bgcolor="#cccccc" class="BlackHeavy8">
              <!-- <td>Selected</td> -->
              <td colspan="2">Event</td>
              <netui-data:repeater dataSource="{pageFlow.contacts}" defaultText="No contacts configured.">
              <netui-data:repeaterHeader>
              </netui-data:repeaterHeader>
              <netui-data:repeaterItem>
              <netui-data:choiceMethod object="{pageFlow}" method="getAddHeader">
              <netui-data:methodParameter value="{container.item.contact_icon}" />
              </netui-data:choiceMethod>
              <netui-data:choice value="default">
              <td nowrap="true" bgcolor="#FFCCCC"><netui:image src="{container.item.contact_icon}"/>
              <netui:label value="{container.item.contact_value}" defaultValue=" "></netui:label>
              </td>
              </netui-data:choice>
              <netui-data:choice value="blue">
              <td nowrap="true" bgcolor="#D8EBFE"><netui:image src="{container.item.contact_icon}"/>
              <netui:label value="{container.item.contact_value}" defaultValue=" "></netui:label>
              </td>
              </netui-data:choice>
              <netui-data:choice value="green">
              <td nowrap="true" bgcolor="#CCFFCC"><netui:image src="{container.item.contact_icon}"/>
              <netui:label value="{container.item.contact_value}" defaultValue=" "></netui:label>
              </td>
              </netui-data:choice>
              <netui-data:choice value="yellow">
              <td nowrap="true" bgcolor="#FFFFCC"><netui:image src="{container.item.contact_icon}"/>
              <netui:label value="{container.item.contact_value}" defaultValue=" "></netui:label>
              </td>
              </netui-data:choice>
              </netui-data:repeaterItem>
              <netui-data:repeaterFooter></netui-data:repeaterFooter>
              </netui-data:repeater>
              </tr>
              <tr>
              <td colspan="7">
              <netui-data:repeater dataSource="{actionForm.opts}">
              <netui-data:repeaterHeader>
              </netui-data:repeaterHeader>
              <netui-data:repeaterItem>
              <netui-data:choiceMethod object="{pageFlow}" method="isEvenRow">
              <netui-data:methodParameter type="int" value="{container.index}" />
              </netui-data:choiceMethod>
              <netui-data:choice value="true">
              <tr class="BlackNorm8">
              <!-- <td align="center"> -->
              <!-- </td> -->
              <td colspan="2">
              <netui:label value="{container.item.eventName}" />
              <netui:hidden dataSource="{container.item.eventId}" />
              </td>
              <netui-data:repeater dataSource="{container.item.cons}">
              <netui-data:repeaterHeader>
              </netui-data:repeaterHeader>
              <netui-data:repeaterItem>
              <netui-data:choiceMethod object="{pageFlow}" method="getAddHeader">
              <netui-data:methodParameter value="{container.item.contact_icon}" />
              </netui-data:choiceMethod>
              <netui-data:choice value="default">
              <td align="center" bgcolor="#FFCCCC" >
              <netui:checkBox tagId="con1" dataSource="{container.item.selContact}" defaultValue="{container.item.selContact}" />
              <netui:hidden dataSource="{container.item.contact_id}" tagId="conid1" />
              </td>
              </netui-data:choice>
              <netui-data:choice value="blue">
              <td align="center" bgcolor="#D8EBFE" >
              <netui:checkBox id="con2" dataSource="{container.item.selContact}" defaultValue="{container.item.selContact}" />
              <netui:hidden dataSource="{container.item.contact_id}" tagId="conid2" />
              </td>
              </netui-data:choice>
              <netui-data:choice value="green">
              <td align="center" bgcolor="#CCFFCC" >
              <netui:checkBox tagId="con3" dataSource="{container.item.selContact}" defaultValue="{container.item.selContact}" />
              <netui:hidden dataSource="{container.item.contact_id}" tagId="conid3" />
              </td>
              </netui-data:choice>
              <netui-data:choice value="yellow">
              <td align="center" bgcolor="#FFFFCC" >
              <netui:checkBox tagId="con4" dataSource="{container.item.selContact}" defaultValue="{container.item.selContact}" />
              <netui:hidden dataSource="{container.item.contact_id}" tagId="conid4" />
              </td>
              </netui-data:choice>
              </netui-data:repeaterItem>
              <netui-data:repeaterFooter>
              </netui-data:repeaterFooter>
              </netui-data:repeater>
              </tr>
              </netui-data:choice>
              <netui-data:choice value="false">
              <tr class="BlackNorm8" bgcolor="#eeeeee">
              <!--<td align="center">-->
              <!--</td>-->
              <td colspan="2">
              <netui:label value="{container.item.eventName}" />
              <netui:hidden dataSource="{container.item.eventId}" />
              </td>
              <netui-data:repeater dataSource="{container.item.cons}">
              <netui-data:repeaterHeader>
              </netui-data:repeaterHeader>
              <netui-data:repeaterItem>
              <netui-data:choiceMethod object="{pageFlow}" method="getAddHeader">
              <netui-data:methodParameter value="{container.item.contact_icon}" />
              </netui-data:choiceMethod>
              <netui-data:choice value="default">
              <td align="center" bgcolor="#FFCCCC" >
              <netui:checkBox tagId="conalt1" dataSource="{container.item.selContact}" defaultValue="{container.item.selContact}" />
              <netui:hidden tagId="conidalt1" dataSource="{container.item.contact_id}" />
              </td>
              </netui-data:choice>
              <netui-data:choice value="blue">
              <td align="center" bgcolor="#D8EBFE" >
              <netui:checkBox tagId="conalt2" dataSource="{container.item.selContact}" defaultValue="{container.item.selContact}" />
              <netui:hidden tagId="conidalt2" dataSource="{container.item.contact_id}" />
              </td>
              </netui-data:choice>
              <netui-data:choice value="green">
              <td align="center" bgcolor="#CCFFCC" >
              <netui:checkBox tagId="conalt3" dataSource="{container.item.selContact}" defaultValue="{container.item.selContact}" />
              <netui:hidden tagId="conidalt3" dataSource="{container.item.contact_id}" />
              </td>
              </netui-data:choice>
              <netui-data:choice value="yellow">
              <td align="center" bgcolor="#FFFFCC" >
              <netui:checkBox tagId="conalt4" dataSource="{container.item.selContact}" defaultValue="{container.item.selContact}" />
              <netui:hidden tagId="conidalt4" dataSource="{container.item.contact_id}" />
              </td>
              </netui-data:choice>
              </netui-data:repeaterItem>
              <netui-data:repeaterFooter>
              </netui-data:repeaterFooter>
              </netui-data:repeater>
              </tr>
              </netui-data:choice>
              </netui-data:repeaterItem>
              <netui-data:repeaterFooter>
              </netui-data:repeaterFooter>
              </netui-data:repeater>
              Â </td>
              </tr>
              <!-- Select All Checkboxes -->
              <tr bgcolor="#cccccc" class="BlackHeavy8">
              <!-- <td>Selected</td> -->
              <td colspan="2">Select ALL</td>
              <netui-data:repeater dataSource="{pageFlow.contacts}" defaultText=" ">
              <netui-data:repeaterHeader>
              </netui-data:repeaterHeader>
              <netui-data:repeaterItem>
              <netui-data:choiceMethod object="{pageFlow}" method="getAddHeader">
              <netui-data:methodParameter value="{container.item.contact_icon}" />
              </netui-data:choiceMethod>
              <netui-data:choice value="default">
              <td align="center" nowrap="true" bgcolor="#FFCCCC">
              <netui:hidden dataSource="{container.item.contact_id}" tagId="chbox1" />
              <input type="checkbox" value="false"
              onclick="selectAllEvents('chbox1')">Select ALL
              </td>
              </netui-data:choice>
              <netui-data:choice value="blue">
              <td align="center" nowrap="true" bgcolor="#D8EBFE">
              <netui:hidden dataSource="{container.item.contact_id}" tagId="chbox2" />
              <input type="checkbox" value="false"
              onclick="selectAllEvents('chbox2')">Select All
              </td>
              </netui-data:choice>
              <netui-data:choice value="green">
              <td align="center" nowrap="true" bgcolor="#CCFFCC">
              <netui:hidden dataSource="{container.item.contact_id}" tagId="chbox3" />
              <input type="checkbox" value="false" onclick="selectAllEvents('chbox3')">Select All
              </td>
              </netui-data:choice>
              <netui-data:choice value="yellow">
              <td align="center" nowrap="true" bgcolor="#FFFFCC">
              <netui:hidden dataSource="{container.item.contact_id}" tagId="chbox4" />
              <input type="checkbox" value="false" onclick="selectAllEvents('chbox4')">Select All
              </td>
              </netui-data:choice>
              </netui-data:repeaterItem>
              <netui-data:repeaterFooter></netui-data:repeaterFooter>
              </netui-data:repeater>
              </tr>
              <!-- END Select ALL checkboxes -->
              </table>
              </td>
              <tr align="right">
              <td>
              <netui:button type="submit" value="Cancel" action="begin" styleClass="BlackNorm8"></netui:button>
              <netui:button value="Update" styleClass="BlackNorm8"/>
              </tr>
              </table>
              </netui:form>

    hi ,
    i dont know anything about delphi but from the experience from VB if the connection to oracle in delhpi doesnt recognise object type data field. Then try using OO4O drivers from oracle.if u use these drivers then u can access the sdo_geometry field !
    Hope this helps
    Vikesh

  • How can i use analytic function on these data

    hi ,
    i have the following data:
    id start end
    1 11-oct-2006 03:00:34 12-oct-2006 09:00:10
    1 09-oct-2006 05:00:23 11-oct-2006 03:00:34
    1 08-oct-2006 03:00:23 09-oct-2006 05:00:23
    2 11-oct-2006 11:00:00 11-oct-2006 14:00:00
    1 08-oct-2006 03:00:00 08-oct-2006 04:00:00
    my end results shld be
    id start end
    1 08-oct-2006 05:00:23 12-oct-2006 09:00:10
    2 11-oct-2006 11:00:00 11-oct-2006 14:00:00
    1 08-oct-2006 03:00:00 08-oct-2006 04:00:00
    pls advise
    tks & rdgs

    Mohana ,
    I think Elic's solution can be used here also
    (Group by preserving the order
    sql>select * from t;
    ID ST ED 
    1  11-OCT-06 03.00.34.000000 AM  12-OCT-06 09.00.10.000000 AM 
    1  09-OCT-06 05.00.23.000000 AM  11-OCT-06 03.00.34.000000 AM 
    1  08-OCT-06 04.00.23.000000 AM  09-OCT-06 05.00.23.000000 AM 
    2  11-OCT-06 11.00.00.000000 AM  11-OCT-06 12.00.00.000000 PM 
    1  08-OCT-06 03.00.00.000000 AM  08-OCT-06 04.00.00.000000 AM 
    sql>
    select id,min(st) st,max(ed) ed
    from(
    select id,st,ed, sum(grp) over(order by st) sm
    from(
    select id,st,ed,decode(lag(ed) over(order by st),st,0,1) grp
    from t))
    group by id,sm;
    ID ST ED 
    1  08-OCT-06 03.00.00.000000 AM  08-OCT-06 04.00.00.000000 AM 
    1  08-OCT-06 04.00.23.000000 AM  12-OCT-06 09.00.10.000000 AM 
    2  11-OCT-06 11.00.00.000000 AM  11-OCT-06 12.00.00.000000 PM
    Message was edited by:
            jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How can I use XL report to extract data in Fixed Assets module?

    Can user use XL Reporter to develop reports on Fixed Assets data such as FA Master Data? In another word, can XL
    Reporter be used on FA module? If so, how can this be done?

    Hi
    As there is no reports available for Fixed Asset Module, u have to develop by taking tech help.
    Or else u can use crystal reporter instead.
    Regards,
    Kashi

  • JPA - How can I use the table's default Date types? e.g. CURRENT_TIME

    Once again, can't find an answer anwhere.
    I would like to know if/how one can use the default date/time/datetime types as declared for the target table when attempting to persist an entity having these fields set as null.
    create table item
         item_id INTEGER NOT NULL PRIMARY KEY DEFAULT AUTOINCREMENT,
         date_created DATETIME NOT NULL DEFAULT NOW(*),
         date_updated DATETIME NOT NULL DEFAULT NOW(*),
    );Now how can I get the above table to work when attempting to em.persist(myItem) whereby dateCreated and dateUpdated are both null?

    I should also mention that TopLink has always supported the ability to retrieve the current time from the database for use in optimistic locking. The TimestampLockingPolicy offers the ability to configure the next value being retrieved from the database instead of using the local time from the JVM. Our extended optimistic locking configuration does not currently support setting this option but it could be done using a descriptor customizer which can be configured in your persistence unit properties.
    Using optimistic locking may be a good solution for the last modified date since it will also ensure that you do not corrupt the database if someone else has incremented this value since your last read.
    Doug

  • How can we improve the performance while fetching data from RESB table.

    Hi All,
    Can any bosy suggest me the right way to improve the performance while fetching data from RESB table. Below is the select statement.
    SELECT aufnr posnr roms1 roanz
        INTO (itab-aufnr, itab-pposnr, itab-roms1, itab-roanz)
        FROM resb
        WHERE kdauf  = p_vbeln
        AND   ablad  = itab-sposnr+2.
    Here I am using 'KDAUF'  & 'ABLAD' in condition. Can we use secondary index for improving the performance in this case.
    Regards,
    Himanshu

    Hi ,
    Declare intenal table with only those four fields.
    and try the beloe code....
    SELECT aufnr posnr roms1 roanz
    INTO  table itab
    FROM resb
    WHERE kdauf = p_vbeln
    AND ablad = itab-sposnr+2.
    yes, you can also use secondary index for improving the performance in this case.
    Regards,
    Anand .
    Reward if it is useful....

  • How can I use select() function in POSIX thread program.

    Hello
    Now I making a my own progam with POSIX thread in Solaris 8 Environment.
    But I have some trouble in POSIX thread.
    I saw that If use POSIX thread then use -D_POSIX_C_SOURCE=???L flag into compile options in
    Multithreaded Programming Guide.
    So I use that in my Makefile. But I can't compile my program.
    Now I found that if use POSIXC_SOURCE flag, cannot use timeval structure (defined in <sys/time.h>) in <sys/resource.h>.
    So compiling was stop into select() function. Because select() function use timeval structure.
    And fd_set structure(defined in <sys/select.h>) is same.
    How I solve this problem.
    Please help me.
    Thank you.

    Thanks so much for your helpful reply.
    Now I' ve already installed Adobe Creative Suite 6 Production Premium (Student Package), Extended included. But when I open Photoshop CS6, there' s still no 3D function in menu bar.
    Would you please tell me how to activate this function?
    Thanks,

  • How can I use only the most recent data in an average?

    I have a class which has regular listening quizzes.  If a student's average from the last three tests falls below 10 points (out of 20), then that student has to come in for extra practice.
    My Sheets are set up with the students' names running down column A.  Test 1 is column B.  A a check box for whether students handed in the pre-listening homework is in column C.  The test and homework column pattern is continued for tests 1 through 20. 
    I then have an average for all the tests for that student further over to the right.
    Next to the overall average, I would like to make a column with an average showing only the latest three test scores.  So, for example, the students have just finished test 10, the average of test 10, 9 and 8 would appear, but everything prior to that would be ignored.
    I appreciate any suggestions on a formula for how I could make that happen.
    Thank you!

    CB,
    Here's one approach. Note that I used Header Columns to make the programming easier. If you choose not to use Header Columns, you can adjust the formulas to account for the difference.
    The formula in Overall Average is: =IFERROR(AVERAGE(2:2), 0) for Alice. Fill Down.
    The formula in Last Three Scores average is: =IF(COUNT(2:2)<3, B, AVERAGE(OFFSET(D2, 0, (COUNT(2:2)-3)*2, 1, 6))) for Alice. Fill Down.
    Regards,
    Jerry

  • How Can I use a Variable  in Data Controls query. Frank Kindly check...

    Hii,
    I am using JDeveloper 11g ADF BC.
    My Requirement is that I hv a login screen which is taken from [http://blogs.oracle.com/shay/simpleJSFDBlogin.zip].
    I hv attached BC in this application. I want to use the login usercode in the next pages after login screen. Next screen contains 3 list items which will be populating based on the user. So I created &lt;af:selectOneChoice&gt; using the BC( Just drag & dropped the column into the page from the data controls). But in the data control i want to use this usercode for passing the condition. Now Data is coming without any condition.
    So How can I use the usercode in the Data controls query.
    When I tried to display the usercode in the next page it is showing by binding the value. its code is follows
    &lt;af:outputText value="#{backing_getUser.uid}"
    The program for checking the username & Password is follows.
    package login.backing;
    import oracle.adf.view.rich.component.rich.RichDocument;
    import oracle.adf.view.rich.component.rich.RichForm;
    import oracle.adf.view.rich.component.rich.input.RichInputText;
    import oracle.adf.view.rich.component.rich.layout.RichPanelFormLayout;
    import oracle.adf.view.rich.component.rich.nav.RichCommandButton;
    import java.sql.*;
    import java.util.List;
    import java.util.Map;
    import oracle.adf.view.rich.component.rich.output.RichMessage;
    import oracle.jdbc.OracleDriver;
    public class GetUser {
    private RichInputText uid;
    private RichInputText pid;
    private RichCommandButton commandButton1;
    private RichInputText inputText1;
    private RichInputText inputText2;
    public void setUid(RichInputText inputText1) {
    this.uid = inputText1;
    public void setPid(RichInputText inputText2) {
    this.pid = inputText2;
    public RichInputText getUid() {
    return uid;
    public RichInputText getPid() {
    return pid;
    public void setCommandButton1(RichCommandButton commandButton1) {
    this.commandButton1 = commandButton1;
    public RichCommandButton getCommandButton1() {
    return commandButton1;
    public String login_action() {
    // Add event code here...
    String user = this.getUid().getValue().toString();
    // String pass = inputText2.getValue().toString();
    String pid = this.getPid().getValue().toString();
    Connection conn;
    conn = getConnection();
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery ("SELECT usercode FROM guser where usercode = '"+user.toUpperCase()+"' and pwd=F_TEST('"+pid.toUpperCase()+"')");
    if (rset.next()) {
    conn.close();
    return "good";
    conn.close();
    } catch (SQLException e) {
    System.out.println(e);
    return "bad";
    public static Connection getConnection() throws SQLException {
    String username = "ACCTS";
    String password = "ACCTS";
    String thinConn = "jdbc:oracle:thin:@SERVER1:1521:G5PS";
    DriverManager.registerDriver(new OracleDriver());
    Connection conn =
    DriverManager.getConnection(thinConn, username, password);
    conn.setAutoCommit(false);
    return conn;
    public void setInputText1(RichInputText inputText1) {
    this.inputText1 = inputText1;
    public RichInputText getInputText1() {
    return inputText1;
    public void setInputText2(RichInputText inputText2) {
    this.inputText2 = inputText2;
    public RichInputText getInputText2() {
    return inputText2;
    -----

    Hi,
    I didn't look at the example, but if you want to secure your application then you should use container managed security. Read this .
    Anyway, you could add this before return "good"; in your login_action()
    FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("username", user);Then, you can access this from anywhere in the application by using #{sessionScope.username}.
    Pedja

  • How can i use index in select query.. facing problem with the select query.

    Hi Friends,
    I am facing a serious problem in one of the select query. It is taking a lot of time to fetch data in Production Scenario.
    Here is the query:
      SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelat LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelatrprctr
        WHERE rldnr  = c_telstra_accounting
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          And rzzlstar in r_lstar                            
          AND rpmax  = c_max_period.
    There are 5 indices present for Table ZTFTELAT.
    Indices of ZTFTELAT:
      Name   Description                                               
      0        Primary key( RCLNT,RLDNR,RRCTY,RVERS,RYEAR,ROBJNR,SOBJNR,RTCUR,RUNIT,DRCRK,RPMAX)                                          
      005    Profit (RCLNT,RPRCTR)
      1        Ledger, company code, account (RLDNR,RBUKRS, RACCT)                                
      2        Ledger, company code, cost center (RLDNR, RBUKRS,RCNTR)                           
      3        Account, cost center (RACCT,RCNTR)                                        
      4        RCLNT/RLDNR/RRCTY/RVERS/RYEAR/RZZAUFNR                        
      Z01    Activity Type, Account (RZZLSTAR,RACCT)                                        
      Z02    RYEAR-RBUKRS- RZZZBER-RLDNR       
    Can anyone help me out why it is taking so much time and how we can reduce it ? and also tell me if I want to use index number 1 then how can I use?
    Thanks in advance.

    Hi Shiva,
    I am using two more select queries with the same manner ....
    here are the other two select query :
    ***************1************************
    SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelpt LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelptrprctr
        WHERE rldnr  = c_telstra_projects
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          and rzzlstar in r_lstar             
          AND rpmax  = c_max_period.
    and the second one is
    *************************2************************
      SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelnt LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelntrprctr
        WHERE rldnr  = c_telstra_networks
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          and rzzlstar in r_lstar                              
          AND rpmax  = c_max_period.
    for both the above table program is taking very less time .... although both the table used in above queries have similar amount of data. And i can not remove the APPENDING CORRESPONDING. because i have to append the data after fetching from the tables.  if i will not use it will delete all the data fetched earlier.
    Thanks on advanced......
    Sourabh

  • How can I use "Free Selection" in Dunning?

    Hi,
    I am trying to generate the Dunning notice for only Customers that have the Dunning Area Code as 01. For that I am using the 'Free Selection". I have selected the Customer master and then the dunning area and didn't checked the Exclude box and then in  "Values" I have mentioned the Dunning Area Code as 01. But, System is not picking it up so what shall I do. Also, I have some questions in mind:
    1) Why there are two sections of 'Values" field?
    2) What is the process or steps to 'Exclude' the data?
    3) How can I use Dunning groups?
    Please Help.
    Thanks in advance...
    Regards
    Nitin

    Thanks done...
    Regards
    Nitin

  • How can i use param in my select query ( see code)

    Hi ,
    I need to use the param instead of hardcoding the value in the select query , when i did that it is working .
    I think the limit of args is only till the end of main and my select query is in a method called Load() .
    How can i use the param in my select query .
    public static void main(String[] args){
    name = args[0];
    class= args[1];
    new Load();
    }//end of main
    public Load()
              try {
                   Class.forName(JDBC_DRIVER);
                   connection = DriverManager.getConnection(DATABASE_URL,"username","pw");
                   statement = connection.createStatement();
                   //First Query : pin and ticket number
                   ResultSet resultSet = statement.executeQuery("SELECT pin , ticketnumber from airport ,year where "+                                                                      "year.year_name= Here i need to use the param (instead of hardcoding) and year.class_year= Here too i need to use param");
    }// end of method Load()Edited by: 1sai on Sep 24, 2008 7:34 AM
    Edited by: 1sai on Sep 24, 2008 7:35 AM

    Might I suggest you change the structure of your program to the following:
    public class Load {
      private Connection conn;
      private PreparedStatement statement;
      public Load(String sql) {
        init(sql);
      protected void init(String sql) throws Exception {
        Class.forName(JDBC_DRIVER);
        conn = DriverManager.getConnection(DATABASE_URL, "username", "pw");
        statement = conn.prepareStatement(sql);
      public ResultSet execute(String p1, String p2) throws Exception {
        statement.setString(1, p1);
        statement.setString(2, p2);
        return statement.executeQuery();
      public void close() throws Exception {
        if (statement != null)
          statement.close();
        statement = null;
        if (conn != null)
          conn.close();
        conn = null;
      public static void main(String[] args) throws Exception {
        String sql = args[0];
        String param1 = args[1];
        String param2 = args[2];
        Load load = new Load(sql);
        ResultSet rs = load.execute(param1, param2);
        while (rs.next())
          System.out.println(rs.get(0));
        rs.close();
        load.close();
    }This allows you to use the same "Load" object for multiple queries with different parameters.
    I do not recommend you actually use the code above in any sort of production application. You should really take a look at Spring Framework along with an ORM tool like Hibernate or Ibatis to simplify your DAO layer.
    Hope this helps,
    David

  • How can i use SUM aggregate in select query?

    HI,
    GURUS,
    How can i use SUM function in Select Query and i want to store that value into itab.
    for ex:
    TABLES: vbap.
    types: begin of ty_vbap,
           incluse type vbap,
           sum type string,
          end of ty_vbap.
    data: i_vbap type TABLE OF ty_vbap,
          w_vbap type ty_vbap.
    SELECT sum(posnr) FROM vbap into table i_vbap up to 5 rows.
                            (or)
    SELECT sum(posnr) FROM vbap into table i_vbap group by vbeln.
      loop at i_vbap into w_vbap
    " which variable have to use to display summed value.
      endloop.
    if above code is not understandable pleas give ome sample code on  above query.
    Thank u,
    shabeer ahmed.

    Hi,
    Check this sample code.
    TABLES SBOOK.
    DATA:  COUNT TYPE I, SUM TYPE P DECIMALS 2, AVG TYPE F.
    DATA:  CONNID LIKE SBOOK-CONNID.
    SELECT CONNID COUNT( * ) SUM( LUGGWEIGHT ) AVG( LUGGWEIGHT )
           INTO (CONNID, COUNT, SUM, AVG)
           FROM SBOOK
           WHERE
             CARRID   = 'LH '      AND
             FLDATE   = '19950228'
           GROUP BY CONNID.
      WRITE: / CONNID, COUNT, SUM, AVG.
    ENDSELECT.
    Regards,
    Sravanthi

Maybe you are looking for

  • Snipping tool for pdf files

    Although I can easily use snipping tool for word documents I cannot find the way to use snipping tool for pdf files because pdf files appear in a full screen and the taskbar does not exist -  as well as the snipping tool which I have already pinned i

  • Oracle.jbo.Session User Data Hashtable Not Saved Across Passivation and Act

    <br> According to http://blogs.oracle.com/Didier/2006/11/14#a139, I've overrided the passivate/activateState methods in MyAppModImpl: 1. ejbActivate/Passivate from oracle.jbo.server.ejb.SessionBeanImpl are called at the right time 2. overrided passiv

  • Why do my buttons shift down?

    I have a frame with gridbaglayout. When I uncomment the line panel.add(label);{code} all the buttons in the frame shift down.  How do I make it so that if I add an imageicon to my panel that it doesn't affect the position of other components in the f

  • User Exit to avoid invoice splitting

    Hi Experts, I need a user exit to change this setting on invoice splitting to omit partner function if it is different. Does anyone has any idea on that? Thanks in advance. Best regards, Chris Gu

  • IBooks Collection!

    Hi everyone, I actually bought the iPad for the purpose of downloading books and reading, in other words carrying my library with me wherever i go. I already got an iPod touch and getting benefit of the apps and music. But when it comes to iPad, am v