Creating a dynamic lov based on a column

Hi,
I want to create a dynamic lov based on a column in a database-table.
Eg. the query
'select code, description from code_table'
is the contents of the column 'lov_query' in the table 'parameters'.
For every parameter there can be a different lov-query, but the result is always
two columns (code and description, number and name, etc.), exactly what you need to use in a lov.
I've written a (dbms_sql) function that takes the parameter-id and returns the lov_query.
create or replace function "GET_PMR_LOV"
(pmr_id in NUMBER)
return VARCHAR2
is
cur INTEGER := DBMS_SQL.OPEN_CURSOR;
fdbk INTEGER;
l_pmr_id NUMBER(9) := pmr_id;
l_stmnt VARCHAR2(2000);
begin
DBMS_SQL.PARSE
(cur, 'select pmr.lov_query from parameters pmr where pmr.ID ' || ' = 'L_PMR_ID', DBMS_SQL.NATIVE);
DBMS_SQL.BIND_VARIABLE (cur, 'L_PMR_ID', l_pmr_id);
DBMS_SQL.DEFINE_COLUMN (cur, 1, l_stmnt, 2000);
fdbk := DBMS_SQL.EXECUTE (cur);
fdbk := DBMS_SQL.FETCH_ROWS (cur);
IF fdbk > 0
THEN
DBMS_SQL.COLUMN_VALUE (cur, 1, l_stmnt);
return (l_stmnt);
ELSE     
return null;
END IF;
DBMS_SQL.CLOSE_CURSOR (cur);
END;
But now I'm stuck on how to pass on this statement in HTMLDB
as an dynamic lov, I don't seem to be able to execute this statement
into the two display and return columns. Any ideas?

Hello again,
This lov is on an updatable report-column where the user has to make a choice from an non-named, popup and query-based lov. In the lov-query box I have just put:
"return get_pmr_lov(:p41_param_id)" (without the quotes ;-)
Here's my latest version plus an alternative, which both seem to work fine:
create or replace function "GET_PMR_LOV"
(pmr_id in NUMBER)
return VARCHAR2
is
cur INTEGER := DBMS_SQL.OPEN_CURSOR;
fdbk INTEGER;
l_pmr_id NUMBER(9) := pmr_id;
l_stmnt VARCHAR2(1000);
begin
DBMS_SQL.PARSE (cur, 'select pmr.lov_query from paramaters pmr where pmr.ID ' || '= :L_PMR_ID', DBMS_SQL.NATIVE);
DBMS_SQL.BIND_VARIABLE (cur, 'L_PMR_ID', l_pmr_id);
DBMS_SQL.DEFINE_COLUMN (cur, 1, l_stmnt, 1000);
fdbk := DBMS_SQL.EXECUTE (cur);
fdbk := DBMS_SQL.FETCH_ROWS (cur);
IF fdbk > 0 THEN
DBMS_SQL.COLUMN_VALUE (cur, 1, l_stmnt);
return (l_stmnt);
ELSE
return null;
END IF;
DBMS_SQL.CLOSE_CURSOR (cur);
END;
create or replace function "GET_PMR_LOV2"
(pmr_id in NUMBER)
return VARCHAR2
is
l_pmr_id NUMBER(9) := pmr_id;
l_stmnt VARCHAR2(1000);
BEGIN
EXECUTE IMMEDIATE 'select pmr.lov_query from parameters pmr where pmr.ID = :1'
INTO l_stmnt USING l_pmr_id;
return l_stmnt;
END;
The error-message remains the same, unable to bind :p41_param_id !

Similar Messages

  • Dynamic LOV based on report column

    HI,
    I've a standard report with Two columns. Column1 is standard Report Column and Column 2 is a LOV based on an SQL Query.
    Now I need to filter the LOV (add a where clause) based on the value in the column1.
    For example, consider Column1 as "country" and column2 as "state". so the in column2(LOV), user should see only the list of states belongs to the corresponding country(Column1)
    Please note that the report is based on an SQL query
    Any clue on how to do this.
    I'm using APEX4.1.
    Thanks in advance
    Prasanth

    I think you are looking for this https://forums.oracle.com/forums/search.jspa?threadID=&q=tabular+form+cascade&objID=f137&dateRange=all&userID=&numResults=15&rankBy=10001
    please search the forum before posting a question
    Thanks

  • Master Details form (LOV based on Detail Column of Join Condition)

    I have created a master detail form where user_id is joining master and details.
    I have created one dynamic lov based on child user_id in detail block to diplay all user who works under current user.
    Problem : When i want to select Insert detail action in detail block the dynamic lov should read the user_id which is going to be inserted when you press Save button. Means as its not getting populated till one click on save button my lov is not getting refereshed.
    Please advice what should i do.
    Thanks
    Bakulesh

    I solved myself by modifing some guru's script from this forum little bit. I am adding here for feedback or use to any.
    htp.p('<script language="JavaScript1.3">
    function getMstFieldValue(form,fieldName)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    var blkname;
    for(var i = 0; i < form.length; i++)
    slicedName = form.elements.name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    blkname = slicedName[1];
    //alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName && blkname == "MASTER_BLOCK")
    return form.elements[i].value;
    function setDetFieldValue(form,fieldName,value)
    var objName = "";
    var tmp = "";
    var dAction = "";
    var sel_idx = 0;
    var cnt = 0;
    var instance = 0;
    var slicedName;
    var fillData = new Array();
    var blkname;
    for(var i = 0; i < form.length; i++)
    slicedName = form.elements[i].name.split(".");
    tmp = slicedName[2];
    instance = parseInt(slicedName[3],10);
    blkname = slicedName[1];
    //alert("Fld "+tmp+" blk "+blkname+ " instance "+instance);
    if (!tmp)
    continue;
    objName = tmp;
    if (objName == fieldName && blkname == "DETAIL_BLOCK")
    form.elements[i].value = value;
    </script>');
    thanks
    Bakulesh

  • Dynamic LOV based on Current user

    How do i make a dynamic LOV based on the user id of the current user.
    Also how to insert values from a form into a database
    Can anyone please help me out.
    Thanks

    Use portal.wwctx_api.get_user to get the currently logged in userid.
    The simplest example of a form manipulating data is to create the form based on a table. All DML works automagically. You can base your form on a procedure with dummy columns and do your own DML if you wish. Lots more flexibility that way...

  • Problem - Creating a Dynamic LOV using duplicate value in select statement

    I am trying to create a Dynamic LOV by attempting to follow a pattern similar to the following:
    select shop_name d, shop_id r
    from shops
    order by 1
    However, I want to use the shop_name twice as in the following because I do not have any other unique identifier available such as a shop_id to associate with the shop name:
    select shop_name d, shop_name r
    from shops
    order by 1
    But I get an error where I am not allowed to duplicate the shop_name in the select statement. I read somewhere on this forum where it can be done but I can't find exactly how.
    Can someone tell or show me how to accomplish this?
    Thanks in anticipation for your answer.
    Thanks,
    Ric

    Ric,
    I just tried to do this on APEX 3.0, and it worked just fine with this SQL:
    select ename d, ename r from emp order by 1Perhaps you could put an example on apex.oracle.com or specify the error message that you're getting.
    So as long as you have uniquely aliased both columns, this should not present a problem.
    Thanks,
    - Scott -

  • How to create a dynamic table were the JTable columns keep varying

    How to create a dynamic table were the JTable columns keep varying based on the input to the jtable

    Oooh, I lied. DefaultTableModel has an API for adding and
    removing columns. I didn't know that. You should have read
    the API.
    As for preferring to extend AbstractTableModel rather than
    DefaultTableModel, I think it's more correct. DefaultTableModel
    is a simple implementation of Abstract for basic cases. It isn't
    intended to be extended. I figure most people extending
    DefaultTableModel are also extending JFrame, JPanel, and Thread
    instead of encapsulating the first two and implementing
    Runnable for the third.

  • How can i create a dynamic structure based on my input from a select-option

    Hello,
    This is to develop a custom report in FI for G/L Balance based on company code.
    I have an input select-option for Company code.
    Based on the range of company code my output layout should be modified.
    I am not very much sure to create a dynamic internal based on the input from a select-option.
    Can any one please let me know how can i do this.
    I would appreciate for anyone who turns up quickly.
    Thank you,
    With regs,
    Anitha Joss.

    See the following program, it builds a dynamic internal table based on the company codes from the select option. 
    report zrich_0001 .
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>.
    data: alv_fldcat type slis_t_fieldcat_alv,
          it_fldcat type lvc_t_fcat.
    data: it001 type table of t001 with header line.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_bukrs for it001-bukrs.
    selection-screen end of block b1.
    start-of-selection.
      select * into table it001 from t001
                     where bukrs in s_bukrs.
      perform build_dyn_itab.
    *  Build_dyn_itab
    form build_dyn_itab.
      data: index(3) type c.
      data: new_table type ref to data,
            new_line  type ref to data,
            wa_it_fldcat type lvc_s_fcat.
      clear wa_it_fldcat.
      wa_it_fldcat-fieldname = 'PERIOD' .
      wa_it_fldcat-datatype = 'CHAR'.
      wa_it_fldcat-intlen = 6.
      append wa_it_fldcat to it_fldcat .
      loop at it001.
        clear wa_it_fldcat.
        wa_it_fldcat-fieldname = it001-bukrs .
        wa_it_fldcat-datatype = 'CHAR'.
        wa_it_fldcat-intlen = 4.
        append wa_it_fldcat to it_fldcat .
      endloop.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = it_fldcat
                   importing
                      ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
    endform.
    Regards,
    Rich Heilman

  • No dynamic LOV in a PopUP column?

    Hi,
    </br></br>
    I've a named LOV-query for a column of the detail report on a master-detail-form.
    </br></br>
    the column is displayed as Popup LOV (named LOV) with that query:
    </br></br></br>
    IF :P306_KAT = 'KUNDE' THEN RETURN IF :P306_KAT = 'KUNDE' THEN RETURN
    </br></br>
    'SELECT name1 d, kunnr r FROM kunden_t ORDER BY 1';
    </br></br>
    ELSIF :P306_KAT = 'EXTWG' THEN RETURN
    </br></br>
    'SELECT ewbez d, extwg r FROM warengruppen_t order by 1';
    </br></br>
    ELSIF :P306_KAT = 'MATKL' THEN RETURN
    </br></br>
    'SELECT wgbez d, matkl r FROM matklassen_t order by 1';
    </br></br>
    ELSIF :P306_KAT = 'LAND' THEN RETURN
    'SELECT land d, kz r FROM laender_t order by 1';
    </br></br>
    END IF;
    </br></br>
    I've no chance to get it work.
    </br>
    when I change display to select list (named LOV)
    </br>
    everything is fine. (the same query)
    </br></br>
    I'm rather confused about that and need help.
    </br></br>
    lothar

    Hi Patrick,
    </br></br>
    I get the following error message:
    </br></br>
    ORA-06550: Zeile 11, Spalte 9: PLS-00103: Fand das Symbol ";" als eines
    </br>
    der folgenden erwartet wurde: begin case declare end exception exit for
    </br>
    goto if loop mod null pragma raise return select update while with
    </br>
    << close current delete fetch lock insert open rollback savepoint
    </br>
    set sql execute commit forall merge pipe Das Symbol "exit" ersetzte ";", um fortzufahren.
    </br>
    Error ERR-1000 Unable to determine List of Values from "declare function x return varchar2
    </br>
    is begin IF :P306_KAT = 'KUNDE' THEN RETURN ' select distinct (k.name1 ||''---''||d.kndnr)
    </br>
    d, d.kndnr r ' ||' from db_t d join kunden_t k on (d.kndnr = k.kunnr) ' ||'
    </br>
    where to_number(d.vkorg) = 3 order by 1'; ELSIF :P306_KAT = 'EXTWG' THEN RETURN
    </br>
    'SELECT ewbez d, extwg r FROM warengruppen_t order by 1'; ELSIF :P306_KAT = 'MATKL'
    </br>
    THEN RETURN 'SELECT wgbez d, matkl r FROM matklassen_t order by 1'; ELSIF :P306_KAT = 'LAND'
    </br>
    THEN RETURN 'SELECT land d, kz r FROM laender_t order by 1'; END IF; return null; end;
    </br>
    begin wwv_flow_utilities.g_query := x; end;".
    </br></br>
    Error in init lov: ORA-00900: Ungültige SQL-Anweisung p_lov:IF :P306_KAT = 'KUNDE' THEN RETURN
    </br>
    ' select distinct (k.name1 ||''---''||d.kndnr) d, d.kndnr r ' ||' from db_t d
    </br>
    join kunden_t k on (d.kndnr = k.kunnr) ' ||' where to_number(d.vkorg) = 3 order by 1';
    </br>
    ELSIF :P306_KAT = 'EXTWG' THEN RETURN 'SELECT ewbez d, extwg r FROM warengruppen_t order by 1';
    </br>
    ELSIF :P306_KAT = 'MATKL' THEN RETURN 'SELECT wgbez d, matkl r FROM matklassen_t order by 1';
    </br>
    ELSIF :P306_KAT = 'LAND' THEN RETURN 'SELECT land d, kz r FROM laender_t order by 1';
    </br>
    END IF; wwv_flow_security.g_security_group_id:725803405601837wwv_flow_security.g_curr_flow_security_group_id
    </br>
    :725803405601837 Unable to bind ":P306_KAT" Unable to initialize query.
    </br>
    RETURN ' select distinct (k.name1 ||''---''||d.kndnr) d, d.kndnr r ' ||' from db_t d
    </br>
    join kunden_t k on (d.kndnr = k.kunnr) ' ||' where to_number(d.vkorg) = 3 order by 1';
    </br>
    ELSIF :P306_KAT = 'EXTWG' THEN RETURN 'SELECT ewbez d, extwg r FROM warengruppen_t order by 1';
    </br>
    ELSIF :P306_KAT = 'MATKL' THEN RETURN 'SELECT wgbez d, matkl r FROM matklassen_t order by 1';
    </br>
    ELSIF :P306_KAT = 'LAND' THEN RETURN 'SELECT land d, kz r FROM laender_t order by 1'; END IF;
    </br>
    wwv_flow_security.g_security_group_id:725803405601837wwv_flow_security.g_curr_flow_security_group_id:725803405601837
    </br>
    Unable to bind ":P306_KAT" Unable to initialize query.
    </br></br>
    btw: I'm working with Apex-Version 2.0.0.00.49, database 10gR2
    </br></br>
    exact the same LOV works when I change from Popup to select list.
    </br>
    Unfortunately I need a popup window, because in production a result set
    </br>
    will have several hundred rows.
    </br></br>
    lothar

  • Creating a Dynamic LOV to pass parameters

    I am attempting to create an LOV to pass parameters to my Discoverer report I have on my portal. Any way to make the LOV dynamic? I want a simple sql statement in there to populate it. I used a simple parameter portlet and that wont work...just static list.
    Thanks.

    I suppse the answer is "No" there is no way to do it....
    Anyone found a way to do this?

  • How do I create a dynamic parameter based on a formula?

    Hi,
    I've developed a report, in CR 11, that is parameterized based on the field "ticket_date".  I've created a Min and a Max formula so that I can select a date range. This works wonderfully. However, my date list is growing longer by the day and each day I have to run the report I need to scroll through an even longer list of date values. This will become increasingly impractical with each passing month and year.  I would like create a "Year" paramater and a "Month" parameter so that I can first select the Year, then the month(s), then the dates.
    When I attempted to create a parameter based on the formula, "Year (), the formula wasn't in the list of available values to create a parameter on.
    How can I address this requirement?
    thanks in advance!
    Mark

    Hi Abhilash,
    Looks like I was able to create a Year field in the Command - thanks for the tip!
    Before I close this off as answered can you take a look at two sets of SQL I wrote in the Command that I'm getting errors on and offer advice on where the error is occurring.
    Example 1
    The SQL I attempted to write must be close though:
    Select ft.sequence, ft.ticket_date, coff.office_name, comp.subscriptions_id from
    field_tickets as ft, company_offices as coff, companies as comp
    INNER JOIN jobs ON comp.companies_id=jobs.companies_id
    INNER JOIN field_tickets ON jobs.jobs_id=field_tickets.jobs_id
    LEFT JOIN company_offices ON jobs.company_offices_id=company_offices.company_offices_id
    Where comp.subscriptions_id=7.00
    When I attempt to save this I get an error:
    "Failed to retrieve data from the database. Details: Exception: Error Message: Java Heap Space"
    Example 2
    I get the error, "Not unique table/alias: 'custom_jobs_values'" for the following SQL Command
    SELECT companies., jobs., field_tickets., regions., customers., custom_jobs_values. FROM
    companies, jobs, field_tickets, regions, customers, custom_jobs_values
    LEFT JOIN custom_jobs_values ON jobs.jobs_id=custom_jobs_values.jobs_id
    INNER JOIN regions ON companies.regions_id=regions.regions_id
    INNER JOIN jobs ON companies.companies_id=jobs.companies_id
    INNER JOIN field_tickets ON jobs.jobs_id=field_tickets.jobs_id
    INNER JOIN customers ON jobs.customers_id=customers.customers_id and
    companies.subscriptions_id=4.00
    thanks!
    Mark

  • Need to Create a Dynamic Calendar Based on School Year Sharepoint O365

    I have a request from a school program department. They are in need of a calendar based on total number of days in a school year (180) excluding weekends/holidays. The calendar will need to provide the following information: 1. Upon a student entering
    a program, the calendar will need to calculate days of school before entering program, school days in program, and school days after completion of program. I am trying to figure out if this is possible and if so, which program I should use. Access, Excel??
    Any suggestions or input would be appreciated.

    I feel that your question lacks a lot of background info which would have a HUGE impact on the design of the solution... specifically...
    you need a calendar... a calendar is generally a way of visually formatting data into days/weeks/months... and such a calendar can exclude weekends (just don't show saturday/sunday), but there's no good PRACTICAL way to exclude specific days within a month-view.
    (I guess if you were using a ghantt chart type of view, you could skip holidays/etc.
    But then you mention needing to CALCULATE days... which is different from seeing data visually represented as a calendar...
    You mention how the calculation will be used relative to OTHER data, but you don't really mention how that other data is being used.
    You also don't really mention what happens in the event of CHANGE... does anything need to happen to the OTHER data, if for example, a school has so many snow days that the school year is extended?
    So...
    I see a whole host of options...
    If the OTHER data is in an InfoPath form, you could create a web service to calculate the days.
    If the OTHER data is in an Excel form, you could have a hidden spreadsheet
    If the OTHER data is in an Access form, you could have a function operate against some external table lookup
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Using DW to create a dynamic, grid-based website

    I am a novice to this whole web design thing but I have big dreams of accomplishing a big goal and designing my own website.
    I am aiming to create a site similar in concept and design to this one: http://dynamit.us
    I am looking to replicate the multi-sized "content boxes" using a grid (which I know can be easily done in DW), and I am looking to have my website automatically "pull" content when the scroll bar reaches the bottom of the page (Facebook is another example of a website that uses this feature).
    I am NOT concerned with replicating the animation(s) on the dynamIt website, as can be seen on the photos that have the magnifying glass in the top right corner.
    I am thinking about biting the bullet and upgrading my trial version of DW to the full package, but I want to make sure that I am purchasing the correct software to achieve the result I'm aiming to achieve.
    Can I create a somewhat simplified version of this website (dynamit.us) using just Dreamweaver (and maybe PS for photo editing)? How do I build a site that pulls "past" or "old" content from a library and "updates" on the page every time the scroll bar reaches the bottom of the page (Infinite Scrolling)?
    THANK YOU!

    Dreamweaver is a great tool.  It will aid you in achieving your goals.  But it won't make you an instant success at professional web development any more than purchasing a fancy, expensive camera makes you an instant success at photography. 
    How much  experience do you have with with web design theory,   HTML, CSS, client-side (JavaScript), Server-side (PHP) and databases (MySql)?  
    Ultimately, a working knowledge of your craft is primary.   The tools you use are secondary.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • How to create dynamic context based on a structure defined in the program?

    Hi Experts,
             I need to create a dynamic context based on a structure wa_struc which i have define programatically.
    When I pass wa_struc to structure_name parameter of create_nodeinfo_from_struc, i get a runtime error:
    "Parameter STRUCTURE_NAME contains an invalid value wa_struc."
    How to create dynamic context based on a structure defined in the program?
    I have written the code like this:
    TYPES: BEGIN OF t_type,
                v_carrid TYPE sflight-carrid,
                v_connid TYPE sflight-connid,
             END OF t_type.
      Data:  i_struc type table of t_type,
             wa_struc type t_type.
      data: dyn_node   type ref to if_wd_context_node.
      data: rootnode_info   type ref to if_wd_context_node_info.
      rootnode_info = wd_context->get_node_info( ).
      clear i_struc. refresh i_struc.
      select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
    cl_wd_dynamic_tool=>create_nodeinfo_from_struct(
      parent_info = rootnode_info
      node_name = 'dynflight'
      structure_name = 'wa_struc'
      is_multiple = abap_true ).
    dyn_node = wd_context->get_child_node( name = 'dynflight' ).
    dyn_node->bind_table( i_struc ).
    Thanks
    Gopal
    Message was edited by: gopalkrishna baliga

    Hi Michelle,
              First of all Special thanks for your informative answers to my other forum questions. I really appreciate your help.
    Coming back to this question I am still waiting for an answer. Please help. Note that my structure is not in a dictionary.
    I am trying to create a new node. That is
    CONTEXT
    - DYNFLIGHT
    CARRID
    CONNID
    As you see above I am trying to create 'DYNFLIGHT' along with the 2 attributes which are inside this node. The structure of the node that is, no.of attributes may vary based on some condition. Thats why I am trying to create a node dynamically.
    Also I cannot define the structure in the ABAP dictionary because it changes based on condition
    I have updated my code like the following and I am getting error:
    TYPES: BEGIN OF t_type,
    CARRID TYPE sflight-carrid,
    CONNID TYPE sflight-connid,
    END OF t_type.
    Data: i_struc type table of t_type,
    dyn_node type ref to if_wd_context_node,
    rootnode_info type ref to if_wd_context_node_info,
    i_node_att type wdr_context_attr_info_map,
    wa_node_att type line of wdr_context_attr_info_map.
    wa_node_att-name = 'CARRID'.
    wa_node_att-TYPE_NAME = 'SFLIGHT-CARRID'.
    insert wa_node_att into table i_node_att.
    wa_node_att-name = 'CONNID'.
    wa_node_att-TYPE_NAME = 'SFLIGHT-CONNID'.
    insert wa_node_att into table i_node_att.
    clear i_struc. refresh i_struc.
    select carrid connid into corresponding fields of table i_struc from sflight where carrid = 'AA'.
    rootnode_info = wd_context->get_node_info( ).
    rootnode_info->add_new_child_node( name = 'DYNFLIGHT'
    attributes = i_node_att
    is_multiple = abap_true ).
    dyn_node = wd_context->get_child_node( 'DYNFLIGHT' ).
    dyn_node->bind_table( i_struc ).
    l_ref_interfacecontroller->set_data( dyn_node ).
    But now I am getting the following error :
    The following error text was processed in the system PET : Line types of an internal table and a work area not compatible.
    The error occurred on the application server FMSAP995_PET_02 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
    Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
    Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
    Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMPONENT~VIEW_MODIFY of program CL_SALV_WD_A_COMPONENT========CP
    -Gopal
    Message was edited by: gopalkrishna baliga

  • A dynamic table based on run-time created view object -- please help!

    Hello!
    I'm trying to create a dynamic table based on an run-time created view object. All go ok, but table binding component take the first view/iterator state and don't reflect changes they have. Please, take a look:
    1. At run-time the view is being replaced by new red-only one based on query in application module:
    getQueryView().remove();
    createViewObjectFromQueryStmt("QueryView", statement);
    2. Page definition file contains an iterator (using iterator or methodIterator - doesn't matter) binding and table, which binds to the iterator, like:
    <methodIterator id="distributeQuery1Iter" Binds="distributeQuery1.result"
    DataControl="QueryServiceDataControl" RangeSize="10"/>
    <table id="distributeQuery11" IterBinding="distributeQuery1Iter"/>
    3. The page code uses <af:table>. But, if I use table binding (it's right) like this:
    <af:table var="row" value="#{bindings.distributeQuery11.collectionModel}">
    <af:forEach items="#{bindings.distributeQuery11.attributeDefs}" var="def">
    the table will never changed (i.e. still show the first view instance).
    When I tried to use iterator binding directly (it's bad and cannot provide all needed features unlike CollectionModel from table binding) I saw that table works!
    (Code is somehing like:
    <af:table var="row" value="#{bindings.myIterator.allRowsInRange}">
    <af:forEach items="#{bindings.myIterator.attributeDefs}" var="def">
    Why the table binding do not reflect changes in iterator? Or should I use different approach?
    Thanks in advance!
    Ilya.

    I got it to work! I used a hybrid approach comprised of some of your code and some of Steve Muench's AcceessAppModuleInBackingBean example.
    In the setBindings method, I execute an app module method that redefines the query, then I used your code to delete and recreate bindings and iterator:
    public void setBindingContainer(DCBindingContainer bc) {
    this.bindingContainer = bc;
    rebuildVO();
    The rebuildVO() method looks like the code you provided in your example:
    private void rebuildVO() {
    DCDataControl dc;
    DispatchAppModule dApp;
    DCBindingContainer bc;
    DCIteratorBinding it;
    OperationBinding operationBinding;
    ViewObject vo;
    DCControlBinding cb;
    try {
    bc = getBindingContainer();
    dc = bc.findDataControl(DATACONTROL);
    dApp = (DispatchAppModule)dc.getDataProvider();
    // Execute App Module Method to rebuild VO based upon new SQL Statement.
    dApp.setDispatchViewSQL();
    vo = dApp.findViewObject(DYNAMIC_VIEW_NAME);
    it = bc.findIteratorBinding(DYNAMIC_VO_ITER_NAME);
    it.bindRowSetIterator(vo, true);
    // logger.info("Remove value binding...");
    cb = bc.findCtrlBinding(DYNAMIC_VIEW_NAME);
    cb.getDCIteratorBinding().removeValueBinding(cb);
    bc.removeControlBinding(cb);
    // logger.info("Creating new value binding...");
    FacesCtrlRangeBinding dynamicRangeBinding =
    new FacesCtrlRangeBinding(null,
    bc.findIteratorBinding(DYNAMIC_VO_ITER_NAME), null);
    // logger.info("Add control binding...");
    bc.addControlBinding(DYNAMIC_VIEW_NAME, dynamicRangeBinding);
    } catch (Exception e) {
    e.printStackTrace();
    And my App Module method that redefines the view object looks like this:
    public void setDispatchViewSQL() {
    String SQL =
    "begin ? := PK_BUsiNESS.F_GETDISPATCHVIEWSQL();end;";
    CallableStatement st = null;
    String ViewSQL = null;
    try {
    st = getDBTransaction().createCallableStatement(SQL,
    DBTransaction.DEFAULT);
    * Register the first bind parameter as our return value of type LONGVARCHAR
    st.registerOutParameter(1, OracleTypes.LONGVARCHAR);
    st.execute();
    ViewSQL = ((OracleCallableStatement) st).getString(1);
    findViewObject(DYNAMIC_VO_NAME).remove();
    ViewObject vo = createViewObjectFromQueryStmt(DYNAMIC_VO_NAME, ViewSQL);
    vo.executeQuery();
    } catch (SQLException s) {
    throw new JboException(s);
    } finally {
    try {
    st.close();
    } catch (SQLException s) {
    s.printStackTrace();
    When I run it I get my desired results. One thing I don't quite understand is why when the page is first rendered it shows the last set of records rather than the first. Now I have to figure out how to put navigation URLS in each of the table cells.
    Thanks for your help; I would not have gotten this far without it,
    Jeff

  • Select item on a Tabular form with a different dynamic LOV on each row

    I would like to use a tabular form where one of the columns is a dynamic LOV based Select, and where that dynamic LOV refers to one of the column values on each row.
    So if the tabular form represented a list of teams and the LOV-based Select column was the current team leader, I would want that select list to be populated only with the members of that team (different for each row). Since the list of team members is in some other table (all_players or something) I would want to populate the LOV with a query with a where clause that selected only those players records with a team-membership equal to the current tabular form's team id. So, on each row that select list's contents would be different.
    -- Justin

    I'm beating a dead horse here but I did get something to work with "less" code. My current needs do not require me to cascade drop downs, I only want 1. You can use the query like the in the first reply (but I don't have a table with joins) I created a simple two column table dept_emp with 4 records 10,null 20,null .... I want to fill the nulls with an employee but ONLY an employee that matches the dept. (Same concept of team leader and members).
    Here's the query:
    select apex_item.display_and_save(1,dept) dept,
    apex_item.select_list_from_query(2, name, 'select ename from emp where deptno='||dept) name
    from dept_emp
    I removed the code that was there already (ApplyMRU) and just put in this code:
    BEGIN
    FOR i IN 1..HTMLDB_APPLICATION.G_F01.COUNT LOOP
    UPDATE dept_emp
    SET
    name=HTMLDB_APPLICATION.G_F02(i)
    WHERE dept=to_number(HTMLDB_APPLICATION.G_F01(i));
    END LOOP;
    END;
    The G_F01 matches the column 1 and so forth. There's more documentation but little explanation at:
    http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/api.htm#sthref2171
    The thing I could not get to work was a dynamic message
    #MRU_COUNT# row(s) updated, #MRI_COUNT# row(s) inserted.
    Not sure when the MRU_COUNT gets populated (probably in the routine I removed ;))
    You're probably way past me by now but I like to have as little code as possible when it comes to maintaining an app. That's why I liked oracle forms so much. This kind of stuff was pretty easy to do.
    Thanks again everybody!

Maybe you are looking for

  • Date format problem in forms?

    I basically want the following.. in a date text item. 1st Jan 2008 if DD is 1 character and 20th Jan 2008 if DD is 2 characters. not 01st Jan 2008 20th Jan 2008 In SQL i can do this with date format 'FMddth Mon, YYYY' In forms though this does not wo

  • No defineded RFC destination for global trade service----urgency!!!!

    how can i resolve this problem for [<b>STOP]</b> Message, just on one sever, not connect any other R/3 system, when i execute mb1c,input  a material information, and try to save the input messages , the system pop up the [<b>stop</b>] error:     <b>

  • Best approach for Item Views: Categories? Perspectives? Attributes?

    I've got three different types of documents: Policies, Standards, Procedures. Right now they are each given a corresponding category. I have one area where all documents of all categories appear in three custom search lists. I'd like to have a second

  • Struts RequestProcessor or Action derivated class?

    Hello there, I just started to develop a project 10 days ago, and although I have read a struts-related book and some articles I want to make sure about some best practices while using this framework. I have read that it is recommended to extend Requ

  • Is it possible to have non-rectangular app windows in Java?

    Do all apps have to be rectangular or can I change their shape? Also, is there an icon chooser dialog in java, where I can choose a file and all of its icons will be displayed, allowing me to choose one? If not, does anyone have any suggestions as to