How to use lexical parameter in report

i want to use lexical parameter in report and pass parameter from form how it is possible in detail
A.R

Hi,
typically you fill your lexical paramter in the after-paramform-trigger out of the values of your bind-parameters (giving end users directly control over lexical parameters might not be a good idea). Inside PL/SQL a lexical parameter is referenced like bind parameters with ":". In the query it's referenced via "&" and represents a part of the query.
A simple example.
- p_deptno as bind parameter
- p_where as lexical paramter
- end user choose value for p_deptno (10,20,... or nothing)
- Trigger: if :p_deptno is not null then
:p_where := 'WHERE deptno = :p_deptno'
else
:p_where := null;
end if;
- Query select ... from emp &p_where
Regards
Rainer

Similar Messages

  • HOW TO USE LEXICAL PARAMETER IN FORMS9I

    CAN I USE LEXICAL PARAMETER IN FORMS9I I WANT TO CREATE QUERY LIKE THIS
    SELECT * FROM &TABLE_NAME
    WHERE &CHOICE
    WHERE &TABLE_NAME = EMP, AND &CHOICE EMPNO=12344
    PLS HELP

    No, you can do it in sqlplus or reports but not in forms.
    If this is a datablock query you need to use set_block_property.
    If it is in a trigger you need to use execute immediate.

  • How to use a parameter  of a report program from selection screen in a dialog program

    how to use a parameter value(entered ) of a report program from a selection screen in a dialog program.
    I have to fetch the value entered in the parameter of report program and display it in a dialog program

    Hi Aasim,
    Just mention like below in your ABAP report.
       PARAMETERS: p_aufnr TYPE aufnr MEMORY ID ord.
    and mention the same memory ID name in the module pool screen property it automatically populates the value to and fro

  • How to use a parameter of a report program in a dialog program

    how to use a parameter of a report program in a dialog program.
    I have to fetch the value entered in the parameter of report program and display it in a dialog program

    Hi Aasim,
    Just mention like below in your ABAP report.
       PARAMETERS: p_aufnr TYPE aufnr MEMORY ID ord.
    and mention the same memory ID name in the module pool screen property it automatically populates the value to and fro

  • How to use a parameter in a report program in a dialog program

    how to use a parameter in a report program in a dialog program

    Hi Shaikh,
    Post it in http://scn.sap.com/community/abap
    "ABAP Development".
    sree

  • How to use dynamic parameter when a report is created using Stored Procedures

    Hi all,
    any one have the idea of how to use dynamic parameter in crystal report XI R2
    when report is created using Stored Procedure.
    Regards
    shashi kant chauhan

    Hi
    You can create an SQL command in Database Expert > Expand your datasource > Add command
    Then enter the SQL query that will create the list of values to supply to the user
    eg select field1,field2 from table
    Then edit the parameter of the report.  These will be the SP parameters adn can be seen in field explorer.
    Change the parameter type to Dynamic
    Under the word Value click on Click here to add item
    Scroll down to your Command and select one of the values that you want to appear in the list
    e.g field1
    Then click on the Parameters field - this is essential to create the param
    You can edit other options as required
    That should do it for you.
    I must say that i use CR 2008 connected to Oracle 10g SP, but i reckon this will work for SQL DB and CR XI as well
    Best of luck

  • How can I pass parameter from report to form?

    Hi :)
    Now I try to build conference room like this by using form
    and report. And i design that when users click at group report
    then i'll show page that contain questions report and add
    question form. And question form and report must receive the
    same parameter from group report.
    First Problem: is I don't know how group report send the
    same parameter to question report and add question report at the
    same time. And is it possible??? If not please suggest me what
    should I do???
    Second Problem: is I don't know how can I pass parameter from
    report to form. I don't know the way to do it.
    Please tell me!!! Please...
    I look forward to hearing from all of you.
    Thank You.

    One way is to create a link based on that form and attach that
    link with the report. Through links you can pass parameters

  • Lexical Parameter in report 10g

    i want to call a report with few fields on my form. i create 2 user parameter which works fine. now i want to create a lexical parameter so that if null no problem report should appear with 2 user parameters but if has values then report should be called according to those parameter values.
    I use this in my form:
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'PBRANCHCODE='||:txtBranchCode||' PPERIOD='||:cmbPeriod||' CLASSCONDITION='||'cla_class_id between 1 and 2'||' paramform=no');
    CLASSCONDITION is a lexical parameter which is called in report sql:
    and periodic_branch_id = :pBranchCode
    and periodic_period_from = :pPeriod
    &ClassCondition
    it says unable to run report
    when i test using paramform=no then it shows in classcondition parameter only and and nothing after space assuming parameter list ended.
    Please help me in passing a lexical parameter to report
    Thanx in advance.

    I want to append the where condition of the report. if values inputed from Form in the class ids from and to text boxes appended as a where condition in the report query otherwise excluded
    Report Query
    select *
    from ...
    where
    and .....
    and ....
    &ClassCondition
    and i want to pass &classcondition parameter the below condition
    and class_id between :fromclass and :toclass
    Hope you understand.

  • How to pass page parameter to report portlet ?

    Portal: 9.0.4
    RDBMS: 9.0.1.5.0
    OS: Windows
    REF: How to pass page parameter to report portlet ?
    Hi,
    I create a Oracle Report as a Portlet in Portal (create Report Definition File Access and check on the option "Publish As Portlet" in the on the last step). My report has an "Additional User Parameter" and I has let it "Visible to user".
    When I put this portlet in my Portal page, I can see this parameter in the property/parameters of this page. However I cannot transfer my page parameter to this portlet parameter. Other portlets in this page (non-Oracle-Report portlets) are working fine with my page parameter.
    Please advice.

    I want to make sure we are talking about the same thing:
    After you add the portlet to the page, you go to the page properties, then the parameters tab, then there is a section at the bottom called "Portlet Parameter Values" where you can click and expand your portlet to see your portlet parameters.
    Is it here where your parameters just don't show up?
    If it is, try the following:
    - Add the portlet to another page and see if it still behaves the same.
    - Mark the parameters in the portlet as being non-public, re-generate portlet (on manage tab), then mark them as being public, re-generate and then try the above again (add to another page).

  • How to use shared parameter on request set

    Hi
    I have a request set with two stages
    First stage contains From Date and To date where i have named the shared parameter as StartSP and EndSP
    i have to use these shared parameter in one of the query in next stage where my Type is SQL Statment and i have these two date fields From date and To date in next stage as well where i am able to retirve the values from previous stage
    based on these values i need to get the name in next parameter where my Type is SQL Statment
    select name from tablename where '02-MAR-09' > =start_Date and '29-MAR-09' <=end_Date
    I have written SQL as
    select name from tablename where StartSP > =start_Date and EndSP <=end_Date but it throws an error.
    I need the values of 02-Mar-09 and 29-Mar-09 from StartSP and EndSP
    Appreciate if any one has idea about this.

    hi user;
    please check:
    http://download-west.oracle.com/docs/cd/A60725_05/html/comnls/us/fnd/repset04.htm
    http://download-east.oracle.com/docs/cd/A60725_05/html/comnls/us/fnd/10gch609.htm
    Also you can check this search:http://www.google.com.tr/search?hl=tr&source=hp&q=How+to+use+shared+parameter+on+request+set+&meta=&aq=f&oq=
    Hope it helps
    Regard
    Helios

  • Report are not working using lexical parameter

    Hi !
    i am using oracle 10g and i my query i have laxical parameter as follow
    &to_date
    in after paramform we have
    IF :P_DATE_TO IS NOT NULL THEN
         :TO_DATE := 'AND to_date(head.updated_date,'||chr(39)||'DD/MM/RRRR'||chr(39)||') between TO_DATE(t2.term_start_date,'||chr(39)||'DD/MM/RRRR'||chr(39)||') AND TO_DATE('||CHR(39)||:P_DATE_TO||CHR(39)||','||chr(39)||'DD/MM/RRRR'||chr(39)||')';
    --ELSE
         --:TO_DATE := NULL;
    END IF;
    after compile this report when i run this report then i have following error
    REP-304: '&' in SELECT statement was not followed by a valid lexical parameter.
    any body can tell me how can i resove it.

    What denis is trying to say that change the TO_DATE parameter to any other name because TO_DATE is actually reserve word. So instead of TO_DATE try for example P_TO_DATE or any other name.
    -Ammad

  • How to use lexical paramter in oracle reports

    I have a query like,
    select * from t1 where &c1=:v_srep;
    where t1 is tablename
    c1 is column name
    How do I create &c1 and how should I populate it ?
    Thanks,

    From Oracle 8.1.5 database, we can use dynamic ref cursors.
    With dynamic ref cursor we can really avoid the use of lexical parameters in Reports.
    With static ref cursor this is not possible in all cases.
    For example, if we need dynamic WHERE, we practically can't use static ref cursor.
    But, problem is that Reports needs static ref cursor type for building Report Layout.
    Solution (as i know, first published in my post in MetaLink Reports Forum,
    thread "Report based on Ref Cursor or PL/SQL Table", 24-Aug-01) is:
    in package specification we must have both ref cursor types,
    static for Report Layout and dynamic for ref cursor query.
    Dynamic ref cursor examples:
    "Dynamic Table in the Second Query with Oracle Reports"
    http://www.quest-pipelines.com/pipelines/plsql/tips03.htm#JULY
    "Using a Collection Instead of a Temporary Table in Complex Reports"
    http://www.quest-pipelines.com/pipelines/plsql/tips03.htm#NOVEMBER
    Regards,
    Zlatko Sirotic

  • How to define Lexical Parameter in Oracle report.

    Dear all,
    I need to know that how i will define lexical parameter in query of report builder
    i have like this
    SELECT R.EXCEPTION_MESSAGE EXP_MESSAGE,
    ER.PROD_ID PRODUCT,
    ER.TNAME SEGMENT1 ,
    DECODE(R.STATUS,'Y','ROW',
    'L','TABLE',
    'Z','CIB LEVEL',
    NULL) STATUS,
    NVL(COUNT(*),0) CNT
    FROM EXCEPTION_RECORDS ER,CIB_PROC_TABLES_RULES R
    WHERE ER.TABLE_ID=R.CIB_TABLE_ID
    AND ER.EXP LIKE '%'||R.EXCEPTION_MESSAGE||'%'
    AND ER.BRWR=:v_brwr
    &v_where
    GROUP BY R.EXCEPTION_MESSAGE,ER.PROD_ID,ER.TNAME,R.STATUS
    ORDER BY 2
    It is giving an error

    V_WHERE should be defined same way as regular parameter. It should acquire certain value that makes the query syntaxically correct bofore the sql is run, usually in the After Param Form trigger, e.g.
    v_where := 'WHERE 1=1';
    ...

  • Trying to use lexical parameter in ORDER BY

    I'm using BIP in EBS and I have a report that needs to be sorted based on parameters selected in conc. pgm. I'm trying to use lexical parameters to accomplish this, however, it's not working. I have defined my lexical parameter in Package Spec and I'm setting it accordingly in Package Body(BeforeReport trigger). In my data template (dataQuery section) I have the following SQL
    SELECT 'AP_BANK_ACCOUNTS_ALL' as "table_audit2",
    a.bank_account_id,
    to_char(a.audit_timestamp,'DD-MON-YYYY HH:MI P.M.'),
    a.audit_transaction_type ,
    a.audit_user_name,
    a.bank_account_name,
    a.bank_account_num,
    a.account_type,
    a.org_id,
    a.bank_branch_id,
    a.xxap_field_changed,
    a.xxap_new_value,
    a.xxap_old_value,
    b.bank_name,
    d.short_name
    FROM xxap_bank_accounts_all_gtmp a,
    ap_bank_branches b,
    hr_organization_information c,
    gl_sets_of_books d
    WHERE a.bank_branch_id = b.bank_branch_id
    AND a.org_id = c.organization_id
    AND c.org_information_context = 'Operating Unit Information'
    AND c.org_information3 = d.set_of_books_id
    ORDER BY &lv_order_by
    The IF statments below are being used in package to set lexical parameter
    note: p_order_by_1 & 2 are from conc.pgm
    IF p_order_by_1 IS NOT NULL
    THEN
    lv_order_by := to_char(p_order_by_1);
    lv_order_1 := 'Y';
    END IF;
    IF p_order_by_2 IS NOT NULL
    THEN
    IF lv_order_1 = 'Y'
    THEN
    lv_order_by :=lv_order_by||','||to_char (p_order_by_2);
    lv_order_2 := 'Y';
    ELSE
    lv_order_by := to_char(p_order_by_2);
    lv_order_2 := 'Y';
    END IF;
    END IF;
    Any help will be greatly appreciated!!!! I'm a newbie to EBS and BIP so you can probably imagine how frustrated I am.
    Message was edited by:
    user631051

    The conc. pgm completes successfully but my report is not sorted. Data Template below:
    <properties>
    <property name="include_parameters" value="true" />
    <property name="include_null_Element" value="true" />
    <property name="xml_tag_case" value="upper" />
    <property name="db_fetch_size" value="500" />
    <property name="scalable_mode" value="off" />
    <property name="include_rowsettag" value="false" />
    <property name="debug_mode" value="off" />
    </properties>
    <parameters>
         <parameter name="p_start_date" dataType="date"/>
         <parameter name="p_end_date" dataType="date"/>
         <parameter name="p_org_id" dataType="number"/>
         <parameter name="p_data_priority" dataType="character"/>
         <parameter name="p_include" dataType="character"/>
         <parameter name="p_account_type" dataType="character"/>
         <parameter name="p_order_by_1" dataType="character"/>
         <parameter name="p_order_by_2" dataType="character"/>
         <parameter name="p_order_by_3" dataType="character"/>
         </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[SELECT 'AP_BANK_BRANCHES' as "table_audit1", a.bank_branch_id as "bank_branch_id",
                     to_char(a.audit_timestamp,'DD-MON-YYYY HH:MI P.M.') as "audit_timestamp",
                     a.audit_transaction_type as "audit_transaction_type", a.audit_user_name as "audit_user_name",
                     b.bank_name as "bank_name", b.bank_branch_name as "bank_branch_name",
                     to_char(b.bank_number) as "bank_number", a.active_date as "active_date", a.xxap_field_changed,
                     a.xxap_new_value, a.xxap_old_value
                    FROM xxap_bank_branch_gtmp a,
                         ap_bank_branches b
                    WHERE a.bank_branch_id = b.bank_branch_id
          ]]>
    </sqlStatement
    <sqlStatement name="Q2">
    <![CDATA[SELECT 'AP_BANK_ACCOUNTS_ALL' as "table_audit2",
                     a.bank_account_id as "bank_account_id",
                     to_char(a.audit_timestamp,'DD-MON-YYYY HH:MI P.M.') as "audit_timestamp",
                     a.audit_transaction_type as "audit_transaction_type",
                     a.audit_user_name as "audit_user_name",
                     b.bank_name as "bank_name",
                     a.bank_account_name,
                     a.bank_account_num as "bank_account_num",
                     a.account_type as "account_type",
                     to_char(a.org_id) as "org_id",
                     a.bank_branch_id as "bank_branch_id",
                     a.xxap_field_changed,
                     a.xxap_new_value,
                     a.xxap_old_value,
                     d.short_name as "short_name"
                    FROM xxap_bank_accounts_all_gtmp a,
                         ap_bank_branches b,
                         hr_organization_information c,
                         gl_sets_of_books d
                    WHERE a.bank_branch_id = b.bank_branch_id
                    AND   a.org_id = c.organization_id
                    AND   c.org_information_context = 'Operating Unit Information'
                    AND   c.org_information3 = d.set_of_books_id
                    ORDER BY &lv_order_by
          ]]>
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="beforeReportTrigger" source="XXAP_RPT_BANK_AUDIT_EXT_PKG.BeforeReport"/>
    <dataStructure>
    <group name="G_Bank_Branches" source="Q1">
    <element name="table_audit1" value="table_audit1"/>
              <element name="bank_branch_id" value="bank_branch_id"/>
              <element name="audit_timestamp" value="audit_timestamp"/>
              <element name="audit_transaction_type" value="audit_transaction_type"/>
              <element name="audit_user_name" value="audit_user_name"/>
              <element name="bank_name" value="bank_name"/>
              <element name="bank_branch_name" value="bank_branch_name"/>
              <element name="bank_number" value="bank_number"/>
              <element name="active_date" value="active_date"/>
              <element name="xxap_field_changed" value="xxap_field_changed"/>
              <element name="xxap_new_value" value="xxap_new_value"/>
              <element name="xxap_old_value" value="xxap_old_value"/>
    </group>
    <group name="G_Bank_Accounts_All" source="Q2">
         <element name="table_audit2" value="table_audit2"/>
         <element name="account_type" value="account_type"/>
    <element name="bank_account_id" value="bank_account_id"/>
              <element name="audit_timestamp" value="audit_timestamp"/>
              <element name="audit_transaction_type" value="audit_transaction_type"/>
              <element name="audit_user_name" value="audit_user_name"/>
              <element name="bank_name" value="bank_name"/>
              <element name="bank_account_name" value="bank_account_name"/>
              <element name="bank_account_num" value="bank_account_num"/>
              <element name="org_id" value="org_id"/>
              <element name="xxap_field_changed" value="xxap_field_changed"/>
              <element name="xxap_new_value" value="xxap_new_value"/>
              <element name="xxap_old_value" value="xxap_old_value"/>
              <element name="short_name" value="short_name"/>
    </group>
    </dataStructure>
    </dataTemplate>

  • How to make a parameter base report?

    I am making a report on employees and departments but i want to choose employees for some required departments for that i need to use parameter, and i need help that how will i make a parameter in reports builder 10g.
    I am able to do it by writing a where clause in query but now i want to do it from user parameters. Seek help here.
    Maz

    Here is a list of things to do. Let me know if anything is not clear.
    1) In your main query create a lexical parameter at the very end of you where clause ( dont put and &p_where just &p_where)
    &p_where
    2)Create a user parameter with datatype character and width 200
    ex: P_departments
    3) Create a field on the Paper Parameter Form
    4) Click on that field and go to the List of Values (if you want a lov...) and insert the following
    Ex:
    select 'All',' All Departments' from dual
    union
    select to_char(department),to_char(department)||' - '||department_name
    from departments
    order by 1
    5) Go to Report Triggers > After Parameters and insert the following
    Ex:
    begin
    :p_where := null;
    if :p_departments not like '%All%' then
    :p_where := :p_where ||' and table.department = '||:p_departments;
    end if;
    return (true);
    end;
    This will allow you to select a department or leave it at the default of all departments. It will also allow you to remove the hardcoded statement in your where clause such as
    where department = 'HR'
    Edited by: DOUBLE U on Aug 3, 2011 3:32 PM

Maybe you are looking for

  • Zmb5b : problem to execute stock on posting date

    hi guys, i need help here. when i go to txn zmb5b and put the company code:my10, material group:FKAWA, set flag for no reversal movement and valuated stock, the system prompt me an error saying that 'material group does not exist' meanwhile it's ther

  • Product Registration Pop

    I have a pop up reminder on the PC for the first time today to "register product and enjoy a host of benefits" - how can I get rid of it please - I've already registered and I thought it would be as simple as deleting the product registration link fr

  • Slow throughput Ironport S370 Proxy CPU 100%

    We have a cluster of 3 x Ironport S370's all running 7.7.0-753 The throughput is really poor we have a 500Mbps Internet connection which at it's peak is only getting to 120Mbps as the Ironports don't seem to be able to handle the traffic. The Proxy C

  • PIX 501 Problem

    Hello All, I have a PIX 501. I configured it with Public IP add outside and private IP inside. I am able to connect to the device fron inside via telnet but NOT from outside. I configured the telnet access on both Interfaces with telnet command. I am

  • 10.6.4 causes Entourage to crash

    After installing Leopard update 10.6.4 Entourage 2008 keeps crashing. HELP!