SELECT SINGLE weird behaviour

Hi Experts,
I have written the following query to pick up the address no. In case, there are multiple entries found in table ADRC according to my WHERE clause condition, the query returns the first address no out of those multiple address nos in one system 'A' whereas it returns the last address no. in similar situation in a different  system B.
SELECT SINGLE addrnumber
                name1
                sort1
                street
                house_num1
                city1
                region
                post_code1
                INTO wa_customers
                FROM adrc
                WHERE sort2       EQ 'ABC'
                AND addr_group EQ 'XY'.
Any idea why the same query is behaving differently in two system?
Thanks.

Hi,
as we should have learned in RDBMS and SQL basic classes ;o) the order of rows returned by a select statement is not defined as long as there is no ORDER BY definition in the statement. As SELECT SINGLE internally gets all records and then takes the first record of the result set, it is not defined which record is returned.
So even if you run a statement on the same system several times the returned record can be fully random. That it is not always completely random is more a random technical effect of the algorithms and access strategies the data base implements within the frame defined by the DB/SQL standards. So nothing is garanteed the next DB patch could change the behavouir completely if the data base implements a new algorithm. So do not trust in such not defined, not documented and not garanteed system behaviour.
From the implementation aspect I'd personally prefer a SELECT * INTO TABLE followed by a READ TABLE INDEX 1. The select single w/o full primary key and with ORDER BY bypasses the table buffers and should be slower. If the statement should always return one line there is no need for sorting the table. If there should be one line and two are returned the data is inconsistent, sorting for a certain record won't make this any better. Here I would add an assertion that only one record was found so the application stops if data is corrupt and someone takes care of correcting the data.
Best Regards
Roman

Similar Messages

  • Error and weird behaviour in executable launch

    Hello folks,
    This post is regarding a weird behaviour i am experiencing with an executable i built. 
    LABVIEW version(Includes Runtime engine) LV2012 SP1 f3
    DAQmx: 9.6.1
    The behaviour is listed below in detail. 
    In a nutshell, the exectuable runs on the development computer but does not run on the Target computer. Also, Irresepctive of which PC i run the executable on, i cannot access the block diagram even after enabling debugging everywhere. 
    On the target PC, the app fires up but does not run further, no error codes appear on the screen, it's like the app freezes after firing up. And to add to the misery, i cannot access the block diagram to debug and know what's going on. 
    Also, I have tried including the dynamic vis to my build script. No bueno. 
    What I see on running the app is addressed below:
    TARGET COMPUTER:
    DAQmx 9.7 and LV2012 SP1 f4 RTE have been installed manually.
    App does not run: No broken run button, the app launches but does nothing when the vi is run. No error messages.
    The block diagram is still inaccessible, even after selecting the “Enable debugging” option in the build specifications.
    DEVELOPMENT COMPUTER:
    The app launches and runs perfectly.
    The block diagram is still inaccessible, even after selecting the “Enable debugging” option in the build specifications.
    DAQmx 9.7 and LV2012 SP1 f4 RTE were not installed as the app recognized the already installed Labview environment.
    Additional steps that I have tried,
     Created and ran only an executable on the target PC, the attempt was unsuccessful. The vi showed similar characteristics as mentioned above in the target PC section.
     Created and ran an installer with additional install options(LV2012 f4 RTE and DAQmx 9.7)on the target PC, the attempt was again unsuccessful. The vi showed similar characteristics as mentioned above in the target PC section.  No error messages.
     Tried both the steps mentioned above on the development computer and the attempts were successful. .
    To the best of my knowledge, I believe, the issue here is with the environment I am creating for the executable and the installer to run with/off of. After having carefully followed the installation procedure for the Run-Time Engine and the DAQmx drivers, I still do not know what I am missing. 
    Please advise.
    Thanks guys, 
    RP.

    Hey guys, 
    So, got the application to work. Almost. 
    The problem was that the executable was missing the hardware config from the Device. 
    Now, the new issue is as following: 
    The goal of the vi is to generate a report of the test conducted. So, the way the vi works is that, the second the vi is run, an empty word file is created with only the company logo,  
    Field headings, which are populated after the test is conducted. 
    The logo is a .jpg file, which has a relative path into the executable.
    The field heading are String constants wired into a 'concatenate strings.vi' which are in turn wired to into the report generation vis.
    What's happening is that when i run the app on the target pc, Only the logo appears on the word template. Even when i conduct the whole test and stop the vi, the results aren't populated in the word file. Which is a little weird.
    Does any one know whats doing that?
    Please refer to the attached word files.
    Right - It is the file format desired. 
    Wrong - It is the file format achieved. 
    Please advise.
    Thanks,
    RP. 
    Attachments:
    Right.docx ‏17 KB
    Wrong.docx ‏16 KB

  • Weird behaviour in the Fontbook display pane

    I have just been checking through some font conflicts using FontBook. All have resolved successfully, but I have noticed weird behaviour involving four or five fonts. Some of them show up as all-Cyrillic faces (Arno Pro), or all-Hebrew faces (Stone Sans) or all-Arabic faces (Balzano) in the display pane, yet print perfectly as Western characters when used in any program (Pages, Word, Bean, FCE, Keynote etc).
    It's not actually causing any problem, I suppose, apart from a weird representation in Fontbook. I have tried deactivating and reactivating these fonts. I have tried quitting and restarting Fontbook. I have even tried restarting the computer. The Cyrillics, Hebrews and Arabics keep coming back.
    Is this a known Fontbook bug, or am I doing something wrong?

    Thank you, Kappy and Tom:
    I tried the Preview Repertoire command and it showed that the fonts did, indeed, have the full Latin complement of characters. It's just that only the Cyrillic/Hebrew/Arabic/Gujarati/Mandarin selections are showing up in some fonts' preview panes: particularly those fonts with the suffix "Pro" in the title (Myriad Pro, and so on).
    How strange.

  • Mail / Exchange 2013 weird behaviour?

    I’m hoping someone here can help with weird behaviour from Mail which is driving me nuts. It doesn’t appear to be the same problem as the odd Exchange behaviour described in other threads. It appeared about a month back, and I had made no changes to my software or hardware at that time.
    I have the latest version of OSX Mail in Mavericks, set up with an Exchange 2013 and iCloud mail accounts. There are no extensions or add-ons running. I have two Macs and two iOS devices on these accounts, all fully updated. The problems exist regardless of which devices are powered up at any one time. Mail is set to download messages automatically.
    On both of the Macs I get the same following problems:
    - When new messages arrive, the mailbox notifier indicates the new messages, but they are not shown in the message list. If I select the ‘Exchange’ inbox they are visible, and remain so when I switch back to the combined ‘Inbox’.
    - When I select the ‘Exchange’ inbox, rather than the combined ‘Inbox,’ then after 30 seconds or so the ‘From’ field in the message list changes to ‘To’, so all the senders are shown as my email address.
    - The entire send/receive function seizes up half a dozen times a day, necessitating a Force Quit to restart the app.
    iOS devices work just fine.
    Is this in fact the same as the reported Exchange problems, or have I got something else going wrong here? I’ve tried deleting and recreating the account, and also had my hosted Exchange provider take a look, to no avail.
    Many thanks,
    Tobes

    Hi Ivan,
    It is really an odd issue. Working for a while, then crash.
    According to your description, I found that we suspect it is a certificate issue.
    If this issue really related to the certifcate mismatch or something additional, it shouldn't connect to Exchange server, even just for a while (As we
    encountered).
    I suggest double check our ECP VD configuration and Authentication method. Steps as below:
    1. Please try to re-build ECP Virtual Directory, commands as below:
    a. To remove current ECP VD:
    Remove-EcpVirtualDirectory -Identity "Server01\ecp (default Web site)"
    b. To check whether the Remove operation completed successfully:
    Get-EcpVirtualDirectory -Server Server01
    c. To create a new ECP VD:
    New-EcpVirtualDirectory -Server SERVER01 -ExternalURL https://mail.contoso.com/ecp -InternalURL
    https://mail.contoso.com/ecp
    2. Please verify that the Microsoft Forms Based Authentication service is running on all Exchange servers.
    a. To check:
    Get-EcpVirtualDirectory -Server <server name> | fl *auth*
    b. To enable:
    Set-EcpVirtualDirectory -Identity "Server01\ecp (default Web site)" -FormsAuthentication
    $true
    3. Please also make sure the remote apps are all installing the trusted certificate.
    4. Please also collect detailed App logs or error message in event viewer for the further troubleshooting.
    Maybe I have not enough experiences, I am not sure whether the logs above that we provided is useful. Maybe others have different opinions.
    Hope it is helpful
    Thanks
    Mavis
    Mavis Huang
    TechNet Community Support

  • MPB + 24" LED, weird behaviour after disconnect

    When using my MPB in combination with my 24"LED (single screen setup), everything works perfectly. When I disconnect, the resolution drops to the maximum resolution of my MPB. This drop in resolution results in weird behaviour of application windows, expose (corner activation) and spaces.
    Expose does not work anymore, seems like it still thinks there is a larger resolution, so putting my mouse pointer in the corner will not activate expose or any other corner function.
    Spaces does not slide anymore, again it seems like it expects a larger desktop to slide which is not there anymore. The display flashes and skips to the next desktop.
    Windows can not be resized because the sizing corner (lower right) is outside of the current screen area. So to be able to resize my applications, I have to resize them to small before I disconnect the 24"LED screen.
    Solutions tried:
    1) System preferences > Displays > Detect displays... Does not work
    2) System preferences > Displays > Lower resolution > Normal (max) resolution : Works like a charm
    3) Logout > Login : Also works
    Does anyone else know how to make this work the way it should? So far it seems the programming (Leopard) is faulty.

    AVrublevskiy
    I agree that, at times, the SGE switches can be somewhat difficult when getting them in and out of stack mode. I would recommend getting them back to the config that they had before you tried to remove them from a stack, then configure them via the serial cable back to factory defaults. The pinout for the cable can be found here.
    There is also a little, round, red hole at the bottom left of the switches face plate that allows you to factory reset the device. You should use a paper clip and hold it for a full 30 seconds.
    These switches are designed to either be stacked or not, meaning they are not supposed to be put in and taken out of stacked mode at random. By default, the switches try to stack together, and do not work well when the stack gets broken up or changed. I sincerely suggest you pick either stacked or standalone and leave them as such.
    As a side note, there is a newer firmware available for this switch. It is version 3.0.0.18. It can be found here.
    Please report any new problems.
    Bill

  • Diff b/w select single * .... and select....up to 1 row

    Hi Abapers,
    What is the diff b/w Select single * from.... and select * ...up to 1 row.
    Thanks in advance.
    Subbu.

    Select SINGLE...
    SINGLE
    The result of the selection should be a single entry. If it is not possible to identify a unique entry, the system uses the first line of the selection. If you use the FOR UPDATE addition, the selected entry is protected against parallel updates from other transactions until the next database commit (see LUW and database lock mechanism). If the database system identifies a deadlock, a runtime error occurs.
    ... UP TO n ROWS
    Effect
    The set of results is restricted to a maximum of nrows.
    Example
    To output a list of the 3 business customers with the greatest discount:
    DATA WA_SCUSTOM TYPE SCUSTOM.
    SELECT * FROM SCUSTOM INTO WA_SCUSTOM UP TO 3 ROWS
             WHERE CUSTTYPE = 'B'
             ORDER BY DISCOUNT DESCENDING.
      WRITE: / WA_SCUSTOM-ID, WA_SCUSTOM-NAME, WA_SCUSTOM-DISCOUNT.
    ENDSELECT.
    Notes
    If you use an UP TO n ROWS addition in an ORDER-BY clause , the lines read are sorted into the correct order. The first n lines are then displayed. The system may need to read more than n lines from the database to be able to do this.
    If n = 0, all selected lines are displayed.
    n < 0 results in a runtime error.
    <b>Knowing when to use SELECT SINGLE or SELECT ... UP TO 1 ROWS</b>
    A lot of people use the SELECT SINGLE statement to check for the existence of a value in a database. Other people prefer to use the 'UP TO 1 ROWS' variant of the SELECT statement.
    <b>So what's the difference between using 'SELECT SINGLE' statement as against a 'SELECT .... UP TO 1 ROWS' statement ?</b>
    If you're considering the statements
    SELECT SINGLE field INTO w_field FROM table.
    and
    SELECT field INTO w_field FROM table UP TO 1 ROWS. ENDSELECT.
    then looking at the result, not much apart from the extra ENDSELECT statement. Look at the run time and memory usage and they may be worlds apart.
    Why is this ?? The answer is simple.
    The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
    The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
    Get the difference ??
    If not, here is a good example, credit for this example goes to Richard Harper, a friend of mine on sapfans.com :
    Create a Ztable called ZDifference with 2 fields in it, MANDT of type MANDT and POSNR of type POSNR. Make sure both of these are keys. Also create a table maintenance dialog for it (SE11->Utilities->Table Maintenance Generator). Fill the table with ten rows 000001-000010.
    Then run the program shown below:
    Report Z_Difference
           Message-id 38
           Line-Size  80
           Line-Count 0
           No Standard Page Heading.
    Start-Of-Selection.
      Data: w_Single type Posnr,
            t_Rows   type standard table of Posnr
                     initial size 0
                     with header line.
      Select single Posnr
        from zDifference
        into w_Single.
      Select Posnr
        into table t_Rows
        from zDifference
       up to 1 rows
       order by Posnr descending.
       Write :/ 'Select single:', w_Single.
       Skip 1.
       Write :/ 'Up to 1 rows :'.
       Loop at t_Rows.
            Write t_Rows.
       EndLoop.
    You should see the output:
    Select single: 000001
    Up to 1 rows : 000010
    The first 'SELECT' statement selected the first record in the database according to any selection criterion in the 'WHERE' clause. This is what a 'SELECT SINGLE' does. The second 'SELECT' has asked the database to reverse the order of the records before returning the first row of the result.
    In order to be able to do this the database has read the entire table, sort it and then return the first record. If there was no ORDER BY clause then the results would have been identical (ie both '000001') but the second select if given a big enough table to look at would be far slower.
    Note that this causes a problem in the Extended Program Check if the full key is not specified in a 'SELECT SINGLE'. Replacing the 'SELECT SINGLE' by an "UP TO 1 ROWS" will give the same exact results without any warning but the program will run slower and consume more memory. This is a good example of a warning that we should ignore... considering you are sure of what you are doing !!
    Message was edited by:
            Judith Jessie Selvi

  • Difference between Select *    and Select single     ?

    difference between Select *    and Select single     ?

    HI,
    DATA : IT  TYPE TABLE OF MARA,
               WA TYPE MARA.
    Here it selects all the record and keeps in internal table it.
    Select  *  from mara into corresponding fields of table <b> it</b>.
    Here it slects only one record that to first record.
    If you wnat any specific record then use where condition.
    Select  single *  from mara into corresponding fields of <b>wa</b>.
    Message was edited by:
            Purshothaman P

  • Select single row in ALV grid

    ABAPer's ,
    Does anyone can guide me to select single row only in ALV grid , without OO.

    Hello,
    I did not get u.
    But check the below code it may help u.
    tables: mara.
    TYPE-POOLS: SLIS.
    data:repid like sy-repid.
    data: itb type mara occurs 0 with header line,
    IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV WITH HEADER LINE,
    IT_LAYOUT TYPE SLIS_LAYOUT_ALV,
    ITB1 TYPE MAKT OCCURS 0 WITH HEADER LINE.
    selection-screen begin of block b.
    parameters: p_matnr type matnr.
    selection-screen end of block b.
    select * from mara into table itb where matnr = p_matnr.
    SELECT * FROM MAKT INTO TABLE ITB1 WHERE MATNR = P_MATNR.
    repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = repid
      I_CALLBACK_PF_STATUS_SET       = ' '
       I_CALLBACK_USER_COMMAND        = 'HANDLE_USER_COMMAND'
       I_STRUCTURE_NAME               = 'MARA'
       IS_LAYOUT                      = IT_LAYOUT
       IT_FIELDCAT                    = IT_FIELDCAT[]
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        t_outtab                       = itb
    EXCEPTIONS
      PROGRAM_ERROR                  = 1
      OTHERS                         = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    FORM HANDLE_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE
    SLIS_SELFIELD.
    CASE R_UCOMM.
    WHEN '&IC1'.
    CLEAR IT_FIELDCAT[].
    IF RS_SELFIELD-FIELDNAME = 'MATNR'.
    READ TABLE ITB1 INDEX RS_SELFIELD-TABINDEX.
    WRITE: / ITB1-MAKTX.
    ENDIF.
    ENDCASE.
    ENDFORM. "HANDLE_USER_COMMAND
    Regards

  • Performance on Select Single&Write  AND Select*(For All Entries)&Read&Write

    Hi Experts,
    I got a code review problem & we are in a argument.
    I need the best performance code out of this two codes. I have tested this both on 5 & 1000 & 3000 & 100,000 & 180,000 records.
    But still, I just need a second opinion of experts.
    TYPES : BEGIN OF ty_account,
            saknr   TYPE   skat-saknr,
            END OF ty_account.
    DATA : g_txt50      TYPE skat-txt50.
    DATA : g_it_skat    TYPE TABLE OF skat,       g_wa_skat    LIKE LINE OF g_it_skat.
    DATA : g_it_account TYPE TABLE OF ty_account, g_wa_account LIKE LINE OF g_it_account.
    Code 1.
    SELECT saknr INTO TABLE g_it_account FROM skat.
    LOOP AT g_it_account INTO g_wa_account.
      SELECT SINGLE txt50 INTO g_txt50 FROM skat
        WHERE spras = 'E'
          AND ktopl = 'XXXX'
          AND saknr = g_wa_account-saknr.
      WRITE :/ g_wa_account-saknr, g_txt50.
      CLEAR : g_wa_account, g_txt50.
    ENDLOOP.
    Code 2.
    SELECT saknr INTO TABLE g_it_account FROM skat.
    SELECT * INTO TABLE g_it_skat FROM skat
      FOR ALL ENTRIES IN g_it_account
          WHERE spras = 'E'
            AND ktopl = 'XXXX'
            AND saknr = g_it_account-saknr.
    LOOP AT g_it_account INTO g_wa_account.
      READ TABLE g_it_skat INTO g_wa_skat WITH KEY saknr = g_wa_account-saknr.
      WRITE :/ g_wa_account-saknr, g_wa_skat-txt50.
      CLEAR : g_wa_account, g_wa_skat.
    ENDLOOP.
    Thanks & Regards,
    Dileep .C

    Hi Dilip.
    from you both the code I have found that you are selecting 2 diffrent fields.
    In Code 1.
    you are selecting SAKNR and then for these SAKNR you are selecting TXT50 from the same table.
    and in Code 2 you are selecting all the fields from SAKT table for all the values of SAKNR.
    I don't know whats your requirement.
    Better you declare a select option on screen and then fetch required fields from SAKT table for the values entered on screen for SAKNR.
    you only need TXT50 and SAKNR fields.
    so declare two types one for SAKNR and another for TXT50.
    Points to be remember.
    1. while using for all entries always check the for all entries table should not be blank.
    2. you will have to fetch all the key fields in table while applying for all entries,
        you can compare key fields with a constant which is greater than initial value.
    3. while reading the table sort the table by the field on which you are going to read it.
    try this:
    TYPES : BEGIN OF ty_account,
    saknr TYPE skat-saknr,
    END OF ty_account.
    TYPES : begin of T_txt50,
          saknr type saknr,
          txt50 type txt50,
    end of t_txt50.
    DATA: i_account type table of t_account,
          w_account type t_account,
          i_txt50 type table t_txt50,
          w_txt50 type t_txt50.
    select SAKNR from SKAT into table i_account.
    if sy-subrc = 0.
    sort i_account by saknr.
    select saknr txt50 from SKAT into table i_txt50
    for all entries in i_account
    where SAKNR = i_account-SAKNR
    here mention al the primary keys and compare them with their constants.
    endif.     
    Note; here you need to take care that, you will have to fetch all the key fields in table i_txt50.
    and compare those fields with there constants which should be greater than initial values.
    they should be in proper sequence.
    now for writing.
    loop at i_account into w_account.
    clear w_txt50.
    sort i_txt50 by saknr.
    read table i_txt50 into w_txt50 with key SAKNR = w_account-saknr
    if sy-subrc = 0.
    write: w_txt50-saknr, w-txt50-txt50.
    clear w_txt50, w_account.
    endif.
    endloop.
    Hope it wil clear your doubts.
    Thanks
    Lalit

  • "select count(*)" and "select single *" returns different result

    Good day!
    product version SAP ECC 6.0
    oracle10
    data transfers from external oracle db into customer tables using direct oracle db link
    sometimes I get case with different results from 2 statements
    *mytable has 10 rows
    *1st statement
    data: cnt type I value 0.
    select count( * ) into cnt from mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
    *cnt returns 10 - correct
    *2nd statement
    select single * from  mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
    *sy-dbcnt returns 0
    *sy-subrc returns 4 - incorrect, 10 rows are "invisible"
    but
    1. se16 shows correct row number
    2. I update just one row from "invisible" rows using se16 and 2nd statement returns correct result after that
    can not understand why
    thank you in advance.

    Thank you, Vishal
    but,
    general problem is that
    1. both statements have the same WHERE conditions
    2. 1st return resultset with data (sy-dbcnt=10), 2nd return empty dataset, but must return 1 in sy-dbcnt
    Yes, different meaning, you are right, but must 2nd must return 1, because of "select single *" construction, not 0.
    Dataset to process is the same, WHERE conditions are equal...
    I think the problem is that how ABAP interperets select count(*) and "select single *".
    Maybe "select count (*)" scans only PK from index page(s)? and "select single *" scans data pages? and something is wrong with that?
    I'm new in SAP and didn't find any SAP tool to trace dump of data and indexes pages with Native SQL.
    se16 shows all records.
    And why after simple manual update of just one record using se16 "select single *" returns 1?
    I've just marked one row to update, didn't change any data, then pressed "save".

  • Error in Select single statement

    Hi All,
    Following is the statement and error message im getting:
    Can anyone help me with this. I am not able to figure out whats wrong with this.
    <b>select SINGLE *
      from  vbrk where  vbeln eq iv_billno.</b>
    <u>Error:</u>
    The INTO clause is missing at SELECT, or the FROM addition at either DELETE, INSERT, MODIFY, or UPDATE is missing.          
    Thanks & Regards,
    Megha

    Program always needs a work area to store the values retrived from your select statement. Either you declare that work area as TABLES: VBRK or DATA: wa_vbrk LIKE VBRK.
    If you use the first option, then you don't need to do anything but it is an obsolete statement.
    If you use the second option, then you should change your select statement as follows
    SELECT SINGLE * FROM vbrk
                    INTO wa_vbrk
                   WHERE vbeln EQ iv_billno.

  • Is it not possible to give the select single field without an into clause

    Hi,
    i have to check whether my input value( only one filed) is available in the table.
    for eg i need to check whether company code is available in the table t001.
    then i will give .
    data lv_bukrs type t001-bukrs.
    lv_bukrs = 1010.
    select single bukrs from t001 where bukrs = lv_bukrs.
    here its asking for me to give a vaible to store the bukrs that is
    select single bukrs into dummyvalue from t001 where bukrs = lv_bukrs.
    Is it not possible to give the select single fieldname without an into clause

    Its Possible by declaring the tables statement
    <b>tables : AFKO.
    select single * from AFKO where <condition>.</b>
    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. The addition ORDER BY can also 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.
    Notes
    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.
    If accessing tables for which SAP buffering is planned for single records, the SAP buffer is bypassed if the addition SINGLE is not specified. This behavior depends on the current implementation of the database interface and may change in future releases. In particular, it should not be used to bypass the SAP buffer. You should use the explicit addition BYPASSING BUFFER for this instead.
    The addition SINLGE is not permitted in a subquery.
    Regards
    - Gopi

  • How to get option select single Values in select options

    Hello All,
    I have a requirement where, in select-options i should avoid the range selection and should have only select single values option. User wanted to give the list of 10000 materials by using copy and paste as we have in normal abap with pase clip board option.
    Please let me know if you need any further clarification. your quick response would be highly appreciated.
    Thanks
    Raj.

    Thanks for the reply, I have already done this but when you add values to it at a time 1000 material information we can not add.
    so you go to selection screen and you have only one input box with arrowe button. click on the arrow and then you will get the screen where it will ask you to add five records and that to ranges.
    but if you click the same arrow in normal selection screen of SAP you get 4 tabs in which first tab will be select single values.
    and there by using copy from notepad option we can add how many entries we want.
    Let me know if you need any further clarification to understant the requirement.
    Thanks,
    RaJ.

  • Problem with SELECT SINGLE

    hi
    can you find any error in this
    select single * from makt where matnr = p_matnr and spras = 'sv'.

    Hi,
    Use like this.
    data: BEGIN OF it_makt OCCURS 0,
    matnr LIKE maKT-matnr,
    maktx LIKE makt-maktx,
    END OF it_makt.
    data: process_tab_struct_tmp like IT_MAKT.
    field-symbols: <fs1>.
    after downloading file(excel) to excel_tab....code follows
    LOOP AT EXCEL_TAB.
    assign component excel_tab-col of structure
    process_tab_struct_tmp to <fs1>.
    <fs1> = excel_tab-value.
    at end of row.
    move-corresponding: process_tab_struct_tmp to IT_MAKT.
    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
    EXPORTING
    INPUT = <b>it_makt-matnr</b>
    IMPORTING
    OUTPUT = <b>it_makt-matnr</b>.
    append IT_MAKT.
    endat.
    ENDLOOP.
    Do reward points to useful answers.
    Regards,
    Atish

  • Select Single * is not fetching all Data

    Hi,
    I have a peculiar problem, when i am extending the customer to a new company code, we are getting Dump saying 'ASSERTION_FAILED'
    when i debugg i am geeting issue with following Code of a FM 'KNA1_SINGLE_READER'
    IF NOT i_bypassing_buffer IS INITIAL.
        *SELECT SINGLE * FROM kna1*
                        INTO o_kna1
                        WHERE kunnr = i_kunnr.
        IF sy-subrc <> 0.
          MESSAGE e300(vs) WITH 'KNA1' RAISING not_found.
        ENDIF.
    i am passing customer number (i_kunnr), this code is executed 2 times first time it is fetching all columns but second time it is only fetching customer number and no other information regarding customer. But in data base all information is present. Can any one help me in this.
    Thanks a lot...
    Reddy
    Edited by: JAGAN MOHAN REDDY on Jun 2, 2010 11:30 AM

    Hi Jagan,
    It'll be helpful to others if you can please post how and what was done to resolve the issue.
    Thanks!
    Sandeep

Maybe you are looking for

  • Mail App Crashes Immediately

    I've read through the many posts of similar problems but none seems to be exactly the problem or cause that I'm having, as the suggested solutions haven't solved this issue for me. When I launch Mail.app, it hangs for a bit (spinning beach ball) and

  • Windows Gallery error 0x8007000b - restoring libraries does not fix

    I suddenly started receiving this error and photo gallery won't open.  Deleting the folder and restoring to default worked the first few times, but now that doesn't work.  Oddly if I sign in under the other account on the computer photo gallery will

  • How to mention encoding in servlet.

    Hi How to mention encoding in servlet. Regards Arghya Banerjee

  • SQL Loader and Oracle 11g

    Hello, Im receiving an sqlldr: not found error. Im getting ready to talk with our System Admin about the situation. Before I do I wanted to make sure that SQL Loader (sqlldr) is an available add-on for the Oracle 11 client. A co-worker mentioned that

  • GR/ IR ready for payment

    Hi Experts, When IR and GR are different, payment will be blocked by SAP. After then need to use MRBR to release this block for payment release. Could we set up a configuration to let system automatically release GRIR various lower than 5%? If it is