How to value non-table items in Forms

Portal 3.0.7.6.2 on NT
I am trying to display non-table items on a Form. I want to do things like: Display the Credit Card Type (non-table item) based on the Credit Card Number (table column). Use a foreigh key (table column) to retrieve related data for display/information only on the Form. The doesn't appear to be p_session variables for these 'added' Form items so I can't use the p_session functions. Any ideas??? I'd prefer a PL/SQL solution.

Hi Michael,
As Dmitry said that values for non table form field cannot be displayed completely using pl/sql, u can use some pl/sql and some javascript to achieve this .
Say, take the example of the Emp table where I would like to display the department name for the deptno. Here I'll use pl/sql to retrieve the value of department name using the deptno and use javascript to display the results in the new field added to the form.
Steps :
1> Create a form say, on the emp table
2> In the field formatting section, add a new item of the type text box and add a javascript event onFocus and give the foll javascript function call for the same :-
javascript:getval(this)
3> In the additional pl/sql section, for the "after displaying page ..." part we'll add the following pl/sql code :-
declare
l_dno number(4) default null;
l_desc varchar2(100);
begin
l_dno := p_session.get_value_as_NUMBER
(p_block_name => 'DEFAULT',
p_attribute_name => 'A_DEPTNO',
p_index => 1);
if l_dno is not null then
begin
select dname into l_desc
from scott.dept
where deptno = l_dno;
exception
when others then
null;
end ;
end if;
htp.p('<script>');
htp.p('function getval(ele){'&#0124; &#0124;chr(10)&#0124; &#0124;
'ele.value = "'&#0124; &#0124;nvl(l_desc,' ')&#0124; &#0124;'";}');
htp.p('</script>');
end;
4> Run the form and perform a query. Place the cursor on the desc field after the page reloads with results. The department name would come up.
Hope this helps.

Similar Messages

  • How to set_value for non-table items.

    I have a form, based on scott.emp, with a button and three fields, empno, ename and xxx. The empno and ename fields are based on the scott.emp table, whereas the xxx field is a non-table based field.
    Setting xxx text type to either a text area or text box makes no difference.
    The following code in the buttons PL/SQL Button Event Handler, Custom section results in a (WWV-00000) error.
    begin
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_XXX',
    p_value => 'Hello');
    end;
    However, if I change the p_value to ename, a table based item, the code works as expected.
    I ran across a post that had the following link
    Re: transactions
    Regarding setting values for non-table items. Unfortunately, the post was made prior to the latest discussion forum reorganization, so it's no longer valid.
    I would appreciate any help on the problem.
    Thanks, Larry

    Hi,
    Try using set_value_as_string
    begin
    p_session.set_value_as_string(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_XXX',
    p_value => 'Hello');
    end;
    Thanks,
    Sharmila

  • How to assign NULL value to an ITEM in Forms Personalization?

    Hi,
    how to assign NULL value to an ITEM in Forms Personalization?
    please suggest me.
    Thanks

    I don't know what your form personalization does and maybe I misunderstand you ...
    Try
    :item_name := null;

  • Lov in non-tables-items

    I have a problem.
    i need a LOV in a non-table-items.
    Is this possible in Designer 2.1.1 using Headstart?
    Using forms its very simple.
    How i do this using Headstart?
    Thanks
    null

    In a pre-query trigger alter the where clause of the main block to query the main table based on non-database values...
    Use the set_block_property procedure and the 'DEFAULT_WHERE' clause or the 'ONETIME_WHERE' property...
    example...
    set_block_property('MYBLOCK', ONETIME_WHERE,
    'where main_table.id in (
    select id from my_non_db_block_table where mycol = :my_non_db_field)');
    To accept wild cards you will probably have to change the = to a "like" above..
    You will have to build your where clause by adding a "and" condition for each non-db field.
    Message was edited by:
    Mark Reichman

  • Best way to query on a non-table item?

    Hi,
    I have a form that has customer_name (non-table item) and customer_id (table item). Customer_id is not visible to the user. We need to be able to query on the customer_name. I have tried using the pre-query trigger but I get an error ORA-01422. Any suggestions would be appreciated. I am a non-technical person, so the simpler, the better.
    Thanks in advance.
    Trish

    Hi ,
    I know two alternatives:
    1) Use the POST-QUERY trigger not the PRE-QUERY... But, you would have the same problem because i think that the customer_id column is not unique. So you should select a combination of columns which guarantee the uniqueness of the selected column...
    2)Other design. Read the doc at :
    http://www.oracle.com/technology/products/forms/pdf/BlockOnAJoin.pdf
    Using this way you should not use the trigger POST-QUERY....
    Regards,
    Simon

  • How to include non database item in the query

    Hi
    I have a Master-Detail form. where in the detail block one of the field is text item 'X' attached the list of values(Y). Master block includes non database items which is based in the decoding result of the database items for example:
    Gender(Male, Female)>> non database item
    Gender_id(M,F)>>database item
    the form is created based on the template.fmb form for apps. When I run the form in the query mode, i can query about any database item while including query about others non database item does not affect.
    how to can i modify it so this could be handled??
    I know that one way to avoid this issue is to create a view with all my desired field.
    but there should be away to override the build in query used by oracle apps...
    any one has a link, source, document... etc that help on this??
    any idea how to do it without creating a view??
    thnx alot

    Hi HST,
    You can code the handling in POST-Query of the corresponding block to retrive the corresponding data depending on the Queried data.
    Regards,
    Kiran

  • How to query non database items

    hi every one
    I have database block has database items and non database items
    i want to make query in that non database items to retrieve data by that non database items and database items
    thinks

    Hi Every one
    I want to use the non databsae item in query to retireve data by it
    Example
    In table emp
    emp_id
    emp_name
    Dept_id
    But in Form
    Emp_name
    Dept_name
    When endtr data open lov to retireve Emp name and emp id
    and when enter department name in table enter dept id but in form user see dept name in form .
    but if he try to use dept name in query he can't because it non database item .
    How can i use this item in my query to retireve data by dept name ?

  • How to use nested tables in adobe form

    Hi All,
    I have to use nested tables in adobe form for table display. I have used Subforms for displaying table data. I have changed accessibility of the subforms. Currently i am able to print print the table correctly if there is single material record in table 1 and single corresponding record in table 2. But the requirement is that i will have multiple lines in table 1 for single material and only one record in table 2.
    EX: form is for Sales order. in line items if the order is for 100 units then we if we have delivered material as 80, 10, 10, then table 1 will have 3 lines for this. Table 2 will always have only 1 corresponding record.
    item--materialdescription-ordered qty--delivered qty--delivery date-price  
    xxx--xxxxxxx-xxxxxxxxx-10080xxxxxxxxxx-xxxx
    10----
    xxxxxxxxxx
    10----
    xxxxxxxxxx
    yyyyyyyyyyyyyyyyyyy------yyyyyyyyyyyyyyyyyyyyy 
    xxxxxx is table 1 and will have multiple lines
    yyyyyy is table 2 and will have only 1 entry for item xxx
    and this group will be repeate as per no of items. table 1 can have any no of lines per item.
    I am currently able to display 1 line for table 1 and 1 line for table 2.
    But how to show multiple lines for table 1 and 1 line for table 2.

    HI,
          Set the body page as flowed and set the tables also flowed.
    go to bodypage>object->subform-->select flowed option.
    I thihnk this will work..if u are getting all the records properly into the tables 1 and 2.
    Thanks,
    Mahdukar

  • Query Non Database items in form

    I need to be able to query non database items in the form.

    Hi,
    Yes you can do this. You have to create control items all of them have same data type and lenght as table's. then you can issue select statement. eg.,
    select field1, field2
    into :item1, :item2
    from table_name;
    Hope this helps
    Mustafa

  • How to exclude non-released items in the COLLECTION_COPY_ALL service call?

    I am using IdcCommand to copy all content items from one folder to another folder (archives folder) on every day.
    # Copy the latest version of the file from source location to target location
    @Properties LocalData
    IdcService=COLLECTION_COPY_ALL
    fromhasCollectionPath=true
    fromdCollectionPath=/Contribution Folders/folderA/
    tohasCollectionPath=true
    todCollectionPath=/Contribution Folders/folderB/
    @end
    <<EOD>>
    But this service also copies the unreleased/unpublished work-items from the workflow with dCollectionPath=/Contribution Folders/folderA/. How can I exclude the non-released items in the COLLECTION_COPY_ALL service call?

    Vipin Pillai wrote:I changes the source and target folders in the hda file dynamically as part of the requirement; these dynamic changes are not possible with Archiver. The archiver option is a complicated way of doing it. Actually that's not correct. It's actually much easier to use Archiver, but it requires some reading.
    You can certainly use dynamic values in Archiver, as the import map value fields are Idoc scriptable - it's just not openly obvious to do this. To illustrate, suppose I have a a custom field called "xSaleDate". I can export items out, and reimport them, applying today's date to the xSaleDate field using <$dateCurrent()$> in the import map field. Historically I tend to create custom components and put very complex logic in a resource include ("myExternalLogic"), and then in Archiver, in the import map just put <$include myExternalLogic$>.
    You can also do the same logic in a profile rule, which is even easier than an import map. Then the auto archiver suggestion becomes very powerful, and way simpler. I've done very many variations of this over the years, and it works well. Again it just requires some reading.

  • How to create a table in smart form.

    Hi Folks,
    I need to create a table in  smart form with the following fields:-
    vbrp-arktx,vbrp-fkimg,komv-kbetr,komv-kwert.
    Please let me know how to create a table and how to name the columns,size,and the select query for the same.
    All answers will be duly rewarded.
    K.Kiran.

    Hi,
    Following Links gives Details of Smartforms and how to create tables -
    smartforms - very useful link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    FAQ
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Siddhi

  • Saving values into table from Interactive Form

    Hallo together,
    iam trying to do the example "Include Tables" (SAP Interactive Forms by Adobe - Galileo Press).
    It works, but not as described. When i want to change data in the interactive_forms ui element and press the webdynpro native button send, the value at the webdynpro table does not change. When i change the value at the webdynpro table and press the send button at the form or change the line at the webdynpro, the value in the adobe formular changes too. Thats one problem.
    The other problem is that i want to save the changed/added data from the formular at the database. What to do? The form layout is "ZCI Layout" and i added the script:
    DO NOT MODIFY THE CODE BEYOND THIS POINT - 800.20070708051308.406522.403406 - ContainerFoundation_JS
    I also added this into "wddomodifyview":
    METHOD wddomodifyview .
      DATA: lr_interactive_form TYPE REF TO cl_wd_interactive_form,
                 lr_method_handler TYPE REF TO if_wd_iactive_form_method_hndl.
      CHECK first_time = abap_true.
      lr_interactive_form ?= view->get_element( 'FORM' ).
      lr_method_handler ?= lr_interactive_form->_method_handler.
      lr_method_handler->set_legacy_editing_enabled( abap_true ).
    ENDMETHOD.
    I selected also:
    execute at: "Server and Client"
    I dont know what to do anymore.
    Best regards
    Philip

    Hi,
    To make an input enabled table. I would suggest to use TABLE element from the PDF library and then binding the columns from your context.
    Step 1: Library -> Standard ->Table
    Select create using assistance.
    Select body rows vary depending on data .
    Select number of Columns in your case it will be 4.
    Then proceed further and finish as per your need.
    Step 2:
    Select a table Column .
    Select Pallets->Object then chnage the cell type from Text to text field.
    Then click on binding tab and bind it to the respective field from hierarchy.
    Select upgrade the following properties radio button and check only "default value" option.
    This will create binding something like this $record.SCARR.DATA[*].CARRID
    Follow this for all other columns.
    Step 3:
    Now create a button in the View holding your form(you can also use SUBMIT button of form). On action event of this button right the following code to get all the changed values from Table.
    data lt_scarr type wd_this->elements_scarr.
      call method lo_nd_scarr->get_static_attributes_table
        importing
          table = lt_scarr.
    LT_SCARR will contain all the new values from Form. Then use this table to update ur database table.
    Thanks,
    Abhishek

  • How to convert non stock item in to stock item.

    hi
    cud any one let me know how will in convert non stock item in to stock item.
    regards
    manish sharma

    Dear Manish.
    please check the below link for your answers. Before posting any question please do check the forum. That's the easy way to find an answer.
    Change item category in a PO
    Non-Stock items convert to Stock
    Hope it will help you.
    Regards,
    Alok Tiwari

  • How to show desired value in list item, when form starts?

    Hello.
    I have list item with values:
    April 2006
    May 2006
    June 2006
    July 2006
    August 2006
    September 2006
    When the form starts, i want to show in my list item current month (August 2006). And when i open list item above list would appear with August 2006 selected.
    How can i do that?
    Thanks.

    Hi Dejan,
    What you have to do is the following:
    After populating your list, write some code similar to what I have given here.
    FOR n IN 1..nCnt LOOP
    IF Get_list_element_value('list', n) = To_char(sysdate, <date format for the current month n year> THEN
    :list := To_char(sysdate, <date format for the current month n year>
    RETURN;
    END IF;
    END LOOP;
    :list := NULL; -- in case nothing matches
    You can use this in WNFI trigger and wherever necessary.
    Check whether this solves your problem
    Warm Regards,
    Raja.

  • How to search for CLOB item in Form?

    I create a table
    CREATE TABLE PHOTOS
    (PHOTO_ID VARCHAR2(15) NOT NULL,
    PHOTO_IMAGE BLOB,
    TEXT_DESCRIPTION CLOB,
    FILENAME VARCHAR2(50),
    FILE_SIZE NUMBER NOT NULL,
    ACCESS_RIGHT VARCHAR2(7) NOT NULL,
    CONSTRAINT CK_ACCESS_RIGHT CHECK (ACCESS_RIGHT IN ('PRIVATE', 'PUBLIC')),
    CONSTRAINT PK_PHOTOS PRIMARY KEY (PHOTO_ID)
    create index idx_photos_text_desc on
    PHOTOS(TEXT_DESCRIPTION) indextype is ctxsys.context;
    INSERT INTO PHOTOS VALUES
    ('P00000000000001', empty_blob(), empty_clob(),
    'SCGP1.JPG',100,'PUBLIC');
    INSERT INTO PHOTOS VALUES
    ('P00000000000002', empty_blob(), 'Cold Play with me at the concert in Melbourne 2005',
    'COLDPLAY1.JPG',200,'PUBLIC');
    INSERT INTO PHOTOS VALUES
    ('P00000000000003', empty_blob(), 'My parents in Melbourne 2001',
    'COLDPLAY1.JPG',200,'PRIVATE');
    COMMIT;
    EXEC CTX_DDL.SYNC_INDEX('idx_photos_text_desc');
    I created a Form which maintains the above table. I found that the Query By Example does not work for TEXT_DESCRIPTION which is CLOB.
    How can I search text in CLOC using Forms?
    Message was edited by:
    wyfwong

    What version of forms? There is a Forms/CLOB bug that gets fixed in 10g Forms.
    Note:252285.1
    ORA-932 When Querying a Block Based on From-Clause-Query With CLOB

Maybe you are looking for

  • Howto install/run MI 7.0 within WM6.1

    Hello I am a newbie to SAP and normally doing support for a device manufacturer. I had to support the install of MI 7.0 last friday and found a very irritating failure. I then started a test scenario with Mobile Device Emulator and a Mobile 6.1 Prof.

  • ADI and Custom Integrator

    All, Need some help. I have a custom table and I want to load some custom data. Would like to load using ADI. I can see hints about Custom Integrator that suggests that may be possible, but can find no documentation. Is this possible? Is there any do

  • Setting a Conditional Display for a Menu

    Hi, I'm having a lot of trouble setting conditional displays for my menus, and I was hoping somebody will be able to assist me. The main page of my application allows the user to search for facilities by state, by city, or by zip code. Each search go

  • CProjects 4.0 - Resource Search

    Having specified the 'Qualification' and 'Minimum Availability', when I do a resource search, I get the list in line with the expected. On this page, few of the columns - Resource Name, Assignment, Suitability etc. have the expected (and right) value

  • Error in transfer posting between storage location

    Hi experts, while i am transferring the material from one storage location to other in MB1B by movement type 311 , while saving it shows the below error Data for creating a delivery is incomplete (Vendor) Message no. M7279 regards arun