X3-02 Flight Query

Can I know what is the function of Flight Query in X3-02?
Settings>Phone>Flight Query
Solved!
Go to Solution.

Thanks again for the reply Meow
It is an honour to have a moderator to reply my thread
What I try to say earlier is, after my 5800 offline profile activated, all active connections will be disconnected...
After disconnection(during offline mode), I can switch on my bluetooth during that time although it is in offline mode but I cannot do so in flight mode for my X3-02.
Actually I have made the "profile selection" as one of my shortcuts in the desktop cause I switch profiles a lot....
And one more thing I'm still using v5.60 for X3-02, kinda sad V6.00 haven't reach my region yet.... If possible I want to request for next firmware update to support video call using the back camera... thanks in advance
Sorry for the bad English

Similar Messages

  • Flight Query and Light Effects.

    Just bought a Nokia Asha 300 and wanted to know what "Flight query" in the settings menu was for...just says on or off...and also what does the "light effects" do...nothing different seems to happen when either switched to on or off so not sure. Thanks for your help x
    Solved!
    Go to Solution.

    Flight Query : When you switch the Mobile ON it displays the question, "Do you want to turn on in flight mode?" Just an additional query if you forget to do that when required...
    Ligt Effects : Will inform you of any Missed Calls / Messages thru' blinking light thru' one of the Keys ...

  • Selecting connecting flights query

    Hi,
    In our system we have a base table with all connecting flights. Each flight leg(segment) is stored as a record (PK is CID and flight_no), however
    both flight segments have the same id (data set). For example:
    Segments(Legs)
    CID    Flight_no  From To
    1       UA123     LAX  DEN
    1       UA456     DEN JFKand the routes base table stores the starting and ending point of a flight, but not the stopover:
    Routes
    From  To
    LAX   JFKThe problem is finding those connecting flights according to the route.
    Help on the sql would be greatly appreciated! Thanks!
    Edited by: user545194 on 01.10.2012 11:08

    Hi again,
    Here is the table ddl with sample data.
    Table DDL:
    CREATE TABLE "TEST"."SAMPLE_DATA_TBL"
        "CID"          NUMBER NOT NULL ENABLE,
        "SNR"          NUMBER(1,0),
        "CS"           VARCHAR2(4 BYTE),
        "FLIGHT_NO"    VARCHAR2(8 BYTE) NOT NULL ENABLE,
        "FROM_AP"      VARCHAR2(3 BYTE) NOT NULL ENABLE,
        "DEPART"       VARCHAR2(20 BYTE),
        "TO_AP"        VARCHAR2(3 BYTE) NOT NULL ENABLE,
        "ARRIVE"       VARCHAR2(20 BYTE),
        "FLT_DURATION" VARCHAR2(20 BYTE),
        "DEP_T"        VARCHAR2(4 BYTE),
        "ARR_T"        VARCHAR2(4 BYTE)
      );Sample data:
    Insert into TEST.SAMPLE_DATA (CID,SNR,CS,FLIGHT_NO,FROM_AP,DEPART,TO_AP,ARRIVE,FLT_DURATION,DEP_T,ARR_T) values ('8','1',null,'LH3487','ADB','04:10:00','TXL','06:05:00','04:55:00','I','-');
    Insert into TEST.SAMPLE_DATA (CID,SNR,CS,FLIGHT_NO,FROM_AP,DEPART,TO_AP,ARRIVE,FLT_DURATION,DEP_T,ARR_T) values ('8','2',null,'LH2057','TXL','06:50:00','MUC','08:05:00',null,'-','2');
    Insert into TEST.SAMPLE_DATA (CID,SNR,CS,FLIGHT_NO,FROM_AP,DEPART,TO_AP,ARRIVE,FLT_DURATION,DEP_T,ARR_T) values ('123','1',null,'LH3301','AGP','13:35:00','TXL','16:55:00','06:45:00','3','-');
    Insert into TEST.SAMPLE_DATA (CID,SNR,CS,FLIGHT_NO,FROM_AP,DEPART,TO_AP,ARRIVE,FLT_DURATION,DEP_T,ARR_T) values ('123','2',null,'LH197','TXL','19:10:00','FRA','20:20:00',null,'-','1');
    Insert into TEST.SAMPLE_DATA (CID,SNR,CS,FLIGHT_NO,FROM_AP,DEPART,TO_AP,ARRIVE,FLT_DURATION,DEP_T,ARR_T) values ('213','1',null,'LH693','AMM','02:45:00','FRA','06:25:00','07:30:00','1','1');
    Insert into TEST.SAMPLE_DATA (CID,SNR,CS,FLIGHT_NO,FROM_AP,DEPART,TO_AP,ARRIVE,FLT_DURATION,DEP_T,ARR_T) values ('213','2',null,'LH6332','FRA','07:45:00','VIE','09:15:00',null,'1','-');
    Insert into TEST.SAMPLE_DATA (CID,SNR,CS,FLIGHT_NO,FROM_AP,DEPART,TO_AP,ARRIVE,FLT_DURATION,DEP_T,ARR_T) values ('281','1','CL','LH2307','AMS','17:25:00','MUC','18:50:00','03:30:00','-','2');
    Insert into TEST.SAMPLE_DATA (CID,SNR,CS,FLIGHT_NO,FROM_AP,DEPART,TO_AP,ARRIVE,FLT_DURATION,DEP_T,ARR_T) values ('281','2',null,'LH123','MUC','19:50:00','FRA','20:55:00',null,'2','1');
    Insert into TEST.SAMPLE_DATA (CID,SNR,CS,FLIGHT_NO,FROM_AP,DEPART,TO_AP,ARRIVE,FLT_DURATION,DEP_T,ARR_T) values ('402','1','SK','LH6059','ARN','15:15:00','TXL','16:45:00','03:25:00','5','-');
    Insert into TEST.SAMPLE_DATA (CID,SNR,CS,FLIGHT_NO,FROM_AP,DEPART,TO_AP,ARRIVE,FLT_DURATION,DEP_T,ARR_T) values ('402','2',null,'LH193','TXL','17:30:00','FRA','18:40:00',null,'-','1');Explanation: A connection id (cid) consists of 2 flight legs(segments, snr) and the "trick" is to list both connections through input
    of the starting and ending points; i.e. 'AGP' to 'FRA'.
    Thanks!

  • Air ticket purchase/refund without external reservation system

    In the absence of external reservation systems what should be the suggested procedure in case of air ticket booking/ purchase and refund in case of cancellation?
    Thanks in advance!!

    Hi,
    This is not possible in SAP standard. Air ticket booking can only be made if you have a External GDS define in your system. Otherwise it is only possible to have documentary flight query using Travel Request but you can do a online flight query.
    Regards,
    Raynard

  • Delta Airways Flight Status query page locks up iPhone 3G

    I had gone to:
    http://www.delta.com/travelingcheckin/flight_statusupdates/index.jsp
    to check my wife's flight (I put in 1882) and after starting to search the iPhone became completely non-responsive. No buttons did anything and the touchscreen was not responding either. After a few minutes of trying everything I could think of the phone went to the screen where it shows the USB plug going to iTunes. When that showed up I pressed the top button (it worked now) and I powered the phone off and back on again.
    Odd thing is, I just talked to my wife and the same thing happened to her last night on her iPphone.
    We both have iPhone 3G's running 2.2 software.
    Looks like some function on the web page/safari on the phone lock up the phone somehow.
    http://www.delta.com/travelingcheckin/flight_statusupdates/index.jsp
    Try it yourself..if you dare.

    Tried it, worked fine. Atlanta to Baltimore on time.

  • Need query for connecting flights

    Hi all.
    My requirement is as follows
    suppose my itnery is AAA-BBB-CCC.And there are few flights between AAA-BBB and BBB-CCC.I need all the valid connecting flights everyday.My table data is as follows
    orig dest fltno arrivaldate depdate legno itid
    AAA BBB 121 23-05-2011 15:40:00(arrical ar BBB) 1 x
    AAA BBB 123 23-05-2011 16:40:00(arrical ar BBB) 1 x
    BBB CCC 212 24-05-2011 04:05:00(arrical ar CCC) 23-05-2011 19:50:00(depat from BBB) 2 x
    BBB CCC 213 24-05-2011 13:05:00 (arrical ar CCC) 24-05-2011 04:50:00(depat from BBB) 2 x
    now i need to get for legno 1 all the flights in leg 2, whose depdate is grater than arrival date in leg 1.
    Thanks.

    Hi,
    Whenever you have a problem, please post CREATE TABLE and INSERT statements for the sample data. Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Always say which version of Oracle you're using.
    If I understand the problem, then you can use somehting like this:
    SELECT     l2.*
    FROM     table_x       l1
    JOIN     table_x       l2   ON   l2.legeno     = l1.legno + 1
                     AND  l2.orig     = l1.dest
                     AND  l2.depdate     > l1.arrivaldate
    WHERE     l1.legno     = 1
    ;A self-join, like this, will work if you're looking for a specific leg. If you're interested in all legs (or all legs after a certain point), regardless of whether that's 1, 2, 3 or more, then use CONNECT BY instead of a self-join.

  • Query help with round up of dates

    Hi,
    I have a problem with my query.
    I am calculating the difference between two dates and I want to get the hours.
    The problem is that I want the following to happen:
    if the difference is x such that x > 0 it should round it up to 1 (example: x = 0.1 it should be rounded up to 1)
    if the difference is y such that y >1 it should be rounded to 1 (example y = 1.05 it should be rounded up to 2)
    i have the following query at the momet:
    select to_char(arrivaldate,'DD/MM/YYYY hh24:mi:ss') as "ARRIVAL", to_char(departuredate,'DD/MM/YYYY hh24:mi:ss') as "DEPARTURE", round(trunc(mod((departuredate-arrivaldate)*24,24),2)) as duration from stay_log;
    thanks.

    Hi,
    Format your code so that the physical appearance of the code gives some hint as to what you're doing, as I did below.
    When posting code on this forum, always type {code} tags at the beginning and end of formatted sections.
    Do you mean that, instead of 21, you want to use the flightid from the main query?
    If so, that's called a "correllated query". The tables in the main query (and their columns) can be reference in the sub-query, like this:
    select     flightid                         as "FLIGHT",
              select     destairport_id
              from     journey,
                   flight
              where     flight.flightid  = stay_log.flight_id   -- correlated to main query
              and     flight.journeyid = journey.journeyid
         )                              AS "AIRPORT",
         to_char(arrivaldate,'DD/MM/YYYY hh24:mi:ss')     as "ARRIVAL",
         to_char(departuredate,'DD/MM/YYYY hh24:mi:ss')     as "DEPARTURE",
         ceil((departuredate-arrivaldate)*24)          as "DURATION",
         cost                              as "COST"
    from     stay_log;Often, people give a table alias to the main query table that is being referenced in the sub-query, as shown below.
    That's only required when the table name appears in both FROM-clauses.
    select     flightid                         as "FLIGHT",
              select     destairport_id
              from     journey,
                   flight
              where     flight.flightid  = s.flight_id     -- table alias s used here
              and     flight.journeyid = journey.journeyid
         )                              AS "AIRPORT",
         to_char(arrivaldate,'DD/MM/YYYY hh24:mi:ss')     as "ARRIVAL",
         to_char(departuredate,'DD/MM/YYYY hh24:mi:ss')     as "DEPARTURE",
         ceil((departuredate-arrivaldate)*24)          as "DURATION",
         cost                              as "COST"
    from     stay_log   s     -- table alias s defined here
    ;

  • Error in query when adding prompts

    Hello Everyone,
    I have a simple query which is working just fine in query manager. Now, I need to narrow the query by adding two prompts. However, when I add a prompt, it will complain with an error saying:
    Incorrect Syntax Near pch1.itemcode...
    However, I am NOT using that table.. in fact, the query access an external table...
    I have read note 0000730960 SAP Business One does not identify variables in long queries, but this is not the case.
    I have reduced the query to just:
    select
         t0.airline_id as 'Airline'
    from     
         hostostmp..flights t0
    where
         t0.airline_id='[%0]'
    but it is still giving me the error...
    Even more, if I change the query for some actual real value, it will work. For instace, t0.airline_id='MP' it will work like a charm.
    I use prompts (up to 3 prompts) in many other querys with no problems...
    But this one, is a really wierd one. Support insists in reducing the query, based on the note, but this is simple a shot in the dark. They have no idea.
    So, any hint will certainly be apprecieted.
    Best regards,
    Leo

    Hi Leonardo,
    I'm afraid I don't think you can use prompts on external tables. Your other queries you mention, are the prompts on SBO tables or external tables?
    As you know, when a prompt is inserted in to a query, SBO generates a separate window that allows the user to enter values for any prompts. If SBO does not recognise the table as a system table then it cannot generate the prompt window and the query fails (..and you get that misleading error message).
    Kind Regards,
    Owen

  • How to use varaible in place of logical operator in query

    Hi Experts,
    How can we use a variable in place of logical operator (OR, AND) ?
    For ex:
    select * from sflight where carrid = 'LH' AND connid = 100.
    data x type string.
    x = 'AND'.
    Now, I want to replace AND with the variable x.
    Query will be:
    select * from sflight where carrid = 'LH'  x connid = 100.
    I am doing this because user can select any logical operator while creating the search criteria at run time .
    I already tried this but i am getting following compilation error:
    Error: Incorrect expression used in place of logical expression.

    hi,
    Check out this sample code
    Display of flight connections after input of airline and flight number:
    PARAMETERS: carr_id TYPE spfli-carrid,
                conn_id TYPE spfli-connid.
    DATA:       where_clause TYPE  STRING,
                and(4),
                wa_spfli TYPE spfli.
    IF carr_id IS NOT INITIAL.
      CONCATENATE 'CARRID = ''' carr_id '''' INTO where_clause.
      and = ' AND'.
    ENDIF.
    IF conn_id IS NOT INITIAL.
      CONCATENATE where_clause and ' CONNID = ''' conn_id ''''
        INTO where_clause.
    ENDIF.
    SELECT * FROM spfli INTO wa_spfli WHERE (where_clause).
      WRITE: / wa_spfli-carrid, wa_spfli-connid, wa_spfli-cityfrom,
               wa_spfli-cityto, wa_spfli-deptime.
    ENDSELECT.
    Regards,
    Santosh

  • Select Query with Inner Join

    Dear Experts,
    I have writen a inner join code with MKPF and MSEG which taking too much time, while I have used index.
    Indexes are:
    MSEG
    MATNR
    WERKS
    LGORT
    BWART
    SOBKZ
    MKPF
    BUDAT
    MBLNR
    My Select Query is :
      SELECT B~MATNR
                   B~MAT_KDAUF
                   B~MAT_KDPOS
                   B~BWART
                   B~MENGE
                   B~MEINS
                   B~AUFNR
        INTO TABLE IT_MSEG
        FROM MKPF AS A
          INNER JOIN MSEG AS B
             ON AMBLNR EQ BMBLNR
            AND AMJAHR EQ BMJAHR
        WHERE A~BUDAT IN BUDAT
          AND B~MATNR IN MATNR
          AND B~WERKS IN WERKS
          AND B~LGORT IN LGORT
          AND B~BWART IN BWART.

    hi,
    you can use  for all entries  it will work faster then joins
    About it:*
    FOR ALL ENTRIES WHERE
    Syntax
    ... FOR ALL ENTRIES IN itab WHERE ... col operator itab-comp ...
    Effect
    If the addition FOR ALL ENTRIES is specified before the language element WHERE, then the components comp of the internal table itab can be used as operands when comparing with relational operators.
    The internal table itab must have a structured line type and the component comp must be compatible with the column col.
    The logical expression sql_cond of the WHERE condition can comprise various logical expressions by using AND and OR. However, if FOR ALL ENTRIES is specified, there must be at least one Comparison with a column of the internal table itab, which can be specified either statistically or dynamically (Release 6.40 and higher). In a statement with a SELECTstatement with FOR ALL ENTRIES, the addition ORDER BY can only be used with the addition PRIMARY KEY.
    The whole logical expression sql_cond is evaluated for each individual line of the internal table itab. The resulting set of the SELECT statement is the union of the resulting sets from the individual evaluations. Duplicate lines are automatically removed from the resulting set. If the internal table itab is empty, the whole WHERE statement is ignored and all lines in the database are put in the resulting set.
    Notes
    In Release 6.10 and higher, the same internal table can be specified after FOR ALL ENTRIES and after INTO.
    The addition FOR ALL ENTRIES is only possible before WHERE conditions of the SELECT statement.
    Example
    Exporting all flight data for a specified departure city. The relevant airlines and flight numbers are first put in an internal table entry_tab, which is evaluated in the WHERE condition of the subsquent SELECT statement.
    PARAMETERS p_city TYPE spfli-cityfrom.
    TYPES: BEGIN OF entry_tab_type,
             carrid TYPE spfli-carrid,
             connid TYPE spfli-connid,
           END OF entry_tab_type.
    DATA: entry_tab   TYPE TABLE OF entry_tab_type,
          sflight_tab TYPE SORTED TABLE OF sflight
                           WITH UNIQUE KEY carrid connid fldate.
    SELECT carrid connid
           FROM spfli
           INTO CORRESPONDING FIELDS OF TABLE entry_tab
           WHERE cityfrom = p_city.
    SELECT carrid connid fldate
           FROM sflight
           INTO CORRESPONDING FIELDS OF TABLE sflight_tab
           FOR ALL ENTRIES IN entry_tab
           WHERE carrid = entry_tab-carrid AND
                 connid = entry_tab-connid.
    hope it will help you
    Rahul sharma
    Edited by: RAHUL SHARMA on Sep 11, 2008 8:10 AM

  • Output query result in XML format

    folks:
    could anybody provide more information
    about how to generate query result in
    xml format? looks like DBXML is for demo only
    and i have heard that PLSQL XML parser is the way to go; so far i have not found
    a sample yet on how to actually
    do the XML generation; if you know more
    about it, please let me know; thanks in
    advance.
    Bill

    Here are some sample apps that might interest you:
    [list]
    [*][url [URL=http://technet.oracle.com/tech/xml/xsql_servlet/index2.htm?Code&files/ffhome.html]The]http://technet.oracle.com/tech/xml/xsql_servlet/index2.htm?Code&files/ffhome.html]The XML Flight Finder
    [*][url [URL=http://technet.oracle.com/sample_code/tech/xml/xmlb2b/doc/xb2bhome.html]B2B]http://technet.oracle.com/sample_code/tech/xml/xmlb2b/doc/xb2bhome.html]B2B with XML
    [list]
    Enjoy,
    -rh

  • Sum fields in a sql query

    Hi,
    somebody knows how to sum two columns of a table as a result of an abap sql query. I know that is possible to do it in a native sql like
    select f.seatmax max, f.seatfree free, f.seatmax - f.seatfree seatoccu from flights
    Tks
    Roberto Falk

    Hi Roberto , 
      Here is a sample code which does some thing similar
    Data : v_LABST type LABST ,
           v_umlme type umlme.
    start-of-selection.
           select sum( labst ) sum( umlme )
             into (v_labst , v_umlme)
             from mard.
    write:/ v_labst , v_umlme.
    Regards
    Arun

  • Basic query regarding work-area and select query

    hi
    dear sdn members,
    thanks too all for solving all my query's up till now
    i am stuck in a problem need help
    1)  why basically work-area has been used ? the sole purpose
    2)  different types of select query ? only coding examples
    note: no links pls
    regards,
    virus

    hi,
    Work Area
    Description for a data object that is particularly useful when working with internal tables or database tables as a source for changing operations or a target for reading operations.
    WORKAREA is a structure that can hold only one record at a time. It is a collection of fields. We use workarea as we cannot directly read from a table. In order to interact with a table we need workarea. When a Select Statement is executed on a table then the first record is read and put into the header of the table and from there put into the header or the workarea(of the same structure as that of the table)of the internal table and then transferred top the body of the internal table or directly displayed from the workarea.
    Each row in a table is a record and each column is a field.
    While adding or retrieving records to / from internal table we have to keep the record temporarily.
    The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
    .g.
    data: begin of itab occurs 10,
    ab type c,
    cd type i,
    end of itab. " this table will have the header line.
    data: wa_itab like itab. " explicit work area for itab
    data: itab1 like itab occurs 10. " table is without header line.
    The header line is a field string with the same structure as a row of the body, but it can only hold a single row.
    It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table. It is the default work area for the internal table.
    With header line
    SELECT.
    Put the curson on that word and press F1 . You can see the whole documentation for select statements.
    select statements :
    SELECT result
    FROM source
    INTO|APPENDING target
    [[FOR ALL ENTRIES IN itab] WHERE sql_cond]
    Effect
    SELECT is an Open-SQL-statement for reading data from one or several database tables into data objects.
    The select statement reads a result set (whose structure is determined in result ) from the database tables specified in source, and assigns the data from the result set to the data objects specified in target. You can restrict the result set using the WHERE addition. The addition GROUP BY compresses several database rows into a single row of the result set. The addition HAVING restricts the compressed rows. The addition ORDER BY sorts the result set.
    The data objects specified in target must match the result set result. This means that the result set is either assigned to the data objects in one step, or by row, or by packets of rows. In the second and third case, the SELECT statement opens a loop, which which must be closed using ENDSELECT. For every loop pass, the SELECT-statement assigns a row or a packet of rows to the data objects specified in target. If the last row was assigned or if the result set is empty, then SELECT branches to ENDSELECT . A database cursor is opened implicitly to process a SELECT-loop, and is closed again when the loop is ended. You can end the loop using the statements from section leave loops.
    Up to the INTO resp. APPENDING addition, the entries in the SELECTstatement define which data should be read by the database in which form. This requirement is translated in the database interface for the database system´s programming interface and is then passed to the database system. The data are read in packets by the database and are transported to the application server by the database server. On the application server, the data are transferred to the ABAP program´s data objects in accordance with the data specified in the INTO and APPENDING additions.
    System Fields
    The SELECT statement sets the values of the system fields sy-subrc and sy-dbcnt.
    sy-subrc Relevance
    0 The SELECT statement sets sy-subrc to 0 for every pass by value to an ABAP data object. The ENDSELECT statement sets sy-subrc to 0 if at least one row was transferred in the SELECT loop.
    4 The SELECT statement sets sy-subrc to 4 if the result set is empty, that is, if no data was found in the database.
    8 The SELECT statement sets sy-subrc to 8 if the FOR UPDATE addition is used in result, without the primary key being specified fully after WHERE.
    After every value that is transferred to an ABAP data object, the SELECT statement sets sy-dbcnt to the number of rows that were transferred. If the result set is empty, sy-dbcnt is set to 0.
    Notes
    Outside classes, you do not need to specify the target area with INTO or APPENDING if a single database table or a single view is specified statically after FROM, and a table work area dbtab was declared with the TABLES statement for the corresponding database table or view. In this case, the system supplements the SELECT-statement implicitly with the addition INTO dbtab.
    Although the WHERE-condition is optional, you should always specify it for performance reasons, and the result set should not be restricted on the application server.
    SELECT-loops can be nested. For performance reasons, you should check whether a join or a sub-query would be more effective.
    Within a SELECT-loop you cannot execute any statements that lead to a database commit and consequently cause the corresponding database cursor to close.
    SELECT - result
    Syntax
    ... lines columns ... .
    Effect
    The data in result defines whether the resulting set consists of multiple rows (table-like structure) or a single row ( flat structure). It specifies the columns to be read and defines their names in the resulting set. Note that column names from the database table can be changed. For single columns, aggregate expressions can be used to specify aggregates. Identical rows in the resulting set can be excluded, and individual rows can be protected from parallel changes by another program.
    The data in result consists of data for the rows lines and for the columns columns.
    SELECT - lines
    Syntax
    ... { SINGLE }
    | { { } } ... .
    Alternatives:
    1. ... SINGLE
    2. ... { }
    Effect
    The data in lines specifies that the resulting set has either multiple lines or a single line.
    Alternative 1
    ... SINGLE
    Effect
    If SINGLE is specified, the resulting set has a single line. If the remaining additions to the SELECT command select more than one line from the database, the first line that is found is entered into the resulting set. The data objects specified after INTO may not be internal tables, and the APPENDING addition may not be used.
    An exclusive lock can be set for this line using the FOR UPDATE addition when a single line is being read with SINGLE. The SELECT command is used in this case only if all primary key fields in logical expressions linked by AND are checked to make sure they are the same in the WHERE condition. Otherwise, the resulting set is empty and sy-subrc is set to 8. If the lock causes a deadlock, an exception occurs. If the FOR UPDATE addition is used, the SELECT command circumvents SAP buffering.
    Note
    When SINGLE is being specified, the lines to be read should be clearly specified in the WHERE condition, for the sake of efficiency. When the data is read from a database table, the system does this by specifying comparison values for the primary key.
    Alternative 2
    Effect
    If SINGLE is not specified and if columns does not contain only aggregate expressions, the resulting set has multiple lines. All database lines that are selected by the remaining additions of the SELECT command are included in the resulting list. If the ORDER BY addition is not used, the order of the lines in the resulting list is not defined and, if the same SELECT command is executed multiple times, the order may be different each time. A data object specified after INTO can be an internal table and the APPENDING addition can be used. If no internal table is specified after INTO or APPENDING, the SELECT command triggers a loop that has to be closed using ENDSELECT.
    If multiple lines are read without SINGLE, the DISTINCT addition can be used to exclude duplicate lines from the resulting list. If DISTINCT is used, the SELECT command circumvents SAP buffering. DISTINCT cannot be used in the following situations:
    If a column specified in columns has the type STRING, RAWSTRING, LCHAR or LRAW
    If the system tries to access pool or cluster tables and single columns are specified in columns.
    Note
    When specifying DISTINCT, note that you have to carry out sort operations in the database system for this.
    SELECT - columns
    Syntax
    | { {col1|aggregate( col1 )}
    {col2|aggregate( col2 )} ... }
    | (column_syntax) ... .
    Alternatives:
    1. ... *
    2. ... {col1|aggregate( col1 )}
    {col2|aggregate( col2 )} ...
    3. ... (column_syntax)
    Effect
    The input in columns determines which columns are used to build the resulting set.
    Alternative 1
    Effect
    If * is specified, the resulting set is built based on all columns in the database tables or views specified after FROM, in the order given there. The columns in the resulting set take on the name and data type from the database tables or views. Only one data object can be specified after INTO.
    Note
    If multiple database tables are specified after FROM, you cannot prevent multiple columns from getting the same name when you specify *.
    Alternative 2
    ... {col1|aggregate( col1 )}
    {col2|aggregate( col2 )} ...
    Effect
    A list of column labels col1 col2 ... is specified in order to build the resulting list from individual columns. An individual column can be specified directly or as an argument of an aggregate function aggregate. The order in which the column labels are specified is up to you and defines the order of the columns in the resulting list. Only if a column of the type LCHAR or LRAW is listed does the corresponding length field also have to be specified directly before it. An individual column can be specified multiple times.
    The addition AS can be used to define an alternative column name a1 a2 ... with a maximum of fourteen digits in the resulting set for every column label col1 col2 .... The system uses the alternative column name in the additions INTO|APPENDING CORRESPONDING FIELDS and ORDER BY. .
    Column labels
    The following column labels are possible:
    If only a single database table or a single view is specified after FROM, the column labels in the database table - that is, the names of the components comp1 comp2... - can be specified directly for col1 col2 ... in the structure of the ABAP Dictionary.
    If the name of the component occurs in multiple database tables of the FROM addition, but the desired database table or the view dbtab is only specified once after FROM, the names dbtab~comp1 dbtab~comp2 ... have to be specified for col1 col2 .... comp1 comp2 ... are the names of the components in the structure of the ABAP Dictionary.
    If the desired database table or view occurs multiple times after FROM, the names tabalias~comp1 tabalias~comp2 ... have to be specified for col1 col2 .... tabalias is the alternative table name of the database table or view defined after FROM, and comp1 comp2 ... are the names of the components in the structure of the ABAP Dictionary.
    The data type of a single column in the resulting list is the datatype of the corresponding component in the ABAP Dictionary. The corresponding data object after INTO or APPENDING has to be selected accordingly.
    Note
    If multiple database tables are specified after FROM, you can use alternative names when specifying single columns to avoid having multiple columns with the same name.
    Example
    Read specific columns of a single row.
    DATA wa TYPE spfli.
    SELECT SINGLE carrid connid cityfrom cityto
    INTO CORRESPONDING FIELDS OF wa
    FROM spfli
    WHERE carrid EQ 'LH' AND connid EQ '0400'.
    IF sy-subrc EQ 0.
    WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto.
    ENDIF.
    Alternative 3
    ... (column_syntax)
    Effect
    Instead of static data, a data object column_syntax in brackets can be specified, which, when the command is executed, either contains the syntax shown with the static data, or is initial. The data object column_syntax can be a character-type data object or an internal table with a character-type data type. The syntax in column_syntax, like in the ABAP editor, is not case-sensitive. When specifying an internal table, you can distribute the syntax over multiple rows.
    If column_syntax is initial when the command is executed, columns is implicitly set to * and all columns are read.
    If columns are specificied dynamically without the SINGLE addition, the resulting set is always regarded as having multiple rows.
    Notes
    Before Release 6.10, you could only specify an internal table with a flat character-type row type for column_syntax with a maximum of 72 characters. Also, before Release 6.10, if you used the DISTINCT addition for dynamic access to pool tables or cluster tables, this was ignored, but since release 6.10, this causes a known exception.
    If column_syntax is an internal table with header line, the table body and not the header line is evaluated.
    Example
    Read out how many flights go to and from a city. The SELECT command is implemented only once in a sub-program. The column data, including aggregate function and the data after GROUP BY, is dynamic. Instead of adding the column data to an internal l_columns table, you could just as easily concatenate it in a character-type l_columns field.
    PERFORM my_select USING `CITYFROM`.
    ULINE.
    PERFORM my_select USING `CITYTO`.
    FORM my_select USING l_group TYPE string.
    DATA: l_columns TYPE TABLE OF string,
    l_container TYPE string,
    l_count TYPE i.
    APPEND l_group TO l_columns.
    APPEND `count( * )` TO l_columns.
    SELECT (l_columns)
    FROM spfli
    INTO (l_container, l_count)
    GROUP BY (l_group).
    WRITE: / l_count, l_container.
    ENDSELECT.
    ENDFORM.
    SELECT - aggregate
    Syntax
    ... { MAX( col )
    | MIN( col )
    | AVG( col )
    | SUM( col )
    | COUNT( DISTINCT col )
    | COUNT( * )
    | count(*) } ... .
    Effect
    As many of the specified column labels as you like can be listed in the SELECT command as arguments of the above aggregate expression. In aggregate expressions, a single value is calculated from the values of multiple rows in a column as follows (note that the addition DISTINCT excludes double values from the calculation):
    MAX( col ) Determines the maximum value of the value in the column col in the resulting set or in the current group.
    MIN( col ) Determines the minimum value of the content of the column col in the resulting set or in the current group.
    AVG( col ) Determines the average value of the content of the column col in the resulting set or in the current group. The data type of the column has to be numerical.
    SUM( col ) Determines the sum of the content of the column col in the resulting set or in the current group. The data type of the column has to be numerical.
    COUNT( DISTINCT col ) Determines the number of different values in the column col in the resulting set or in the current group.
    COUNT( * ) (or count(*)) Determines the number of rows in the resulting set or in the current group. No column label is specified in this case.
    If you are using aggregate expressions, all column labels that are not listed as an argument of an aggregate function are listed after the addition GROUP BY. The aggregate functions evaluate the content of the groups defined by GROUP BY in the database system and transfer the result to the combined rows of the resulting set.
    The data type of aggregate expressions with the function MAX, MIN or SUM is the data type of the corresponding column in the ABAP Dictionary. Aggregate expressions with the function AVG have the data type FLTP, and those with COUNT have the data type INT4. The corresponding data object after INTO or APPENDING has to be selected accordingly.
    Note the following points when using aggregate expressions:
    If the addition FOR ALL ENTRIES is used in front of WHERE, or if cluster or pool tables are listed after FROM, no other aggregate expressions apart from COUNT( * ) can be used.
    Columns of the type STRING or RAWSTRING cannot be used with aggregate functions.
    When aggregate expressions are used, the SELECT command makes it unnecessary to use SAP buffering.
    Null values are not included in the calculation for the aggregate functions. The result is a null value only if all the rows in the column in question contain the null value.
    If only aggregate expressions are used after SELECT, the results set has one row and the addition GROUP BY is not necessary. If a non-table type target area is specified after INTO, the command ENDSELECT cannot be used together with the addition SINGLE. If the aggregate expression count( * ) is not being used, an internal table can be specified after INTO, and the first row of this table is filled.
    If aggregate functions are used without GROUP BY being specified at the same time, the resulting set also contains a row if no data is found in the database. If count( * ) is used, the column in question contains the value 0. The columns in the other aggregate functions contain initial values. This row is assigned to the data object specified after INTO, and unless count( * ) is being used exclusively, sy-subrc is set to 0 and sy-dbcnt is set to 1. If count( *) is used exclusively, the addition INTO can be omitted and if no data can be found in the database, sy-subrc is set to 4 and sy-dbcnt is set to 0.
    if helpful reward points

  • Query Regarding Native SQL

    Hello Friends,
       I am having a requirement to fetch the records from 3 tables( Using inner join)
       into an internal table but I am facing a difficulty that I need to fetch the records from this table with entirely different conditions and I need to use ' UNION ALL' Command to fetch the records from the database. For Eg.
    I have to write two select statement....
    Select <f1> <f2> <f3> <f4>
    from <t1> join <t2> join <t3>
    into table ITAB
    where <Cond. 1>
    Select <f1> <f2> <f3> <f4>
    from <t1> join <t2> join <t3>
    appending table ITAB
    where <Cond. 2>
    But this is taking two much time... So the user told me to use native SQL to combine this two statement with UNION ALL.. I am using database DB2 Can anyone help me regarding this.
    Thanks,
    Navneet

    HI,
    Info in help is good to understand better. Below is the
    same for you understanding.
    ... FROM tabref1 [INNER] JOIN tabref2 ON cond
    Effect
    The data is to be selected from transparent database tables and/or views determined by tabref1 and tabref2. tabref1 and tabref2 each have the same form as in variant 1 or are themselves Join expressions. The keyword INNER does not have to be specified. The database tables or views determined by tabref1 and tabref2 must be recognized by the ABAP Dictionary.
    In a relational data structure, it is quite normal for data that belongs together to be split up across several tables to help the process of standardization (see relational databases). To regroup this information into a database query, you can link tables using the join command. This formulates conditions for the columns in the tables involved. The inner join contains all combinations of lines from the database table determined by tabref1 with lines from the table determined by tabref2, whose values together meet the logical condition (join condition) specified using ON>cond.
    Inner join between table 1 and table 2, where column D in both tables in the join condition is set the same:
    Table 1 Table 2
    A
    B
    C
    D
    D
    E
    F
    G
    H
    a1
    b1
    c1
    1
    1
    e1
    f1
    g1
    h1
    a2
    b2
    c2
    1
    3
    e2
    f2
    g2
    h2
    a3
    b3
    c3
    2
    4
    e3
    f3
    g3
    h3
    a4
    b4
    c4
    3
    |--|||--|
    Inner Join
    A
    B
    C
    D
    D
    E
    F
    G
    H
    a1
    b1
    c1
    1
    1
    e1
    f1
    g1
    h1
    a2
    b2
    c2
    1
    1
    e1
    f1
    g1
    h1
    a4
    b4
    c4
    3
    3
    e2
    f2
    g2
    h2
    |--||||||||--|
    Example
    Output a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out:
    DATA: DATE LIKE SFLIGHT-FLDATE,
    CARRID LIKE SFLIGHT-CARRID,
    CONNID LIKE SFLIGHT-CONNID.
    SELECT FCARRID FCONNID F~FLDATE
    INTO (CARRID, CONNID, DATE)
    FROM SFLIGHT AS F INNER JOIN SPFLI AS P
    ON FCARRID = PCARRID AND
    FCONNID = PCONNID
    WHERE P~CITYFROM = 'FRANKFURT'
    AND P~CITYTO = 'NEW YORK'
    AND F~FLDATE BETWEEN '20010910' AND '20010920'
    AND FSEATSOCC < FSEATSMAX.
    WRITE: / DATE, CARRID, CONNID.
    ENDSELECT.
    If there are columns with the same name in both tables, you must distinguish between them by prefixing the field descriptor with the table name or a table alias.
    Note
    In order to determine the result of a SELECT command where the FROM clause contains a join, the database system first creates a temporary table containing the lines that meet the ON condition. The WHERE condition is then applied to the temporary table. It does not matter in an inner join whether the condition is in the ON or WHEREclause. The following example returns the same solution as the previous one.
    Example
    Output of a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out:
    DATA: DATE LIKE SFLIGHT-FLDATE,
    CARRID LIKE SFLIGHT-CARRID,
    CONNID LIKE SFLIGHT-CONNID.
    SELECT FCARRID FCONNID F~FLDATE
    INTO (CARRID, CONNID, DATE)
    FROM SFLIGHT AS F INNER JOIN SPFLI AS P
    ON FCARRID = PCARRID
    WHERE FCONNID = PCONNID
    AND P~CITYFROM = 'FRANKFURT'
    AND P~CITYTO = 'NEW YORK'
    AND F~FLDATE BETWEEN '20010910' AND '20010920'
    AND FSEATSOCC < FSEATSMAX.
    WRITE: / DATE, CARRID, CONNID.
    ENDSELECT.
    Note
    Since not all of the database systems supported by SAP use the standard syntax for ON conditions, the syntax has been restricted. It only allows those joins that produce the same results on all of the supported database systems:
    Only a table or view may appear to the right of the JOIN operator, not another join expression.
    Only AND is possible in the ON condition as a logical operator.
    Each comparison in the ON condition must contain a field from the right-hand table.
    If an outer join occurs in the FROM clause, all the ON conditions must contain at least one "real" JOIN condition (a condition that contains a field from tabref1 amd a field from tabref2.
    Note
    In some cases, '*' may be specified in the SELECT clause, and an internal table or work area is entered into the INTO clause (instead of a list of fields). If so, the fields are written to the target area from left to right in the order in which the tables appear in the FROM clause, according to the structure of each table work area. There can then be gaps between table work areas if you use an Alignment Request. For this reason, you should define the target work area with reference to the types of the database tables, not simply by counting the total number of fields. For an example, see below:
    Variant 3
    ... FROM tabref1 LEFT [OUTER] JOIN tabref2 ON cond
    Effect
    Selects the data from the transparent database tables and/or views specified in tabref1 and tabref2. tabref1 und tabref2 both have either the same form as in variant 1 or are themselves join expressions. The keyword OUTER can be omitted. The database tables or views specified in tabref1 and tabref2 must be recognized by the ABAP-Dictionary.
    In order to determine the result of a SELECT command where the FROM clause contains a left outer join, the database system creates a temporary table containing the lines that meet the ON condition. The remaining fields from the left-hand table (tabref1) are then added to this table, and their corresponding fields from the right-hand table are filled with ZERO values. The system then applies the WHERE condition to the table.
    Left outer join between table 1 and table 2 where column D in both tables set the join condition:
    Table 1 Table 2
    A
    B
    C
    D
    D
    E
    F
    G
    H
    a1
    b1
    c1
    1
    1
    e1
    f1
    g1
    h1
    a2
    b2
    c2
    1
    3
    e2
    f2
    g2
    h2
    a3
    b3
    c3
    2
    4
    e3
    f3
    g3
    h3
    a4
    b4
    c4
    3
    |--|||--|
    Left Outer Join
    A
    B
    C
    D
    D
    E
    F
    G
    H
    a1
    b1
    c1
    1
    1
    e1
    f1
    g1
    h1
    a2
    b2
    c2
    1
    1
    e1
    f1
    g1
    h1
    a3
    b3
    c3
    2
    NULL
    NULL
    NULL
    NULL
    NULL
    a4
    b4
    c4
    3
    3
    e2
    f2
    g2
    h2
    |--||||||||--|
    Example
    Output a list of all custimers with their bookings for October 15th, 2001:
    DATA: CUSTOMER TYPE SCUSTOM,
    BOOKING TYPE SBOOK.
    SELECT SCUSTOMNAME SCUSTOMPOSTCODE SCUSTOM~CITY
    SBOOKFLDATE SBOOKCARRID SBOOKCONNID SBOOKBOOKID
    INTO (CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY,
    BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID,
    BOOKING-BOOKID)
    FROM SCUSTOM LEFT OUTER JOIN SBOOK
    ON SCUSTOMID = SBOOKCUSTOMID AND
    SBOOK~FLDATE = '20011015'
    ORDER BY SCUSTOMNAME SBOOKFLDATE.
    WRITE: / CUSTOMER-NAME, CUSTOMER-POSTCODE, CUSTOMER-CITY,
    BOOKING-FLDATE, BOOKING-CARRID, BOOKING-CONNID,
    BOOKING-BOOKID.
    ENDSELECT.
    If there are columns with the same name in both tables, you must distinguish between them by prefixing the field descriptor with the table name or using an alias.
    Note
    For the resulting set of a SELECT command with a left outer join in the FROM clause, it is generally of crucial importance whether a logical condition is in the ON or WHERE condition. Since not all of the database systems supported by SAP themselves support the standard syntax and semantics of the left outer join, the syntax has been restricted to those cases that return the same solution in all database systems:
    Only a table or view may come after the JOIN operator, not another join statement.
    The only logical operator allowed in the ON condition is AND.
    Each comparison in the ON condition must contain a field from the right-hand table.
    Comparisons in the WHERE condition must not contain a field from the right-hand table.
    The ON condition must contain at least one "real" JOIN condition (a condition in which a field from tabref1 as well as from tabref2 occurs).
    Note
    In some cases, '*' may be specivied as the field list in the SELECT clause, and an internal table or work area is entered in the INTO clause (instead of a list of fields). If so, the fields are written to the target area from left to right in the order in which the tables appear in the llen in der FROM clause, according to the structure of each table work area. There can be gaps between the table work areas if you use an Alignment Request. For this reason, you should define the target work area with reference to the types of the database tables, as in the following example (not simply by counting the total number of fields).
    Example
    Example of a JOIN with more than two tables: Select all flights from Frankfurt to New York between September 10th and 20th, 2001 where there are available places, and display the name of the airline.
    DATA: BEGIN OF WA,
    FLIGHT TYPE SFLIGHT,
    PFLI TYPE SPFLI,
    CARR TYPE SCARR,
    END OF WA.
    SELECT * INTO WA
    FROM ( SFLIGHT AS F INNER JOIN SPFLI AS P
    ON FCARRID = PCARRID AND
    FCONNID = PCONNID )
    INNER JOIN SCARR AS C
    ON FCARRID = CCARRID
    WHERE P~CITYFROM = 'FRANKFURT'
    AND P~CITYTO = 'NEW YORK'
    AND F~FLDATE BETWEEN '20010910' AND '20010920'
    AND FSEATSOCC < FSEATSMAX.
    WRITE: / WA-CARR-CARRNAME, WA-FLIGHT-FLDATE, WA-FLIGHT-CARRID,
    WA-FLIGHT-CONNID.
    ENDSELECT.
    Kishore.

  • SAP Query Creation

    Hi All,
    I am creating a SAP query in the system using the tables KONP,MBEW & A018 i could join tables KONP & MBEW but i am not able to add the table A018 and a error message is displayed
    Error Message:
    Table A018 cannot be used in a join
    Message no. AQ501
    Diagnosis
    1. You cannot read the selected table with SELECT statements (because, for example, it is a structure without a database table). Therefore, this table cannot be read within a table join either.
    2. The chosen table is a pool or cluster table. These tables may not be used in a table join.
    Can anyone tell me a alternative to join this table to MBEW & KONP.
    I want this Join Conditions:
    MBEW-MATNR = A018-MATNR
    A018-KAPPL = KONP-KAPPL     
    A018-KSCHL = KONP-KSCHL     
    A018-KNUMH = KONP-KNUMH
    Thanks & Regards
    Andrew
    Edited by: Andrew J on Dec 18, 2008 2:49 PM

    hi,
    use  FOR ALL ENTRIES
    EXAMPLE:
    Exporting all flight data for a specified departure city. The relevant airlines and flight numbers are first put in an internal table entry_tab, which is evaluated in the WHERE condition of the subsquent SELECT statement.
    PARAMETERS p_city TYPE spfli-cityfrom.
    TYPES: BEGIN OF entry_tab_type,
             carrid TYPE spfli-carrid,
             connid TYPE spfli-connid,
           END OF entry_tab_type.
    DATA: entry_tab   TYPE TABLE OF entry_tab_type,
          sflight_tab TYPE SORTED TABLE OF sflight
                           WITH UNIQUE KEY carrid connid fldate.
    SELECT carrid connid
           FROM spfli
           INTO CORRESPONDING FIELDS OF TABLE entry_tab
           WHERE cityfrom = p_city.
    SELECT carrid connid fldate
           FROM sflight
           INTO CORRESPONDING FIELDS OF TABLE sflight_tab
           FOR ALL ENTRIES IN entry_tab
           WHERE carrid = entry_tab-carrid AND
                 connid = entry_tab-connid.
    REGARDS
    RAHUL

Maybe you are looking for

  • How can I print some files in ipad

    Dear tutors I am using Airport express to enjoy airplay and itunes in Hi-Fi system. My printer that doesn't support airprint is connectted to the Airport express. So I can print my file to the printer when I use window PC. Recently, I bought ipad2 an

  • How to change page orientation in Pages?

    Hi, I would like to change page orientation for Just one page inside a document. Say I have page 3 that I want to be landscape and not vertical, how can I do it? I haven't been able to find this in Pages, I found it in Word though. Any idea?

  • Got new adobe id and password,trying to load library book to nook, adobe digital ed will not open???

    got a new adobe id and password,  trying to download a lib book to my nook,  adobe digital ed won't open,  why not?  JLW

  • Occassional RMI EOFException

    Hi I am having serious trouble with an RMI exception that refuses to enter my control. The system I'm building is a game where the server has two main methods which are: //accessed from paint method public ScreenObjects getScreenObjects(Authenticatio

  • Problem with Linked Files in Cap 5.5

    Hello, I use two computers for my Cap develpoment. My laptop runs 5 and my media machine runs 5.5. The project I'm working on is being created on the media machine using 5.5 One of the screens in the 5.5 project is simply a bunch of buttons I would l