No records selected - SELECT clause with IN

Hello ABAP Experts
1st CASE:
When I execute program below and leave selection screen for S_VBELN and S_ERDAT blank and leave P_AUART to 'PR00", it returns SY-SUBRC = 4. 
I get no lines returned.
2nd CASE:
If I comment out the last 2 lines in my "WHERE" clause of my SELECT, so now my select statement is like this:
        select vbeln erdat auart knumv from vbak into table gt_vbak
              where vbeln in S_VBELN.
and leave selection screen for S_VBELN and S_ERDAT blank and leave P_AUART to 'PR00",
I get lines.  I can even enter a specific order and it will only return that one.
Can someone explain why my SELECT statement in CASE 1 is not working?
REPORT  YTEST4.
tables: vbak.
SELECT-OPTIONS: S_VBELN for VBAK-VBELN,
                                 S_ERDAT for VBAK-ERDAT.
PARAMETERS:      P_AUART like vbak-auart default 'PR00' obligatory.
data: begin of gt_vbak occurs 0,
         vbeln like vbak-vbeln,
         erdat like vbak-erdat,
         auart like vbak-auart,
         knumv like vbak-knumv.
data: end of gt_vbak.
START-OF-SELECTION.
  select vbeln erdat auart knumv from vbak into table gt_vbak
        where vbeln in S_VBELN
           and erdat in S_ERDAT
           and auart  = P_AUART.
  loop at gt_vbak.
    write:/ gt_vbak-vbeln, gt_vbak-erdat, gt_vbak-auart, gt_vbak-knumv.
  endloop.

HI,
The data format in p_auart may be wrong..
try this way
REPORT YTEST4.
tables: vbak.
SELECT-OPTIONS: S_VBELN for VBAK-VBELN,
S_ERDAT for VBAK-ERDAT,
<b>s _AUART for vbak-auart obligatory no-extension no intervals</b>.
data: begin of gt_vbak occurs 0,
vbeln like vbak-vbeln,
erdat like vbak-erdat,
auart like vbak-auart,
knumv like vbak-knumv.
data: end of gt_vbak.
initialization.
s_auart-low = 'PA00'.
s_auart-opt  = 'I'.
s_auart-sign = 'EQ'.
append s_auart.
START-OF-SELECTION.
select vbeln erdat auart knumv from vbak into table gt_vbak
where vbeln in S_VBELN
and erdat in S_ERDAT
<b>and auart in s_AUART.</b>
loop at gt_vbak.
write:/ gt_vbak-vbeln, gt_vbak-erdat, gt_vbak-auart, gt_vbak-knumv.
endloop.
Thanks
mahesh

Similar Messages

  • Select clause with where part is needs 600 times longer to complete

    Hello.
    I have two select clauses one with where, which needs 120 seconds to complete and one without where, which completes in 0,3 seconds. I want to know why is that.
    120 seconds
    SELECT B.* FROM
    (SELECT A.OLOG, MCL_ISPROTOCOLALLOWED('LMOD', 'MCLI', A.OPRG) ALLOWED FROM  (SELECT DISTINCT OLOG, OPRG FROM FLOG WHERE FIRM = '001') A) B WHERE B.ALLOWED = '1' ORDER BY OLOG;0,3 seconds
    SELECT B.* FROM
    (SELECT A.OLOG, MCL_ISPROTOCOLALLOWED('LMOD', 'MCLI', A.OPRG) ALLOWED FROM  (SELECT DISTINCT OLOG, OPRG FROM FLOG WHERE FIRM = '001') A) B ORDER BY OLOG;Table FLOG has arround 270000 records, but only 40 of them are distinct.
    IsProtocolAllowed checks if user has a permision to view the record.
    Thank you for your help.
    Regards,
    Borut Ojcinger
    Edited by: 993896 on 14.3.2013 7:24

    Hi,
    welcome to the forum.
    Please read SQL and PL/SQL FAQ
    If you have a performance issue have a look at SQL and PL/SQL FAQ
    Additionally when you put some code or output please enclose it between two lines starting with {noformat}{noformat}
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Help implementing mouse multi record select deselect with shift/ctrl click

    Forms 10.1.2.3 on Solaris Sparc 64 bit
    We are trying to implement mouse multi record select/deselect using shift and ctrl click. I have read that you need the appcore library to do this but because we aren't using Oracle Applications (EBS) we can't have the appcore library.
    Has anyone implemented this function without the appcore library?
    Thanks

    Why not just use a CheckBox to indicate the selected records? The downfall to almost all methods is that you end up looping through the block to see which records are selected. An alternative to this is to use a record group to record which the selected records. I created a nice little wrapper package to work with Record Groups (RG). Take a look at Forms - Record Group Processing (Duplicate Value Checking). As the name suggests, this example demonstrates how to use an RG to perform duplicate checking, but you can easily adapt the process to keep track of selected records. I use RG's for this all the time. By using the RG, it eliminates the need to LOOP through the datablock - which can be very time consuming. Instead, you loop through the RG and only navigate to the specific records you need too in order to process that record. Looping through the RG is much faster than looping through the block - especially if you have a lot of records displayed in your block.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • A record selection problem with a string field when UNICODE database

    We used report files made by Crystal Reports 9 which access string fields
    (char / varchar2 type) of NON-UNICODE database tables.
    Now, our new product needs to deal with UNICODE database, therefore,
    we created another database schema changing table definition as below.
    (The table name and column name are not changed.)
        char type -> nchar type
        varchar2 type -> nvarchar2 type
    When we tried to access the above table, and output a report,
    the SQL statement created from the report seemed to be wrong.
    We confirmed the SQL statement using Oracle trace function.
        SELECT (abbr.) WHERE "XXXVIEW"."YYY"='123'.
    We think the above '123' should be N'123' because UNICODE string
    is stored in nchar / nvarchar2 type field.
    Question:
    How can we obtain the correct SQL statement in this case?
    Is there any option setting?
    FYI:
    The environment are as follows.
        Oracle version: 11.2.0
        ODBC version: 11.2.0.1
        National character set: AL16UTF16

    With further investigating, we found patterns that worked well.
    Worked well patters:
        Oracle version: 11.2.0
        ODBC version: 11.2.0.1
        National character set: AL16UTF16
        Report file made by Crystal Reports 2011
        Crystal Reports XI
    Not worked patters:
        Oracle version: 11.2.0 (same above)
        ODBC version: 11.2.0.1 (same above)
        National character set: AL16UTF16 (same above)
        Report file made by Crystal Reports 2011 (same above)
        Crystal Reports 2008 / 2011
    We think this phenomenon is degraded behavior of Crystal Reports 2008 / 2011.
    But we have to use the not worked patters.
    Anything wrong with us? Pls help.
    -Nobuhiko

  • Issue in select query with where clause

    Hi guys,
    I'm facing an issue while using select query with the where clause. When I'm selecting all the data from the table it returns the correct result. But when I'm using the where clause to get the specific rows from the table it returns no rows. But the data I'm trying to fetch using the where condition exists in the table.
    Here is my query which causing the issue,
    select * from mytable where myfield = 'myvalue'
    But if I use the following query it returns the result correctly.
    select * from mytable
    Also the myfield value 'myvalue' exists in the table.
    I have tried by running this query in both SQL Developer and SQL Plus. I have tried this query in mssql as well. It works perfectly and returns correct result sets for both the queries I have mentioned above. I'm unable to predict the issue as I'm new to ORACLE. Please help.
    Thanks,
    Ram.

    Hi Ram,
    I experienced an issue similar to this with a varchar2 field. Some of our records had a hidden newline character at the end of them, which was making queries like the one below fail:
    select * from employees
    where email = '[email protected]'The best way I found to detect this was to use
    select 'XX'||email||'XX' from employeesTo make sure that there were no newlines. But that is just a guess. If you could provide some example table data and the outputs of your selects, it would be helpful.
    Jeff

  • Parsing an input parameter for the where clause or record select value

    In my limited CR experience, I've always used a command database connection so that I can write my own SQL.  However, now I have to parse a  pipe delimited parameter to get my value for the where clause, so I'm selecting several tables and joining them through the Database Expert Links tab.  All works fine, but after doing that and then parsing the parameter with the below formula in the Select Expert, I notice that there is no where clause in the SQL query, and although the report eventually displays the proper values, it runs through thousands of records first.  Here is my Select Expert - Record formula:
    StringVar array Parm1;
    Parm1 := Split({?DATA_AREA}, "|");
    {SO_ORDERS.CASE_ID} = Parm1[2]
    If I change "Parm1[2]" on the last line to a valid Case ID, then there is a where clause in the SQL and the report generates immediately. 
    It seems like the record select formula is applied AFTER all of the records (without a where clause) are searched when I use the parsed parameter value, but when I hard code a valid value, it places that into the where clause BEFORE the sql is executed.  Is there a way to get the parameter parsed first and then use that parsed value in the SQL where clause?
    Thanks.
    Bill

    Yes crystal will run the query first to get 100% data and then applies record selection condition. To increase the performance you need to pass the where condition at the command level instead of report level. So you need to create a report using add command like this
    select * from tablename where field={?Parameter}
    {?Parameter} is a command level parameter.
    Now insert this report as a subreport in another report which has no connection but has a parameter
    {?DATA_AREA} and create a formula like this in the main report
    Split({?DATA_AREA}, "|")[2]
    Now right click on the subreport and go to change subreport links and add this formula from main report and link this to sub report parameter {?Parameter} without linking any database field from the subreport.
    Now your subreport runs with the where clause to get the data.
    Regards,
    Raghavendra

  • Select clause inside a Procedure with cursor

    Good Moring guys,
    I run into a problem that is giving me serious troubles.... I have a Select clause:
                  SELECT count(*)
                 FROM TD004_ENT_ORGAO_UO TD004
                 WHERE TD004.CODG_ENTIDADE = 1121742
                 AND TD004.NUMR_ANO_EXERCICIO = 2011
                 AND TD004.CODG_ORGAO = 02
                 AND TD004.CODG_UO = 001
    My table is empty and this query returns a count = 0, so far so good but, when I'm using this same query inside a Procedure that implements a cursor, I'm implementing a way of controling when to or not insert the records of this cursor in my table:
    OPEN cDIMENSAO;
    LOOP
           FETCH cDIMENSAO INTO EXERCICIO, CODG_ORGAO, NOME_ORGAO, CODG_UO, NOME_UO, CODG_ENTIDADE, SK_ENTIDADE;
           EXIT WHEN cDIMENSAO%NOTFOUND;
           begin
                 v_count := 0;
                 SELECT count(*) into V_COUNT
                 FROM TD004_ENT_ORGAO_UO TD004
                 WHERE TD004.CODG_ENTIDADE = CODG_ENTIDADE
                 AND TD004.NUMR_ANO_EXERCICIO = EXERCICIO
                 AND TD004.CODG_ORGAO = CODG_ORGAO
                 AND TD004.CODG_UO = CODG_UO;
                 IF V_COUNT = 0 THEN
                    INSERT INTO APLIC.TD004_ENT_ORGAO_UO(SK_ENT_ORGAO_UO, NUMR_ANO_EXERCICIO, CODG_ORGAO, NOME_ORGAO, CODG_UO, NOME_UO, CODG_ENTIDADE, SK_ENTIDADE, DATA_CARGA)
                    VALUES (APLIC.SK004_ENT_ORGAO_UO.NEXTVAL, EXERCICIO, CODG_ORGAO, NOME_ORGAO, CODG_UO, NOME_UO,CODG_ENTIDADE,SK_ENTIDADE,v_data_carga);
                    COMMIT;
                 END IF;
    The problem occurs here, my v_count controler just returns 1 even if the record isnt inside my table, is like the Where clasue is being ignored. What can be done ??
    I'm using the Oracle XE 11g.
    Thnks all.

    See below. Where clause will never ignore any condition
    Note: you need handle null values  specially
    SQL>
    SQL> select * from v$version;
    BANNER                                                                         
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production   
    PL/SQL Release 11.2.0.2.0 - Production                                         
    CORE 11.2.0.2.0 Production                                                     
    TNS for Linux: Version 11.2.0.2.0 - Production                                 
    NLSRTL Version 11.2.0.2.0 - Production                                         
    SQL>
    SQL> set serveroutput on;
    SQL>
    SQL> DECLARE
      2     CURSOR c1
      3     IS
      4        WITH dmn
      5             AS (SELECT 1 col1, 'TEST' col2, NULL col3 FROM DUAL
      6             UNION ALL
      7                 SELECT 2 col1, 'TESTING' col2, 'COL3' col3 FROM DUAL
      8              UNION ALL
      9                 SELECT 3 col1, 'TESTING123' col2, 'COL3' col3 FROM DUAL
    10                )
    11        SELECT *
    12          FROM dmn;
    13 
    14     v_col1    VARCHAR2 (10);
    15     v_col2    VARCHAR2 (10);
    16     v_col3    VARCHAR2 (10);
    17     v_count   NUMBER;
    18  BEGIN
    19     OPEN c1;
    20 
    21     LOOP
    22        FETCH c1
    23        INTO v_col1, v_col2, v_col3;
    24        EXIT WHEN c1%NOTFOUND;
    25 
    26           WITH txn
    27             AS (SELECT 1 col1, 'TEST' col2, NULL col3 FROM DUAL
    28                 UNION ALL
    29                 SELECT 2 col1, 'TESTING' col2, 'COL3' col3 FROM DUAL
    30                )
    31        SELECT COUNT (*)
    32          INTO v_count
    33          FROM txn
    34         WHERE  col1 = v_col1
    35               AND col2 = v_col2
    36               AND nvl(col3,'##') = nvl(v_col3, '##');
    37 
    38           DBMS_OUTPUT.put_line ('V_count = ' || v_count);
    39        IF v_count = 0
    40        THEN
    41           DBMS_OUTPUT.put_line ('Insert is processed for ' || v_col1);
    42        ELSE
    43           DBMS_OUTPUT.put_line ('Insert is Ignored for ' || v_col1);
    44        END IF;
    45        v_count := 0;
    46     END LOOP;
    47  END;
    48  /
    V_count = 1                                                                    
    Insert is Ignored for 1                                                        
    V_count = 1                                                                    
    Insert is Ignored for 2                                                        
    V_count = 0                                                                    
    Insert is processed for 3                                                      
    PL/SQL procedure successfully completed.
    Thanks,
    GPU

  • Record Selection doesn't work with VS 2005 & CR 2008

    Hi all,
    Recently I installed CR 2008 with Service Pack 1 and integrate with Visual Studio 2005. I converted all the CR reports to CR 2008 while opening the VS project which was created earlier.
    My problem is when I load the Crystal report via created application, record selection formula doesn't work instead it shows all records. But in designing time it works fine. Reports which designed with SQL Server Stored Procedure working fine. But reports which designed by adding Tables don't work. It shows all the records without record selection.
    I used simple Record selection formula without using any parameter fields. like this
    tTransactionDetails.acid} = 1
    . still it didn't work.
    When I put break point and see assigned values in Report Document object. It shows
    Function evaluation timeout
    . and then run, it do the record selection. I did this several times, all the time if I see assigned values in Report Document object then the report showed the selected records only otherwise it shows all the records.
    I tried this just running the application exe, still the problem remaining.
    I have saved the reports without the data, so that it will always load the data from the SQL database.
    Please help me to solve this problem.

    Sorry i couldn't do search before I posted the thread. After posted, I just did a search and found the solution by reading [this thread|https://forums.sdn.sap.com/click.jspa?searchID=20348355&messageID=6774564|https://forums.sdn.sap.com/click.jspa?searchID=20348355&messageID=6774564].
    As it has suggested, I just delete the existing Crystal Report Viewer Control from the form and add it again by clicking on CrystalReportViewer version 12.0.2000.0. It worked.

  • Select query with UNION clause in database adapter

    Friends,
    I have got a SQL query with two UNION clause withing it. like
    select a,b,c
    from a
    union
    select a,b,c
    from b
    The schema generated is like below in sequence
    <element>a</element>
    <element>b</element>
    <element>c</element>
    <element>a</element>
    <element>b</element>
    <element>c</element>
    So, the columns from different select queries joined with UNION clause are all appeared in schema instead of the distinct columns.
    Is there any way around to solve this issue ? or will need to with DB function/procedure.

    I think I know what you are saying but your example doesn't make sense, your SQL should produce something like
    I had to change a, b, c with elementA, elementB, elementC as a and b are reserved html tags.
    <elementA>DateA</elementA>
    <elementB>DataB</elementB>
    <elementC>DataC</elementC>
    ...What is the result of the query when you run it in SQLPlus? Is it what you expect?
    cheers
    James

  • Problems with query with more than 20 values in the select clause

    I have a region based on a function returning a SQL query. It needs to have more than 20 values in the select clause. When I run the page I get a no data found error in the region. I managed to reproduce this behavior with just the following as the select returned by the function:
    select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21
    from dual
    I am running the 1.3.9.00.15 release of Marvel on 9.2.0.2 of the db on Solaris.

    Hello Raju,
    I will email you the connection settings when I return to the office.
    One thing I should have mentioned: The sql string is returned from a package in the db, so the query region text I originally posted isn't quite correct.
    it is something like:
    declare
    begin
    return my_pkg.my_fnc;
    end;
    the stored package is nothing more than:
    package my_pks is
    funtion my_fnc(i_test_param in varchar2) is
    begin
    return 'select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20, 21 from dual';
    end;
    end;
    Sorry for the inaccurate info in the first post, but I am away from the server in question right now.

  • Slow record selection in tableView component with large number of records

    Hi experts,
    we have a Business Server Page (flow logic) with several htmlb:inputField's. As known from SAP standard we would like to offer value helper (F4) to the users for the ease of record selection.
    We use the onValueHelp() method of the inputField to open a extra browser window through JavaScript. In the popup another html-website is called, containing a tableView component with all available records. We use the SINGLESELECT mode for the table view.
    Everything works perfect and efficient, unless the tableView contains too many entries. If the number of possible entries is large the whole component performs very very slow. For example the selection of the record can take more than one minute. Also the navigation between pages through the buttons at the bottom of the component takes a lot of time. It seems that the tableView component can not handle so many entries.
    We tried to switch between stateful and stateless mode, without success. Is there a way to perform the tableView selection without doing a server-round-trip? Any ideas and comments will be appreciated.
    Best regards,
    Sebastian

    Hi Raja,
    thank you for your hint. I took a look at sbspext_table/TableViewClient.bsp but did not really understand how the Java-Script coding works. Where is the JavaScript code in that example? Which file, does it contain.
    Meanwhile I implemented another way to evite the server round trip.
    - Switch page mode of the popup window to "Stateful"
    - Use OnInitialization method like OnCreate (as shown in [using OnInitialization like OnCreate])
    - Limit the results of the SELECT statement with UP TO 1000 ROWS
    Best regards,
    Sebastian

  • Help with dynamic datasource and record selection

                                                                                                                                                                                                                                                                                     <span>Hi, I&#39;m having some difficulty with part of an application I&#39;m trying to build, but here&#39;s some background first.<br /> <br /> I am a student at the University of Maryland, and I&#39;m writing an application for one of the departments here at the university.  It is sort of a front-end for an access database with a lot of extra functionality.  This includes reports.  First of all, the user can change the databse that the application uses, so I store that in an appsetting.  For this reason, I have to tell the report what database to use at runtime rather than using the database expert.  I am building a sort of report wizard in which the user selects certain values, and based upon those values, the SQL statement that the report gets data from changes.  So almost everything about the report&#39;s data is dynamic and will be determined at runtime.  <br /> <br /> So for example if the user chooses an officer report by chapter names, I do this (chapters is a comma delimited string):<br /> <br /><span style="font-weight: bold"> string sel = "SELECT * FROM [Undergrad Leadership] WHERE [Leadership Position] = &#39;" + txtPosition.Text + "&#39; AND [Chapter Name] IN (" + chapters + ");";</span><br /> <br /> The part I am lost on, is how to actually interface with crystal reports.  In the following code, conn is an OleDbConnection to the correct database, rep is the ReportDocument, and view is a CrystalReportsViewer.<br /> <br /><span style="font-weight: bold"> rep.DataSourceConnections[0].SetConnection(conn.DataSource, conn.Database, false); <br /> rep.RecordSelectionFormula = sel;</span><br /><span style="font-weight: bold"> view.ReportSource = rep;</span><br /> <br /> When I try to load the report, I get the following error message:<br /> Error in formula <Record Selection>:  a number, currency amount, boolean, date, time, date-time, or string is expected here.<br /> <br /> Also, assuming this formula gets fixed, how do I actually get fields from this formula and datasource onto my report, since I can&#39;t do it at design time?  Thanks in advance for the help.<br /> <br /> -Jared<br />    </span>

    <p>RCAPI (Report Creation and Modification) calls are only available with Crystal Reports Server RAS SDKs.  This means that using the bundled version of Crystal Reports for Visual Studio will not allow you to place fields onto the report.  A free copy of Crystal Reports Server comes with a registered copy of Crystal Reports Developer.  My guess is that you don&#39;t have either of these products and that you are just using the product that came with Visual Studio.</p><p>All is not lost.  The first question is, do you really need to add the fields at runtime?  In many cases developers just want to have control of the data that gets sent to the report and they are ok with having the same fields display.</p><p>In your code you are changing the datasource which is fine, and you are assigning a Record selection formula which is also fine.  </p><p>The problem with the record selection is that it doesn&#39;t fit the syntax of the Report.  I would suggest printing out the value that you programatically get for the formula and insert it into the Crystal Report Designer.  You will probably get the same error there and gets some  hints as to why it doesn&#39;t work.</p><p>What I would suggest is creating a template report that already has the fields on the report and then change its datasource at runtime and add a RecordSelectionFormula.</p><p>Otherwise you will have to use RAS to be able to add fields at runtime. </p><p>Rob Horne<br /><a href="/blog/10">Rob&#39;s blog - http://diamond.businessobjects.com/blog/10</a></p>

  • Access Web Database - Select record and make report with all associated records

    Hey everyone,
    Right now I'm in the middle of trying to convert an Access client database to be web compatible and I'm running into some problems. For this question, I think I may need to explain a little bit about the database:
    The database I'm making is designed to store information about music rights for different songs. The users can input information about writers, producers, organizations, properties, businesses - which is stored all in different related tables. Then, when a
    user inputs a song, they choose which writers, produces, organizations, etc. are affiliated with that song. 
    What I'm trying to do is make a report where you can choose a writer from the list of all the writers and then produce a report with all of the songs by that writer. 
    I was able to do this in the Access client by making a report that, when opened would trigger (using the On Open event) a form to open where you would choose a writer from a combo box and then click a button. When the button was clicked, it would use the value
    in the combo box in a query, which would find all of the songs by that writer and then open up the report which would have the writer and all of their songs on it. 
    Because web reports don't have many event options and web queries are very limited, I have not found a way to make this report.
    Any help at all would be greatly appreciated!

    Hi,
    I found that you've cross post the quesion on our Answer forum, are you satisfiled the reply from there?
    http://answers.microsoft.com/en-us/office/forum/office_2010-access/web-database-select-record-and-make-report-with/04ce4e25-a964-4146-9a34-f9cb26bb0496
    Regards,
    George Zhao
    TechNet Community Support

  • Crystal 2008 problem with Record Select Expert

    I had a Crystal 10 report that worked fine where the Record Select Expert had a database table ID equal to a parameter... it was only supposed to report on 1 record.  After using Crystal 2008 on the same report it completely ignores this Select Record Expert setting.  I have tried deleting and re-adding the parameter.  It acts like there is no record select setting.
    Here is the formula that it shows me it is using:    {Components.ID} = {?@ID}
    If I go to the application opening the same record on a different machine using the old crystal, it works fine.
    This used to only show me the 1 record, now it shows me the report on every record in the table.  I tried upgrading the report to a 2008 report and it still does the same thing.  The report filter no longer works.   Do I need to do something different to select only 1 record in 2008 ?
    After installing Crystal 2008 on my computer none of my reports work correctly anymore - all of them are ignoring my Record Select ...they worked fine before I installed 2008.  The reports are older reports... they worked fine when I had Crystal XI R2 installed.  This all started after installing Crystal 2008
    Thanks,
    Jeff
    Edited by: Jeff Dressing on Aug 27, 2008 12:06 PM

    Hello, Jeff;
    I noticed the Record Selection Formula uses a Stored Procedure parameter:
    {Components.ID} = {?@ID}
    A parameter created in the report (not by a stored procedure) would be:
    {Components.ID} = {?ID}
    A report based on a Stored Procedure does not need a Selection formula for the Stored Procedure parameter. Connecting to the Stored Procedure automatically creates the parameter in the report and the value is passed automatically when the report is run.
    Does the report work in the Crystal Reports 2008 designer?
    Open the report in the designer. Go to Database Set Datasource location. Are the properties of the database at runtime still the same as what is saved in the report.
    If the database is different at runtime, just as a test, change to the new database in a copy of your original report. Do a Database|Verify Database. Does it come back the "Database is uptodate" or are there changes?
    Elaine

  • Pushing record selection to database.

    I am using a Crystal report for bursting through publication.
    My requirement is to filter the report on a date field where the report picks up all the records that were updated since u2018last report refresh dateu2019 (datadate function)
    I am trying to use record selection to filter the records like-
    {Query.modifyDt}>datadate
    1.      I get the desired results but I believe this is acting like a report level filter since I canu2019t see the where clause in u2018Show SQLu2019 under database menu.  I am using Crystal report 2008 with a universe based on Teradata.
    2.     When I use the direct tables/views instead of a universe I can see the where clause in the SQL which indicates that the filtering is being pushed to the database.
    Is the u2018pushing record selection to databaseu2019 available with universe connection?  OR  only when direct tables are used?
    I also noticed that in the formula editor, the u2018SQL expression fieldsu2019 is not available when I use universe.  Are there any drivers that I could be missing or which needs an update. (ODBC Driver For Teradata Version: 12.0.0.2)
    Thanks in advance for your help!
    Girish
    Edited by: girishks11 on Sep 26, 2011 8:55 PM

    Hi Girish,
    When reporting off a Universe,the record selection is done locally unless of course, you've defined filters at the Universe level.
    So, to push 'most' of the record selection to the database, I would suggest that you connect directly to the database.
    And to clear some air about SQL Expressions, you can indeed write a SQL Expr in CR to fetch a single field not more!
    -Abhilash

Maybe you are looking for