Variable selection criteria in the record selection

Variable selection criteria in the record selection with Crystal Report with SQL 2005 Server tables.
In the record selection I would like to use the value of the field u201CsSQL1u201D as part of the selection criteria instead the field name {tblReportAccessAutority.sSQL1}
The value of the field {tblReportAccessAutority.sSQL1} is {tblSalesReporting.sJEDivisionCode} = 'I'
I tried with formulas, SQL expressions, but nothing works.
Record selection of the report:
{tblReportAccessAutority.sUserID} = CurrentCEUserName
and {tblSalesReporting.sLegalEntity} = {?Legal Entity}
and {tblSalesReporting.sJEPeriod} = {?PARAM_PERIOD}
and {tblSalesReporting.sIG3rd} =  {?PARAM_IG3RD}
and {tblReportAccessAutority.sSQL1}                           <---this is the problem line
The field {tblReportAccessAutority.sSQL1} is not converted in the value:
{tblSalesReporting.sJEDivisionCode} = 'I'     
The tables tblSalesReporting and tblReportAccessAutority are joined in this report.
Many thanks for your help.
Roger

How is the syntax for the selection criteria in the record selection?
{tblReportAccessAutority.sUserID} = 'ch1scro2'
and {tblSalesReporting.sLegalEntity} = {?Legal Entity}
and {tblSalesReporting.sJEPeriod} = {?PARAM_PERIOD}
and {tblSalesReporting.sIG3rd} = {?PARAM_IG3RD}
and SELECT {@sSQL_Condition} ???????? or
and  {@sSQL_Condition} ??????? or how?
The expression fir the formula {@sSQL_Condition} is:
TOTEXT({tblReportAccessAutority.sSQL1})
The field definition for {tblReportAccessAutority.sSQL1} is nvarchar(50).
Thanks Roger

Similar Messages

  • How can i change the record selection criteria via SDK?

    Hi,
    I wanna change the record selection criteria  in rpt file in java program, What API is required?
    Thanks.
    Forest

    Hi,
    You can use RAS API to change record selection formula at runtime. Go to
    https://www.sdn.sap.com/irj/boc/index?rid=/webcontent/uuid/f0aea666-5384-2b10-ffb0-a6facef1d5e5
    and look for Report Application Server Java SDK Feature Samples. It contains the record selection change code.
    Thanks
    Aasavari

  • Why can't I select or update the Record using the PreparedStatement?

    the DB is oracle9i,here is the test table
    test
    id number;
    name char(10);
    intro char(10);
    I have insert a record in the table.
    Now I will select or update the record by using the PreparedStatement here is my code:
    sqlStr = "update test set intro = ? where name =?";
    PreparedStatement stmt = conn.prepareStatement(sqlStr);
    stmt.setString(1,"my name is irixwang");
    stmt.setString(2,"irixwang");
    int is = stmt.executeUpdate();
    if (is >=1 )
    System.out.println("ok");
    It will not work ,but where I change the update condiction as followed:
    sqlStr = "update test set intro = ? where id =?";
    PreparedStatement stmt = conn.prepareStatement(sqlStr);
    stmt.setString(1,"my name is irixwang");
    stmt.setInt(2,100);
    int is = stmt.executeUpdate();
    It works well,why?
    please help me!thk!!!!

    I doubt it works "well" in either case since you are inserting a string that is longer than 10 characters into a field that only holds 10 characters. But to your question....
    A char data type holds a fixed number of characters - in your case 10.
    Because it holds 10 characters it will never hold 9, regardless of what you think is in the field it will always have 10 characters in it. The value you are using for query for name is 9 characters. Since 9 characters, regardless of content, will never be equal to 10 characters there is no way that it will update.
    So your choice is to either use a varchar, which holds a variable number of characters, or to always use 10 characters for your query (pad it with spaces.)

  • How to use a subreport field as selection criteria for the main report

    Dear All,
       I created a report with one subreport and im comparing information from both reports but i need to apply selection criteria in the main report using one of the fields in the subreport, the problem is that the subreport field doesnt appear in the select expert screen. By any chance, someone knows how make a subreport field be used by the select expert.
    Thanks,
    Martha Medrano

    Dear Dom,
       I created the subreport table called IIM (748 items) in sql in the main report as you suggested with the below code:
    SELECT "IIM"."IPROD", "IIM"."IDESC", "IIM"."IID"
    FROM   "S102F360"."BPCS405CDF"."IIM" "IIM"
    WHERE   NOT ("IIM"."IDESC" LIKE 'GEN%' OR "IIM"."IDESC" LIKE 'OBS%') AND "IIM"."IID"<>'IZ' AND "IIM"."IPROD" LIKE '3%'
    and i have another table called ITEM_MASTER (3221 items):
    SELECT "ITEM_MASTER"."ITEM_ID", "ITEM_MASTER"."DESCRIPTION"
    FROM   "WHSPRO"."dbo"."ITEM_MASTER" "ITEM_MASTER"
    ORDER BY "ITEM_MASTER"."ITEM_ID"
    and im trying to display all items in the ITEM_MASTER table that are not in the IIM file but i haven't been able to accomplish this, i am using as primary the ITEM_MASTER table with 'Inner Join' as Join Type,  and '!=" as Link Type. Do you have any ideas on how can i display the requested items.
    Thanks for your help

  • Database DLL error on editing the record selection formula?

    Post Author: Aravind
    CA Forum: Older Products
    Hi All,I recently edited the record selection formula of an old report and since then the report is issuing me an "Error detected by database DLL" error.The report was running fine earlier and still continues to run fine if I undo the changes. Earlier, the records were selected based on a 'date' field and I edited the formula to select records based on another date field, but the report doesn't work.The report runs fine on my local PC using Crystal Reports, but web based reporting fails with the error message. The data is selected from a view and the date parameters I talked about are the fields in the same view.This view has around five date parameters and the report runs fine for all of them, except one date field.Any pointers are appreciated.Crystal reports version is 8.5. Regards,Aravind.

    Post Author: DPowell
    CA Forum: Older Products
    Ah, yes, the good old generic date error.
    The problem is likely an invalid date value in one (or all) of your records with that field.  You don't say what database engine you are connected to or which driver you are using for the report, but I'll give you some "pointers".
    Basically, the SQL fetch has encountered an error in your date field and the driver you are using in the report can't handle it.
    A null date could cause that problem.  Also a date-time field with an invalid value or truncated time value.  A robust ODBC driver, like one of the Microsoft drivers might be able to overcome it.  Likewise, vendors frequently release updated drivers to improve error handling just like this.
    1.  Analyze your data, specifically the contents of the "new" date field you are using for some kind of invalid date.
    2.  Experiment with different ODBC drivers by creating alternate ODBC connections to the same database using different ODBC drivers.
    3.  Browse and experiment with options in Crystal Reports Properties that allow you to specify data conversions for NULLs and Dates.
    Good luck !

  • Navigational Attrribute of 0plant in Selection criteria of the Report

    Dear ALl,
    We are facing an issue where we ares entering the inputs for Report Selection Criteria
    plant
    fiscal year period
    currency type &
    company code ( company code is the navigation attribute of the plant )
    When we enter plant, fiscal year period & currency with out company code we get the output. But when we enter the value for company code it doesnt shwo the data it shows no applicable data found.
    hence i would like to understand whetther we can use the company code which is the navigation attribute of the plant in the selection screen of the report via a variable?
    If yes why is my report showing no applicable data found. Request your suggestion on  this.
    Thanks & Regards
    K janardhan Kumar

    Hi Janardhan,
    Please check if your Plant Master data is loaded as well.
    Another check you can do is, when you run the report only on Plant, Fiscper and currency, drill down on Company Code (which is attribute of Plant) and see the values you get there. That might give you a hint.
    Also, you can check if for the company codes you enter while selection, is there transactional data present for the corresponding Plant.
    Other than this, its perfectly alright to use a navigational attribute as selection filter in the report.
    Thanks,
    Abhishek.

  • How I input selection criteria to the FM F4IF_INT_TABLE_VALUE_REQUEST

    Hi,
    i implemented one FM 'F4IF_INT_TABLE_VALUE_REQUEST' in my program to show F4 help.
    in that i given  MULTIPLE_CHOICE        = 'X' for multiple line selection, i got the desired output there is no problem with that.
    but i want to show the F4 help screen with some of the record already selected.
    For example.
    we have NAME as search help(values HARI,MADHU,RANI,SINDHU) ,
    at first i selected HARI and MADHU, and then when i press F4 again i need HARI and MADHU as already selected.
    Reg,
    HARIHARAN

    Hi Hariharan,
    Please use the Mark_tab parameter of the FM F4IF_INT_TABLE_VALUE_REQUEST as below.
    data: MARK_TAB TYPE DDSHMARKS.
    data: mark like line of mark_tab.
    mark = '2'.
    append mark to MARK_TAB.
    *-- Call fucntion for search help
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = l_retfld
    dynpprog = sy-repid
    dynpnr = sy-dynnr
    dynprofield = l_dynfld
    MULTIPLE_CHOICE = 'X'
    callback_program = sy-repid
    MARK_TAB = mark_tab
    TABLES
    value_tab = l_i_value
    field_tab = l_i_fields
    return_tab = l_i_return
    EXCEPTIONS
    parameter_error = 1
    no_values_found = 2
    OTHERS = 3.
    IF sy-subrc 0.
    MESSAGE i000
    WITH 'No search help found'(090) .
    ENDIF.
    Regards,
    Amit.

  • How to get the record selected in ztable based record in the output of alv

    Hi All,
    I have developed a report, it is displaying the output in ALV format.The list contained some 20 fields along with MATERIAL and BATCH. I have provided menu bar as extras -> ztable(it also contained MATERIAL and BATCH). But I have some issue when I select any record in the output then go to
    path extras -> ztable, it has to select the record in ztable based MATERIAL and BATCH which i have selected in the output, then can you please provide solution for the above problem.
    Thanks in advance

    Hi Dolly,
    you can do this by,
    data: index_rows type lvc_t_row,
          index like line of index_rows.
    * Get Selected rows from alv grid
      clear index_rows.  refresh index_rows.
    "When you choose extras->ztable
      call method alv_grid->get_selected_rows
               importing
                     et_index_rows = index_rows.
    * Now delete those rows from the ALV grid
      loop at index_rows into index.
        read table itab index index-index. "Lets say itab is the table you are displaying
        if sy-subrc = 0.
         perform bdc_sm30. "do simple bdc for sm30 with tab name and selected values
        endif.
      endloop.
    Regards,
    Manoj Kumar P
    Edited by: Manoj Kumar on Feb 23, 2009 2:49 PM

  • Populate variable 2 according to the value selected in variable 1

    Hello BW Experts,
    I have two variables sales area vsarea and sales org vsorg.
    eg: data:
    sales area area1 contains
        1) sales org org1
        2) org2
    sales area area2 contains
        1) org3
        2) org4
    req:
    first the user selects the values in the vsarea area1. then when he comes to select the variable vsorg it should show only show org1, org2. it should not show org3 and org4.
    possible solutions:
    -- 1) is this possible using the variable exit ?
    please suggest any solutions for the above problem.
    Thanks,
    BWer

    thanks for the suggestion.
    however what I wanted to do is somewhat different.
    variable selection sequence:
    sales area then sales org
    1) variable 1: sales area: user selects 1000 for sales area
    2) variable 2: sales org: I should only show 1001, 1002, 1003 sales org, which belong to 1000 sales area
    please suggest if there is already a solution for this.
    Thanks,
    BWer

  • How to add same name records from datagrid,while i am selecting one of the record and click add butt

    hi  friends,
    i  am doing flex 4 mxml web application with as3,i am struck up in the following  concept,shar your suggession about this.
    i am using datagrid with 3 columns NUMBER, NAME, AMOUNT. one text box and one add button and one delete button.
    i have two records in the same name in grid, when i click one record from the grid and click ADD button means that time ,both records  AMOUNT WILL ADDED   which record having the same name and give that value in a text box.
    how to do this?
    any useful suggesssion or modal sample
    Thanks in advance,
    B.venkatesan.

    hi gajanan hiroji,
    Thanks for the useful help.
    And one more think i want ask you, i am doing web application, i am using 5 modules in that,every module in a single page.
    In this application i am using datagrid in last 3 models. the operation is same for the models, select a record from grid then click post it should move to next page.
    In that i am writting init() function . this for showing the last module posted records here while i am entering this model.
    At the panel initializing time the records loading and showing in the gird,
    i written refresh function for this .
    But some times the function working properly and show the records in grid.
    some time it wont show the records.
    refresh function not working properly..
    looking for usful suggession,
    Thanks,
    B.venkatesan.

  • TVARVC variables not showing in the variant selection

    Hi,
    My client want to use the TVARVC table to maintain the settlement period. So everymonth, the variant for the settlement run will retrieve the settlement period from this table.
    I was following the instruction:
    1. run tcode STVARVC
    2. Create a new variable SETT_Period_Current
    3. Put 9 as the value for now.
    then I used the SE38 to create a variant. In the attribute screen, I put "T" in the field "Selection Variables". Then when I selected the dropdown list of the field "Name of Variables", I did not find the variable "SETT_Period_Current" in the list. I don't know what went wrong.
    Can anyone shed some lights on this?
    Thanks,
    Ting

    Please check this link
    http://help.sap.com/saphelp_nw70/helpdata/en/c0/980386e58611d194cc00a0c94260a5/frameset.htm

  • How do we capture the record selected in the table control?

    Hi,
      In the table control when the user selects a record we need to capture that record and pass it to the next screen.how can we do this?
    Thanks,
    Rakesh.

    Hello
    First of all you need a 'mark' column in your TC structure.This should be char1.
    This column has to be put into the TC Attributes as mark column.
    Then to get back the info from the TC go the following way:
    PAI
    loop at <fs_it> .               "Field symbol of your table.
        MODIFY <fs_it> FROM wa_basic
        INDEX tc_maintenance-current_line.
    endloop.
    Message was edited by:
            Werner Gerbert

  • The Record select is excluding rows

    The following record select formula, is not showing rows which we want to see. The user passes a month and year param and then we show the not sold
    for that month year as well as the previous month.
    However, we do want to show rows that did not sell for the entire year and even years back. This formula is only showing the rows that had some sales in the past 2years. It's better use for management to see all items not selling also years back to the last sale.
    if {?Month}=1 then
        (({SUMPRT.IQA01} =0  and {SUMPRT.IQYER#} = {?Year}) and ({SUMPRT.IQA12} =0  and {SUMPRT.IQYER#} = {?Year}-1))
    else if {?Month}=2 then
        ({SUMPRT.IQA01} =0 and {SUMPRT.IQA02} =0 ) and {SUMPRT.IQYER#} = {?Year}
    else if {?Month}=3 then
        ({SUMPRT.IQA02} =0 and {SUMPRT.IQA03} =0 ) and {SUMPRT.IQYER#} = {?Year}
    else if {?Month}=4 then
        ({SUMPRT.IQA03} =0 and {SUMPRT.IQA04} =0 ) and {SUMPRT.IQYER#} = {?Year}
    else if {?Month}=5 then
        ({SUMPRT.IQA04} =0 and {SUMPRT.IQA05} =0 ) and {SUMPRT.IQYER#} = {?Year}
    else if {?Month}=6 then
        ({SUMPRT.IQA05} =0 and {SUMPRT.IQA06} =0 ) and {SUMPRT.IQYER#} = {?Year}
    else if {?Month}=7 then
        ({SUMPRT.IQA06} =0 and {SUMPRT.IQA07} =0 ) and {SUMPRT.IQYER#} = {?Year}
    else if {?Month}=8 then
        ({SUMPRT.IQA07} =0 and {SUMPRT.IQA08} =0 ) and {SUMPRT.IQYER#} = {?Year}
    else if {?Month}=9 then
        ({SUMPRT.IQA08} =0 and {SUMPRT.IQA09} =0 ) and {SUMPRT.IQYER#} = {?Year}
    else if {?Month}=10 then
        ({SUMPRT.IQA09} =0 and {SUMPRT.IQA10} =0 ) and {SUMPRT.IQYER#} = {?Year}
    else if {?Month}=11 then
        ({SUMPRT.IQA10} =0 and {SUMPRT.IQA11} =0 ) and {SUMPRT.IQYER#} = {?Year}
    else if {?Month}=12 then
        ({SUMPRT.IQA11} =0 and {SUMPRT.IQA12} =0 ) and {SUMPRT.IQYER#} = {?Year}

    hi Paul,
    if you've got a situation where your query is not bringing back all combinations of the records that you want, and no combination of table joins (e.g. left outer or right outer) and record filter syntax gives you the results you need, then you may want to start thinking about creating a command object or stored procedure that produces / brings back those records.
    so, if your database does not include a value for product A sold in january 2014, then you may need to manufacture that record.
    this particular blog post will show you 3 different methods of bringing back product & month combinations.
    i hope this helps,
    jamie

  • The possibility to upload a selection criteria in the Web

    Hi ,
    When using the Bex Analyser as an Add-on for Excel ( BI 7.0 ) , the standaard selection screen of the SAP environment is being used. In this selection screen you will be able to copy the content of your clipboard in the selection screen or you will be able to upload a file to the selection screen. ( In order to avoid long retyping work ).
    Unfortunately, you will not be able to do the same thing in the web application ( Analyser ). And this is just the thing we want to realise. You can only enter and select entries for filling in the selection screen.
    Has anyone ever had this problem (or need) and created a solution for this ?
    Kind regards,
    Hans

    Hi ,
    When using the Bex Analyser as an Add-on for Excel ( BI 7.0 ) , the standaard selection screen of the SAP environment is being used. In this selection screen you will be able to copy the content of your clipboard in the selection screen or you will be able to upload a file to the selection screen. ( In order to avoid long retyping work ).
    Unfortunately, you will not be able to do the same thing in the web application ( Analyser ). And this is just the thing we want to realise. You can only enter and select entries for filling in the selection screen.
    Has anyone ever had this problem (or need) and created a solution for this ?
    Kind regards,
    Hans

  • How to  create a Select in Formula Workshop - Record selection editor

    In the Formula Workshop u2013 Record Selection Formula Editor I am trying to write a formula to exclude certain customer ids. Iu2019m getting errors when I click the Check formula button. The statement is below, any suggestions?
    I dont think I can use the Select statement in crystal as you would in SQL but how should I write it in crystal format?
    not in (select { STATISTICS.custid} from  
        where { STATISTICS.date_reg} >= '27-may-2011' and { STATISTICS.date_reg} < '30-sep-2011')

    Hi,
    You can try the below logic:
    STATISTICS.date_reg} >= '27-may-2011' and { STATISTICS.date_reg} < ' 27-June-2011'
    I guess you are trying to apply this condition.
    Here in selection formula you need not to give select and from.
    Cheers,
    Kiran

Maybe you are looking for