Assigning a Value to a Base Table BLock Field

hi,
I have a form in which a block is a base table block . i need to change the value of a field. currently it shows the value of a field from the Table on which the block is based . I need to change the value of that field to display some other value of another table.
i have a written select statement like this
select name into vname from ws_emp where ecode = 101
then i have assigned to this base table field
:bt_person.ti_v_name := vname;
this i have created in the base table blocks Post query
but it is not assigning value
pls correct me and suggest me if there is any other better method to do this
Sarav

That SHOULD work in the Post-Query trigger of the block, but doing that is never a good idea. By replacing a base-table field with any value, it causes Forms automatic processing to lock the row immediately, so no other person running your form can call up the same data. And it causes Forms to think you need to update the record, so the record's status is changed to 'CHANGED' from 'QUERY'.
It would be better to create a non-base-table field in the block, and put the name into that field.

Similar Messages

  • Non DB item in a base table block, gives frm-40202 error.

    Dear All,
    We are using forms6i as a front end. To simulate the error, consider the following example.
    1.Create a multirecord emp block.
    2.Add a non database item in the base table block.
    3.Assign any value to the non database item, in the when new record instance trigger.
    4.When i say F7 or F8, my block asking me like, field must be entered. Which means, my record status changed to Insert. But there is no change in base table record, since i modified only in the non base table item.
    Please validate, whether i am doing anything wrong in my technique.
    Regards,
    Balaji

    If you have a value to be used as the default value then you can use "Initial Value" property in the item level for the Non Database Item. If you do this it wont give you any problem during the query. If you create a new record then the value which you have put as the default will come automatically.

  • Updating a Base Table Block Record

    We have a form where there is a multi array base Table block. this is used for generating employee number for various depts. the columns are like this with some sample data
    Dept Start No end No Start Date End Date
    sales 1001 1100 01-Jun-2009 31-12-2050
    Accts 2001 2100 01-Jun-2009 31-12-2050
    HR 3001 3100 01-Jun-2009 31-12-2050
    and the data is populated from its table. These Data were created at the backend while implementation and is not modified for some long time. Now the client wants to modifiy the data . i.e they want to add new set of Start nos and End nos for the existing Dept So they will add at the bottom of the Block
    like this
    sales 1101 1200 01-Apr-2011 31-12-2050
    when they add this the end date of the existing record should get modified with sysdate as they add the new records. at any time they can add new set of numbers of any number of depts.
    can u please guide me how to do this ?

    If I understand correctly, you need to take the following data:
    Dept  Start No   end No   Start Date   End Date
    sales 1001       1100     01-Jun-2009  31-12-2050
    Accts 2001       2100     01-Jun-2009  31-12-2050
    HR    3001       3100     01-Jun-2009  31-12-2050and change it so it is like this:
    Dept  Start No   end No   Start Date    End Date
    sales 1101       1200     01-Apr-2011   31-12-2050
    when they add this the end date of the existing record should get modified with sysdate as they add the new records.First, I will assume you are using Oracle Forms (since your question was in the Forms forum) but you didn't specify a version. In Forms, you could easily put this logic in the Block Pre-Inser t Trigger. You'll have to set the SYSDATE through DML rather then requery the block after changes are saved. This is easier than trying to find the existing record in the block and setting the SYSDATE.
    at any time they can add new set of numbers of any number of depts.Is this data used for anything more than just reference? If so, what is the key value and how does making changes like this affect the existing data and relationships?
    Just from the small description you gave, the process sounds very closed - meaning it is not easily changed. If this is true, than you probably need more than just "Use a Pre-Ins Trigger" answer. You also need to know how to update all of the related records that just changed because of the new department number and for this answer we'll need more information. ;)
    Craig...

  • How do i display input values (POV) for a table control field

    Hi guyz !
    How do i display input values (POV) for a field in table control,
    i mean when user presses F4 on a table control field.
    Please help.
    Thanks
    jahan

    PROCESS ON VALUE-REQUEST( F4 ) statement  
    Code to demonstrate how to perform a manual value help(F4) on a particular field using the PROCESS ON VALUE-REQUEST statement and how to return values back to a table control on the screen. For standard screen fields simply move the value to the appropriate screen field name.
    * Screen flow logic........
    PROCESS BEFORE OUTPUT.
    *MODULE PBO_MODULE.
    PROCESS AFTER INPUT.
    *MODULE PAI_MODULE.
    PROCESS ON VALUE-REQUEST. "F4
      FIELD EKPO-EBELP MODULE help_ekpo.
    MODULE help_ekpo INPUT.
    **Transport values to table dynpro/screen table control
      DATA: l_stepl LIKE  sy-stepl,
            l_indx  LIKE  sy-stepl.
      DATA: dynpfields        LIKE dynpread OCCURS 5 WITH HEADER LINE.
    * Adjust for scroling within table control
      CALL FUNCTION 'DYNP_GET_STEPL'
        IMPORTING
          povstepl        = l_stepl
        EXCEPTIONS
          stepl_not_found = 0
          OTHERS          = 0.
      l_indx = tc_ekpotable-top_line + l_stepl - 1.
              "tc_ekpotable should already have been declared
      REFRESH dynpfields.
      CLEAR   dynpfields.
      dynpfields-fieldname  = 'EKPO-EBELN'.
      dynpfields-fieldvalue = '00010'   "wa_ekpo-ebeln.
      dynpfields-stepl      = l_stepl.
      APPEND dynpfields.
      dynpfields-fieldname  = 'EKPO-EBELP'.
      dynpfields-fieldvalue = '00020'   "wa_ekpo-ebelp.
      dynpfields-stepl      = l_stepl.
      APPEND dynpfields.
      CALL FUNCTION 'DYNP_VALUES_UPDATE'
        EXPORTING
          dyname     = 'SAPLZZ_EKKO'    "Program name
          dynumb     = '0100'           "Screen number
        TABLES
          dynpfields = dynpfields
        EXCEPTIONS
          OTHERS     = 0.
    ENDMODULE.                 " help_ekpo  INPUT
    reward points  if it is usefull ..
    Girish

  • Assign a value to a component of a field-symbol

    Hi,
    I'm struggling with field-symbols, hope someone can help me with this:
    I have two field-symbols:
    - <row> which for example can have structure E1P0002 assigned to it;
    - <row_it> which for example can have stucture P0002 assigned to it.
    Certain components of <row> should be assigned to components of <row_it>. The names of the components differ however. For instance: component STRAS_40 of <row> should be assigned to component STRAS of <row_it>, NAME2_40 of <row> should be assigned to NAME2 of <row_it>, etc.
    Depending on the structures assigned to the field-symbols, these fields are not always available.
    Any ideas how this can be solved?
    Thanks,
    Patrick

    Hi do as follows,
              <row_wa> is the structure of type P0002
    and <row_it> is a field symbol of table type
    and another field symbol <fs> type any.
    if <row>-STRAS_40 is not initial.
    assign component  STRAS of  structure <row_wa> to <fs>.
    <fs> = <row>-STRAS_40 .
    endif.
    if <row>- NAME2_40 is not initial.
    assign component  NAME2 of  structure <row_wa> to <fs>.
    <fs> = <row>-NAME2_40 .
    endif.
    append  <row_wa> to <row_it>.
    Hope this explanation of mine helps you,
    Murthy.

  • How to assigne multiple value in key of read table

    Hi gurus,
    I want read table xxxx with key field1 = ' xxx' or field1 = 'yyy'.
    how to assign multiple value as key for the same field while reading internal table.
    Regards
    sagar

    Hi ,
    You can loop the internal table like
    loop at  <table xxxx> where field1 = ' xxx' or field1 = 'yyy'
    or you can write two read statements to read the internal table in wrk area.
    read table   <table xxxx> with key field1 = ' xxx'.
    if sy-subrc <>0
    read table   <table xxxx> with key field1 = 'yyy'.
    if sy-subrc = 0
    endif.
    else.
    do your data processing.
    endif.
    Thans.

  • Tabular form with non base table field

    I want to develop a tabular form with
    1. A non-base table edit field to accept a value
    2. Insert/update another table based on the input value
    3. Also, computed field on each row based on other fields on the records (like post-query trigger in oracle forms at block level - for each row)
    Thanks,
    Rachna

    Thanks for your reply.
    Varad, I like the link you sent me. It has a lot of good information.
    I created a process (under page processing) called "Update/Insert Process" that dosn't seem to be working.
    Question, I created a manual tabular form with SQL Query and created a process (under page processing) called "Update/Insert Process", then I check for each record in the tabular form. If the old value <> new value then I update/insert in the new table.
    Any step by step will be highly apprciated - to create process/validation etc.
    Thanks,
    Rachna

  • How to update base view Block

    Hi,
    I have a View ( is based on more than one table) and created base table block based on that view.
    Question is, how can I update and save the data from Oracle forms ?
    I'm using Oracle forms 4.5 and Oracle8.0.6 database.
    Thanks in advance.

    Hi James
    Form based on Complex views:
    Records can be updated by writing the code in ON-UPDATE Trigger,
    Code for Inserting a record can be written in ON-INSERT trigger
    For delete u can write the code in ON-DELETE or KEY-DELREC (this worked for my form)
    Locking the rows can be done by ON-LOCK trigger.
    Here is the sample code....
    try to write a package and in that package write procedure for, insert, update, delete, lock, Call those procedures in your trigger which should be on your block level. Block's property that you have to set is: go to the property pallette:
    LOCKING MODE: IMMIDIATE
    KEY MODE: UPDATEABLE
    CODE FOR INSERT:
    --change field names according to your field names
    Package Spec:
    PACKAGE XXCPCRQM_PKG IS
    PROCEDURE insert_row;
    PROCEDURE update_row;
    PROCEDURE delete_row;
    PROCEDURE lock_row;
    END;
    Package Body:
    PACKAGE BODY XXCPCRQM_PKG IS
    --Procedure to Update Row into cpt_ar_charge_to_master table
    PROCEDURE update_row IS
    BEGIN
    UPDATE cpt.cpt_ar_charge_to_master
    SET
    ACCOUNT = :XXCPCRQM_BLK.ACCOUNT,
    SUFFIX = :XXCPCRQM_BLK.SUFFIX,
    REPORT_CODE = :XXCPCRQM_BLK.REPORT_CODE,
    CHARGE_TO_ACCOUNT = :XXCPCRQM_BLK.CHARGE_TO_ACCOUNT,
    CHARGE_TO_SUFFIX = :XXCPCRQM_BLK.CHARGE_TO_SUFFIX,
    CREATION_DATE = :XXCPCRQM_BLK.CREATION_DATE,
    CREATED_BY = :XXCPCRQM_BLK.CREATED_BY,
    LAST_UPDATE_DATE = :XXCPCRQM_BLK.LAST_UPDATE_DATE,
    LAST_UPDATED_BY = :XXCPCRQM_BLK.LAST_UPDATED_BY
    --WHERE ROWID = :XXCPCRQM_BLK.ROW_ID;
    WHERE CHARGE_TO_ID = :XXCPCRQM_BLK.CHARGE_TO_ID;
    EXCEPTION
    when NO_DATA_FOUND
    then
              fnd_message.debug('CAN NOT UPDATE RECORD');
    raise form_trigger_failure;
    commit;
    END;
    --Procedure to Insert Row into cpt_ar_charge_to_master table
    PROCEDURE insert_row IS
    BEGIN
    INSERT INTO cpt.cpt_ar_charge_to_master
    (CHARGE_TO_ID,
    ACCOUNT,
    SUFFIX,
    REPORT_CODE,
    CHARGE_TO_ACCOUNT,
    CHARGE_TO_SUFFIX,
    CREATION_DATE,
    CREATED_BY,
    LAST_UPDATE_DATE,
    LAST_UPDATED_BY)
    VALUES
    (cpt_chrg_to_id_s.nextval, -- Sequence
    :XXCPCRQM_BLK.ACCOUNT,
    :XXCPCRQM_BLK.SUFFIX,
    :XXCPCRQM_BLK.REPORT_CODE,
    :XXCPCRQM_BLK.CHARGE_TO_ACCOUNT,
    :XXCPCRQM_BLK.CHARGE_TO_SUFFIX,
    :XXCPCRQM_BLK.CREATION_DATE,
    :XXCPCRQM_BLK.CREATED_BY,
    :XXCPCRQM_BLK.LAST_UPDATE_DATE,
    :XXCPCRQM_BLK.LAST_UPDATED_BY);
    EXCEPTION
    when NO_DATA_FOUND
    then
              fnd_message.debug('CAN NOT INSERT RECORD');
    raise form_trigger_failure;
    commit;
    END;
    --Procedure to Delete rows from cpt_ar_charge_to_master
    PROCEDURE delete_row IS
    BEGIN
    DELETE FROM cpt.cpt_ar_charge_to_master
    WHERE charge_to_id = :XXCPCRQM_BLK.charge_to_id;
    EXCEPTION
    when NO_DATA_FOUND
    then
              fnd_message.debug('CAN NOT DELETE RECORD');
              raise form_trigger_failure;
    commit;
    END;
    PROCEDURE lock_row IS
    Counter NUMBER;
    CURSOR C IS
    SELECT
    CHARGE_TO_ID,
    ACCOUNT,
    SUFFIX,
    REPORT_CODE,
    CHARGE_TO_ACCOUNT,
    CHARGE_TO_SUFFIX
    FROM cpt_ar_charge_to_master
    WHERE charge_to_id = :XXCPCRQM_BLK.CHARGE_TO_ID
    FOR UPDATE of CHARGE_TO_ID NOWAIT;
    Recinfo C%ROWTYPE;
    BEGIN
    Counter := 0;
    LOOP
    BEGIN
    Counter := Counter + 1;
    OPEN C;
    FETCH C INTO Recinfo;
    if (C%NOTFOUND) then
    CLOSE C;
    FND_MESSAGE.Set_Name('FND','FORM_RECORD_DELETED');
    FND_MESSAGE.Error;
    Raise FORM_TRIGGER_FAILURE;
    end if;
    CLOSE C;
    if (
    (Recinfo. CHARGE_TO_ID = :XXCPCRQM_BLK.CHARGE_TO_ID)
    AND ( (Recinfo. ACCOUNT = :XXCPCRQM_BLK.ACCOUNT)
    OR ( (Recinfo. ACCOUNT IS NULL)
    AND (:XXCPCRQM_BLK.ACCOUNT IS NULL)))
    AND ( (Recinfo.SUFFIX= :XXCPCRQM_BLK.SUFFIX)
    OR ( (Recinfo.SUFFIX IS NULL)
    AND (:XXCPCRQM_BLK.SUFFIX IS NULL)))
    AND ( (Recinfo.REPORT_CODE = :XXCPCRQM_BLK.REPORT_CODE)
    OR ( (Recinfo.REPORT_CODE IS NULL)
    AND (:XXCPCRQM_BLK.REPORT_CODE IS NULL)))
    AND ( (Recinfo.CHARGE_TO_ACCOUNT = :XXCPCRQM_BLK.CHARGE_TO_ACCOUNT)
    OR ( (Recinfo.CHARGE_TO_ACCOUNT IS NULL)
    AND (:XXCPCRQM_BLK.CHARGE_TO_ACCOUNT IS NULL)))
    AND ( (Recinfo.CHARGE_TO_SUFFIX = :XXCPCRQM_BLK.CHARGE_TO_SUFFIX)
    OR ( (Recinfo.CHARGE_TO_SUFFIX IS NULL)
    AND (:XXCPCRQM_BLK.CHARGE_TO_SUFFIX IS NULL)))
    ) then
    return;
    else
    FND_MESSAGE.Set_Name('FND','FORM_RECORD_CHANGED');
    FND_MESSAGE.Error;
    Raise FORM_TRIGGER_FAILURE;
    end if;
    EXCEPTION
    When APP_EXCEPTIONS.RECORD_LOCK_EXCEPTION then
    IF (C% ISOPEN) THEN
    close C;
    END IF;
    APP_EXCEPTION.Record_Lock_Error(Counter);
    END;
    end LOOP;
    END lock_row;
    END XXCPCRQM_PKG;
    CALLING FROM TRIGGER:
    ON-INSERT: XXCPCRQM_PKG.insert_row;
    I am sure this will help you.
    Thanks
    Madhu

  • Duplicate item value in a Multi-Record Block

    Is there a way to chek duplicate value entered in multi record block?
    I have seen some solutions in this forum however nothing has worked for me till now. (using the formula, creating hidden items & creating group etc)
    Thanks in advance,

    To see if there are any other records in the block with the same value, use Kevin Clark's famous function to trap duplicates. You can find Kevin's function write up here:
    Re: checking for same rows in a tabular
    From Kevin's post:
    Create a field PK_COPY in a control block.
    Create program unit function COMPARE to compare two input params returning 1 if they match else 0.
    Create a field in the datablock PK_MATCH, calculation property formula, formula COMPARE(:DATA_PK, :PK_COPY)
    Create a field in the control block NO_OF_MATCHES, calculation property summary, summary type SUM, summarised
    item PK_MATCH.
    Also, your control block requires the Single Record property set to yes, and the base table block requires the Query All Records property set to yes.
    WHEN-VALIDATE-ITEM on DATA_PK
    :CONTROL.PK_COPY := :DATA_PK;
    if :NO_OF_MATCHES > 1 then
      message('You have already used that one');
      Raise form_trigger_failure;
    end if;

  • Order by on Non-base table Item

    Hi,
    I have a base table block on Dept and some of the non-base table items(which are emp table and being populated through post-query).
    So, i have some base table items and non-base table items on the same block.
    No my problem is, i have to do ORDER BY on one of non-base table items..
    How can i do this ?
    Thanks in advance.

    The obvious answer is to create a view upon which to base the block, or alternatively you could use a FROM Clause Query so that you don't have to set the values in your POST-QUERY trigger.
    Richard

  • Assigning Javascript value to ABAP variables

    Hi Experts,
    I have written the HTML code mixed with Javascripts to create a table in the 'View' of a BSP Component.
    I was able to set the value of assign the value of ABAP parameters into HTML fields.
    This table has some input fields. I need to fetch the value of input parameters which has been entered by screen on an event which is present in Overview Page.
    I can calulate the value mentioned in input field but i am not able to assign the same value to ABAP parameter for further processing.
    I have already referred the following link but it did not work.
    Assign Javascript variable to Abap variable
    Please help me how i should i acheive it.
    Thanks In Advance,
    Rajeev Singh

    Hi,
    I am not understanding your problem and what you want due to description, but it seems to be very similar to a post which I answered very recently [here|How to return values from a BSP page to Javascript;.

  • Calculated non-base table field in a tabular form

    I am struggling with creating a non-base table calculated field in a tabular form in ApEx 3.1
    Can you point me in the right direction
    I thought this would be fairly easy to do, but I cant work out how to do it
    Requirements
    1) Tabular Form based on a table with QTY and PRICE columns
    2) TOTAL is a non-base table field, based on QTY * PRICE
    3) If the Qty or Price changes, the TOTAL should be re-calculated
    Example
    QTY   PRICE  TOTAL
    ===    =====  =====
    3       5          15
    10      50         500
    20      3           60
    Environment
    ApEx 3.1, Oracle 10 and Oracle 11 databases
    I recommended to upgrade to a newer version of ApEx but the request was rejected so Im stuck with 3.1

    Thanks, but its not the solution that I am after
    I am looking for a solution that will ...
           1) not require the calculated value TOTAL to be stored in the table
    and 2) re-calculate the TOTAL when I modify the dependent values (QTY and PRICE) before I save the changes to the database
    I am still looking for a solution if anyone can help

  • Non-base tables

    What is non-base table when refered in forms ?
    null

    moorthy kathirava (guest) wrote:
    : What is non-base table when refered in forms ?
    When you create a Block/form without any base table, ie., Form
    containing controls which are not necessarily related to one
    table is called non base table block/form.
    Murugan
    null

  • Want to assign a value to a dff (from a sql )whenever the record is saved

    Hi
    I am new to OAF and would like to know how can i extend my VO and assign a value returned by a sql which returns a value on the basis of some fields from some fields in the same VO .
    Thanks
    Narinder

    Narinder,
    You can extend the SEEDED VO by creating a new VO and using the extends property in the VO wizard to refer to the seeded VO. Now in the new VO query you can make changes as appropriate to retrieve your values. The last step is to substitute this VO in the Applicatin so that the newly created Custom VO is used instead of standard to make sure your changes are visible.
    Best would be to read the section on Substitution in the Dev guide.
    Regards
    Sumit

  • How  to retrieve a column field value from an ADF table ?

    All,
    I have a backing bean where I have bounded a field of an ADF table.
    I would like, in the bean, to read the value of that field so that I can use it inside a task flow router.
    The question: how to read a value from a ADF table column field ?
    In the bean I have the getter and setter of the RichInputText ADF table field. But when I type:
    System.out.println("the name is: " + this.getName().getValue());
    or
    System.out.println("the name is: " + this.Name().getValue());
    I get a null pointer exception.
    Thanks in advance,
    Sergio.

    Thanks Marvin, but this is not really what I'm looking for. Or at least, it does not sounds like to be :)
    I need to get the value contained in a row cell of an ADF table.
    Let's say the table (two rows, three cells) contains these values:
    "table_A", "123", "John"
    "table_B", "456", "Peter"
    When I click on the first row, I need the value: "table_A". Once I got that value, I extract the last char, in this case: "A", and then I call a specific task flow from a task flow router (specified in the task flow router Cases property).
    When I click on the second row, the same process applies, only the router now points to another flow view.
    So to summarize, I need to get the value of a row cell in an ADF table. How to do that from within a javaBean in JDeveloper 11g Release 2 ?
    This is what I have in the bean; so far I've bounded the related row cell (herkunft) to the bean. Each time I select a row on the ADF table, the function setHerkunft() runs - I see that from within the JDeveloper console - but when I try to get its value, I get a null value - hence the surrounding if statement.
    package bean;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.event.ValueChangeEvent;
    import oracle.adf.view.rich.component.rich.input.RichInputText;
    +public class taskFlowBean {+
    public RichInputText herkunft;
    public static String taskFlowView = "C";
    +public taskFlowBean() {+
    System.out.println("taskFlowBean constructor call");
    +}+
    +public void setHerkunft(RichInputText herkunft) {+
    System.out.println("set herkunft");
    this.herkunft = herkunft;
    if (this.getHerkunft().getValue() != null )
    System.out.println("herkunft is: " + this.getHerkunft().getValue());
    +//here taskFlowView will set accordingly with the herkunft value.+
    +}+
    +public RichInputText getHerkunft() {+
    System.out.println("get herkunft");
    return herkunft;
    +}+
    +public String getTaskFlowView() {+
    System.out.println("get taskFlowView ! : " this.taskFlowView);+
    return this.taskFlowView;
    +}+
    +}+
    Regards,
    Sergio.

Maybe you are looking for

  • Automatic Clearing - Customer Account

    Hi All, is there a way in SAP to clear the customer open items automatically for the below scenario Invoice : 3750 Credit Meo - 500 I want the system to clear the above mentioned line items based on certain pre-defined parameter and for the differenc

  • IDoc to csv file with required fields

    All, I have a source IDoc going to XI.  For example it contains source fields SF1 (required), SF2 (required), SF3(optional) and SF4(optional). I want to produce a target file using file content conversion.  I want to produce target fields TF1(require

  • Have problem with software update

    it will not let me do it

  • Customized Ringtones do not play on iphone

    I was able to create customized ringtones and get them on the iphone, but they will not play when I get a call or go to the ringtones to hear them. Has this happened to anyone else?

  • Dreamweaver won't open same file in two different folders.  Fix or switch to Aptana?

    Same file copied between 2 folders. DW will open one but not the other.  Copied code from 'good' file to new file; saved in 'bad' folder.  DW opened the file once then the spinning wheel of death again.  All files open in Aptana, Coda, Sublime no pro