Value for a parameter based on another parameter value

Hi all,
i am using report 6i and 10g db.
I have to create a report based on some parameter values. For example
Two parameter named as P_emp_code and P_emp_name
In the first parameter p_emp_code has list of values like empcode emp_full_name ie like 0002108 Vanitha Lanet Mendez
when user select P_emp_code i want to display the fullname in p_emp_name .
I tried as follows in list of values
select emp_fullname from emp_master where emp_code=:p_emp_code
then getting error bind variable cannot be used
Please suggest a way .
Thanks
Rincy

Hello,
The thing you are asking for set and editing the reports parameter form's value. Then i don't think you can do this by using the report parameter form.
But there are two alternatives for this task.
1. Create one form using form builder and pass the parameter and run the report from there. So, you can use the code as you showed in your first post.
2. Why don't you make this Title setting automatically? I Mean using the gender column (with decode/case condition) of same table.
-Ammad

Similar Messages

  • Change field value in a table, based on another field value in the same row (for each added row)

    Please Help, I want to change field value in a table, based on another field value in the same row (for each added row)
    I am using this code :
    <HTML>
    <HEAD>
    <SCRIPT>
    function addRow(tableID) {
    var table = document.getElementById(tableID);
    var rowCount = table.rows.length;
    var row = table.insertRow(rowCount);
    var colCount = table.rows[0].cells.length;
    for(var i=0; i<colCount; i++ ) {
    var newcell = row.insertCell(i);
    newcell.innerHTML = table.rows[1].cells[i].innerHTML;
    switch(newcell.childNodes[0].type) {
    case "text":
    newcell.childNodes[0].value = "";
    break;
    case "checkbox":
    newcell.childNodes[0].checked = false;
    break;
    case "select-one":
    newcell.childNodes[0].selectedIndex = 0;
    break;}}}
    function deleteRow(tableID) {
    try {var table = document.getElementById(tableID);
    var rowCount = table.rows.length;
    for(var i=0; i<rowCount; i++) {
    var row = table.rows[i];
    var chkbox = row.cells[0].childNodes[0];
    if(null != chkbox && true == chkbox.checked) {
    if(rowCount <= 2) {
    alert("Cannot delete all the rows.");
    break;}
    table.deleteRow(i);
    rowCount--;
    i--;}}}catch(e) {alert(e);}}
    </SCRIPT>
    </HEAD>
    <BODY>
    <INPUT type="button" value="Add Row" onClick="addRow('dataTable')" />
    <INPUT type="button" value="Delete Row" onClick="deleteRow('dataTable')" />
    <TABLE id="dataTable" width="350px" border="1">
    <TR>
    <TD width="32"></TD>
    <TD width="119" align="center"><strong>Activity</strong></TD>
    <TD width="177" align="center"><strong>Cost</strong></TD>
    </TR>
    <TR>
    <TD><INPUT type="checkbox" name="chk"/></TD>
    <TD>
    <select name="s1" id="s1">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    </select>
    </TD>
    <TD><input type="text" name="txt1" id="txt1"></TD>
    </TR>
    </TABLE>
    </BODY>
    </HTML>

    Hi,
    Let me make sure u r working with table control.
    First u have to create a event(VALIDATE) to do the validation.
    Inside the event,
    1. First get the current index where user has pointed the curson
    2. Once u get the index read the internal table with index value.
    3. Now u can compare the col1 and col2 values and populate the error message.
    1. DATA : lo_elt TYPE REF TO if_wd_context_element,
                   l_index type i.
    lo_elt = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
         CALL METHOD LO_ELT->GET_INDEX( RECEIVING  MY_INDEX = l_index.
    above code should be written inside the event.
    Thanks,

  • Any way to pass Multiple Values for a single Label in the Parameter?

    I have a Report that Contains 2 Parameters, @Customer & @Area. When trying to set up the Available Values for @Area, I'm having issues using multiple values for one Label, i.e. = "4006" Or "4610"
    One of the Filters in the Report is an Operation number, which is the [OPERATION] field, which is setup as a filter on the Tablix referencing the @Area parameter. 
    PROBLEM: I cannot retrieve any data when trying to use the ‘Or’ Operator here. If I simply put “4006” or “4610” I retrieve data, but when trying to combine it returns no data.
    Example, I need to allow a user to select ‘Chassis Incoming’, which would include data from Operations 4006 & 4610.
    QUESTION:
    Any way to pass Multiple Values for a single Label in the Parameter?
    I realize the typical solution may be to use ‘Multi-Value’ selection, but in this case we want the User to select the Area and the multiple values for Filtering will be automatically determined for them. Otherwise, they are subject to not getting
    it correct.
    I have tried several different ways, such as =”4006” Or “4610”, =(“4006”, “4610”), = In(“4006”, “4610”), etc….
    Note: We are using Report Builder 3.0

    Based on my experience, there's no way to 'intercept' the query that gets passed back to SQL Server, so a Split wouldn't work.
    Try creating either a function or stored procedure using the code below (compliments to
    http://www.dotnetspider.com/resources/4680-Parse-comma-separated-string-SQL.aspx) to parse the string: 
    CREATE FUNCTION dbo.Parse(@Array VARCHAR(1000), @Separator VARCHAR(10))
    RETURNS @ResultTable TABLE (ParseValue VARCHAR(100))AS
    BEGIN
    DECLARE @SeparatorPosition INT
    DECLARE @ArrayValue VARCHAR(1000)
    SET @Array = @Array + @Separator
    WHILE PATINDEX('%' + @Separator + '%' , @Array) <> 0
    BEGIN
    SELECT @SeparatorPosition = PATINDEX('%' + @Separator + '%', @Array)
    SELECT @ArrayValue = LEFT(@Array, @SeparatorPosition - 1)
    INSERT @ResultTable VALUES (CAST(@ArrayValue AS VARCHAR))
    SELECT @Array = STUFF(@Array, 1, @SeparatorPosition, '')
    END
    RETURN
    END
    Once created you can do things like this:
    SELECT * FROM Parse('John,Bill,David,Thomas', ',')
    SELECT * FROM (SELECT 'John' AS TestName union select 'David' AS TestName) AS Main
    WHERE TestName IN (SELECT ParseValue FROM dbo.Parse('John,Bill,David,Thomas', ','))
    This is what your SQL query would probably look like:
    SELECT OperationID, OperationName FROM dbo.Operations
    WHERE AreaID IN (SELECT ParseValue FROM dbo.Parse(@Area, ','))
    You may need to fiddle around with the Separator depending on whether SQL Server inserts a space between the comma and next value.

  • Search help for a field in table control based on another field value

    Hi,
    I want to attach the Search help for a field in table control based on another field value.
    Please help me asap.
    Will be highly rewarded

    HI,..
      Check these links
    search help in table control
    Re: How to create Search Help for a field in Table control !!
    How to create Search Help for a field in Table control !!
    F4 Help In Table Control
    Control table F4 help
    Problem in F4 help in screen field
    check this code
    DATA: BEGIN OF it_value4 OCCURS 0,
             TEXTCODE  LIKE  ZXX-TEXTCODE,
             TEXTDESC  LIKE  ZXX-TEXTDESC,
           END OF it_value4.
      progname = sy-repid.
      dynnum   = sy-dynnr.
             SELECT TEXTCODE TEXTDESC
               FROM  xxxx
               INTO CORRESPONDING FIELDS OF TABLE<b> it_value4</b>
              WHERE  LOSS_CODE =<b> IT_VALUE1 .</b>
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield    = 'TEXTCODE'
          dynpprog    = progname
          dynpnr      = dynnum
          dynprofield = 'ITVALUE-TEXTCODE'  "-->UR  4 th filed value in screen
          value_org   = 'S'
        TABLES
          value_tab   = it_value4.
    endmodule.
    Message was edited by:
            veereshbabu ponnada

  • Table Control: make a field editable or not based on another field value

    HI All,
    How to make a column field input enabled or disabled based on another field value in a Table Control.
    Here's the scenario:
    I have a table control with two columns, KTOKK and LIFNR. Now for certain KTOKK, the LIFNR field should be editable and for certain KTOKK it should not be editable.
    Eg.,  KTOKK = 0001 =>  LIFNR field is not editable.
            KTOKK = ZKTO => LIFNR field is editable.
    But these fields are in a table control.
    Please advice.
    Thanks in advance,
    RK.

    Hi RK,
    Go through the below link..
    how to make special field editable or diseditable in table control?
    the code mentioned in the link.. just add ur conditions in the module....
    Best Regards,
    Brijesh

  • URGENT:Making a poplist value freezed based on another poplist value

    Hi,
    I have a requirement to make a poplist value freezed(should get disabled so that no further change can be done) based on another poplist value.
    for ex : poplist 1 : A,B.
    poplist2: yes,no
    if A is selected, yes,no should appear in the poplist2.
    if B is selected, only YEs should appear in the poplist2 and it should get greyed out(disabled for further changing).
    Please help.
    Thanks,
    Veena.
    Edited by: Veena. on Dec 31, 2012 4:00 AM

    Veena,
    there is nothing urgent on this forum!
    You know that you should provide your jdev version so that we can help you solve your problem.
    Next it would help if you provide the code (of the page) so that we see how you setup the 'poplist' (whatever that exactly is).
    If you mean a selectOnceChioce you can implement a valuechangeListener on poplist A and depending on the new value set the value of poplist B to yes and disable it.
    Timo

  • Set default value for full name based on usename

    I have an LOV which as the full name of the user, for example 'John Smith'.
    I would like to set the value of this LOV to the full name of the user, based on a match with username. So when JSMITH is logged in, I would like the default value of the LOV to be 'John Smith'.
    I have an page process anonymous block which gets the right short username:
    DECLARE
    p7_assigned_to varchar2(20);
    BEGIN
    select person_name into p7_assigned_to
    from ht_people
    where v('APP_USER')=flow_user;
    END;
    How do I then set the default value of the LOV based on the return value of this block?

    Where do you use the LOV? Is it being used in a Select list? If so, you will have a place to enter the default value. Edit the Select list, and you will see a place where you can enter Default value.
    Ravi

  • How to create a Parameter dependent over another parameter for ESS job

    Hi Team,
    We have defined an ESS job for which we have 2 parameters (parameter values are based on LOV).
    Now we have to make these parameters dependent.
    Any inputs on this are highly appreciated.
    Thanks,
    Praveen

    Are you using parameter VO, If so I think you should be able to create cascading list.
    Jani Rautiainen
    Fusion Applications Developer Relations
    https://blogs.oracle.com/fadevrel/

  • Displaying second parameter based on first parameter

    Dear Developers,
    In the parameter form or reports, I want to pass value selected
    in the first parameter to the second parameter
    ie. based on the first parameter selected, I would like the
    query written in the second parameter for
    displaying list to display only those values that are associated
    with the first parameter.
    How can I do this?
    I do not want to call report from form with preselected
    parameters.
    Awaiting speedy reply
    Gaurav

    You can't do this in Reports. You need to do it in Forms

  • Using Stored Procedure w/Parameter and adding another parameter via CR

    I have a situation where I am using a SQL Stored Procedure that contains one Date Parameter. 
    I am pulling that Stored Procedure fwd into a Crystal Report, but as soon as I add another Parameter via Crystal Reports (in addition to the Parameter that was pulled fwd from the Stored Procedure) Two parameters prompts now appear for the Stored Procedure Parameter.
    I need to have the Crystal Report display the Stored Procedure Parameter only once.

    I have a Parameter within the SP that is for a Date entry.  So I pass the SP Parameter through the Command to CR.
    Then I have added some other Parameters that I have the users populating but they are only used in formulas and I donu2019t have those in the Select Records.
    Then I add another Parameter that would be for Supplier Selection.  As soon as I add this 4th Parameter for the Supplier Select within the Select Record, is when I then encounter the duplicate display of the SP Parameter.
    The first prompt is a Date field but for some reason is displaying in the Right hand corner SUPNAME (which is my Supplier Name field)  Then the next set of Parameters display is properly showing in the right hand corner all of my actually Parameters.
    Why would the first occurrence be associated with the Supplier Name? 
    I have tried adding a Supplier parameter to the SP itself, but then I am limited to a single entry, it will not allow me to set it to Multiple Values. 
    Any additional suggestions or information would be greatly appreciated.

  • Change value of a field, based on another fiekd, before insert...

    I have this situation: I have to generate a code (this happens through a database function) on the moment a new record is saved. This code is based on another field of that record (parameter passed to the function). I (have to) use Apex 3, so I can't use functionality of Apex 4.
    So to be concrete: I have a registration program of books. Eacht book has a unique library code (this is not the PK). The labrary code is based on the year of publication (e.g. B2010-00035). So once a new book is entered, before saving, the year of publication (e.g. 2010) is checked, and throug a database function (e.g. f_get_new_library_code(2010) returns "B2010-00036") the library code has to be filled out.
    How can I do this on the best way, taking into account I can't use Dynamic Actions of Apex 4 (unfortunatly).

    Hi,
    If you had specified the type of Form the answer would have been more to the point !
    If its a single row form then you can write a OnSubmit Computation where in you call your function.
    If its a Tabular Form then you have to write a OnSubmit After Comp & Val process where you will iterate through the apex_application.g_f arrays and update the required arrays.
    Regards,

  • F4 help based on another column value in SM30

    Hi All,
    I have two fields in the view to maintain in SM30. The second field possible values are dependent on the first field value.
    View has two fields - Feild1, Field2.
    Field2 value table is varied based on what is filled in Field1.
    I have created POV for the field F2 in the screen directly.
    PROCESS ON VALUE-REQUEST.
      FIELD ZVIEW-Field2 MODULE f4_field2.
    When I click on new entries, i do not have access to the value ZVIEW-FIELD1.
    I can manage for the existing records as the data exists in standard internal table TABLE. But for the new ones, can any one please let me know their ideas?
    Thanks
    Pavan

    No, it works very well, I guess you didn't code it correctly. By the way you must also get the cursor position to determine the line of the current table control:
    * code in the POV
    data lt_dynpfield type table of DYNPREAD.
    data ls_dynpfield type DYNPREAD.
    REFRESH lt_dynpfield.
    clear ls_dynpfield.
    ls_dynpfield-fieldname = '<your other field name>'.
    GET CURSOR LINE ls_dynpfield-STEPL.
    APPEND ls_dynpfield to lt_dynpfield.
    CALL FUNCTION 'DYNP_VALUES_READ'
      EXPORTING
        dyname                               = sy-repid
        dynumb                               = sy-dynnr
      tables
        dynpfields                           = lt_dynpfield
    EXCEPTIONS
       OTHERS                               = 11.
    * here lt_dynpfield[1]-fieldvalue contains the value entered in the other field

  • How to display value of an item based on another item

    Hi,
    In a page I've to display name for the corresponding id displayed in id item.Can I write a query based on id and display name as soon as I enter into that item.if so are there any properties I need to set ?I'm looking for just post_text_item functionality in forms?
    Thanks,
    Mahender

    Hi,
    I've created sample table with id,first_name and last_name to test:
    I've created AJAX script in application process area with name GET_NAME
    declare
    v_name varchar2(150);
    begin
    select first_name||'-'||last_name into v_name from names
    where id = :P53_id;
    htp.prn(v_name);
    exception when others then htp.prn('An error occurred retrieving name'||sqlerrm);
    end;
    CREATED JAVA SCRIPT IN html headers section of the page p53:
    <script type="text/javascript">
    function get_name(){
    var id = document.getElementById('P53_id').value;
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value, 'APPLICATION_PROCESS=GET_NAME’,0);
    get.add('P53_id',id);
    var gReturn = get.get();
    document.getElementById('P53_name').value = gReturn;
    </script>
    put the following in HTML Form Element Attributes of p53_id :
    onchange="get_name(this,'P53_id)"
    It's not working ?
    Can anyone help
    Thanks
    Edited by: user518071 on Aug 14, 2009 8:14 AM
    Edited by: user518071 on Aug 14, 2009 11:04 AM
    Edited by: user518071 on Aug 15, 2009 5:02 AM

  • Acrobat XI - Populating value of a field based on another field

    pdf built in Acrobat XI
    New to this and I have tried every possible combination I can think of! For simplicty purposes, I have two text fields, Text1 and Text2. I want Text2 to populate based on the value entered into Text1. Have an Action event (Mouse Up) on Text1 as follows:
    var OneT = this.getField("Text1");
    var TwoT = this.getField("Text2");
    TwoT.value=OneT.value;

    [Moved to Acrobat JavaScript forum]
    If you name each field the same, the values will automatically be the same. But if you want to be able to change the value of Text2 after it is autopopulated, you should use a different script and a different event. The following custom Validate script for Text1 will set the value of Text2 when the value of Text1 changes:
    //Custom Validate script for Text1
    getField("Text2").value = event.value;
    If you only want to set the value of Text2 when it is blank, the code could be:
    // Custom Validate script for Text1
    // Get a reference to Text2
    var f = getField("Text2");
    // Only set it value if it is currently blank
    if (!f.valueAsString) {
        f.value = event.value;
    This allows the user to change the value of Text2 without it getting reset when Text1 is changed.

  • Setting default value for a jcombobox based on the value not the index

    I am trying to set the default value for my combobox to the current year. One way I thought of doing it was to get the index of the value representing the current year and then use setSelectedInex to make it the default. Any ideas?
    The relevent section of code is below.
    GregorianCalendar gregorianCalendar = new GregorianCalendar();
    int year = gregorianCalendar.get(Calendar.YEAR);
    String currentyear = year + "";
    int startyears = 2000;
    int numyears = 25;
    JComboBox endyearcombobox = new JComboBox();
    endyearcombobox.setBorder( BorderFactory.createLineBorder(Color.DARK_GRAY));
    endyearcombobox.setFont(standardfont);
    endyearcombobox.addActionListener( new ActionListener() {
    public void actionPerformed( ActionEvent event ) {
    endyearcombobox = ( JComboBox )event.getSource();
    endyear = endyearcombobox.getSelectedItem();
    boolean same = endyear.equals(oldItem);
    oldItem = endyear;
    String[] endyearlist = new String[numyears];
    for(int i = startyears; i < startyears+numyears; i++){
    String item = new Integer(i).toString();
    endyearcombobox.addItem(item);
    Thanks
    Ged

    Thanks mate,
    That was what I was looking for. I still had a little more manipulation to do, but sent me on the right track and have got it working now. I don't know why I didn't think of it in the first place.
    Ged

Maybe you are looking for