Need to populate sequence value in a field after insert in oaf page

Hi All,
I have a custom OAF insert page in that i need to populate a sequence value to a field once the data inserted successfully to the table.
so for that i followed the below approach.
1>Created a sequence in database.
2>In the EOImpl java file in the setter method for the respective field have written below code.
    public void setContainid(Number value) {
        if (value == null) {
                OADBTransaction t = getOADBTransaction();
                value = t.getSequenceValue("XXXXX_CONTAIN_SEQ");
        setAttributeInternal(CONTAINID,value);  
But still i am not able to populate the sequence value for the field in my oaf page,please help me out on thsi.
Thanks

Hi,
Write this logic in create method of EOImpl:
  public void create(AttributeList attributeList)
    super.create(attributeList);
    OADBTransaction transaction = getOADBTransaction();
    Number contID = transaction.getSequenceValue("XXXXX_CONTAIN_SEQ");
    setContainId(contID);
--Sushant

Similar Messages

  • Need help with adding a Key flex field to a seeded OAF page

    We have a seeded OAF page on which we already have Account Key Flex Field.
    Properties of this flex field are:
    The ApplShortName - SQLGL
    Name - GL#
    Type - Key
    As per the client requirement, in the KFF screen, we have disabled the seeded structure for Accounting Flexfield and created a custom structure.
    Our custom structure for the KFF is displayed correctly on the OAF page.
    But now the requirement is to add a new KFF on the OAF page which is duplicate of the existing KFF, along with the existing KFF field; the structure and segments are same. Only difference being the display name of the existing KFF field is Account; the new one needs to be Tax structure.
    Using personalization we added a new flex item and added the properties same as the existing KFF.
    ApplShortName - SQLGL
    Name - GL#
    Type - Key
    But the page is giving following error:
    The data that defines the flexfield on this field may be inconsistent. Inform your system administrator that the function: KeyFlexfieldDefinitionFactory.getStructureNumber could not find the structure definition for the flexfield specified by Application = SQLGL, Code = GL# and Structure number =
    We tried options like compiling the flexfield definition, but the error persists.
    Any help in this regard is highly appreciated.
    Regards,
    Kiranmayi.

    Hi,
    Please check whether your key flex structure is frozen or not. If now please freeze it and re compile and try.
    This may helps too
    error while developing KFF in oaf
    Thanks
    Bharat
    Edited by: Bharat on May 10, 2013 4:51 AM

  • Need to set default values for the fields plant and location in ME21N

    Hi All,
    i need to set default values for the fields plant and location in ME21N tcode.
    In accout assignment if we give 'A' then we need to create asset by clicking the Asset tab,there you have the fields plant and location.
    How to resolve this?
    Thanks in Advance

    hi .
    i needed to set default strorage location and plant in personal setting  in me21n.
    i solve it with this way.
    go to program SAPLMEPERS in se38.
    create new function in output with the sample name :MODULE ZTEST_001 OUTPUT.
    in this module write:
    if MEPOITEM_PROP-WERKS is INITIAL and  MEPOITEM_PROP-LGORT is INITIAL.
    MEPOITEM_PROP-WERKS = '1000'.
    MEPOITEM_PROP-LGORT = '0032'.
    endif.
    this is the solution.
    best regards.
    maryam

  • Need to get sequence value in another column in oracle

    Hi ALL,
    I have sql query as below
    select header_id,order_number from oe_order_headers_all.
    and data it is displaying as
    heder_id     order_number
    111            500001
    121            500400
    I need to display  another field with some sequence value like as below
    id     heder_id     order_number
    1      111                    500001
    2      121                    500400
    so how to get sequence value in another column please help me on this.
    Thnaks

    You can just use ROWNUM Pseudocolumn
    select rownum id, header_id,order_number from oe_order_headers_all

  • Need to get the values from "Signed" field from PDF form.

    Hi,
    This is Dinesh. I am PHP Developer. My issue is "I am not able to get the value of "signed" field from the PDF form when the form has been submitted.". I want to get the Digital Signature value of that field and i need to store it in the DB.
    Please help me here Or Please forward this issue to any of the PHP developer who solved this issue and let me know.
    Thanks & Regards
    Dinesh

    Hi Vikas,
    you can use this badi MRM_WT_SPLIT_UPDATE, the method will be WHTAX_SPLIT_UPDATE
    in this badi please see the importing and exporting parameters, you will get the  values of withholding tax code  as TE_RBWS in export parameters.
    Please search in google or SCN you will get how to use it.

  • Populate f4 values of a field based on value of other field

    Hi,
    I have created select options using WDR_SELECT_OPTIONS.For one of the fields ,f4 values should be based on value of another field in the screen.
    How will i achceive this requirement.
    I got a link about the same but that is not using WDR_SELECT_OPTIONS
    http://www.sdn.sap.com/irj/scn/logon?redirect=/irj/scn/wiki?path=/display/WDABAP/Using%20Search%20help%20attachments%20for%20WebDynpro%20ABAP
    I got another link
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    which I am going to try
    Thanks
    Bala Duvvuri
    Edited by: Bala Duvvuri on Jun 22, 2011 6:49 AM

    Hi,
    Using OVS you can achieve this.,  In OVS Event Handler read the value based on which you  want to display F4 for other field and populate the values based on the first field.
    this link is fine., go through this: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/606288d6-04c6-2c10-b5ae-a240304c88ea?quicklink=index&overridelayout=true
    hope this helps u.,
    Thanks & Regards,
    Kiran

  • How to populate the value of 1 field in subtabs.

    Guys,
    Need your help.
    In one of the standard page there are multiple subtabs. So, I have requirement if users enter a value for a field in 1st subtab then the same value should automatically get populated to the second subtab field .
    Please help me in this.
    Is it possible through personalization or we need to extend the CO.
    Standard Page :- /oracle/apps/ap/payments/psr/webui/PsrPG
    This is a form in 11i but in R12 it is OAF page.

    Hi,
    As per my understanding, you have to extend your controller class:
    1) Set PPR event on tab/field
    2) Catch the PPR event in PFR method.
    3) Get handle to AM and then VO and set attributes of the VO of 2nd tab.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to populate value in other field after entering in one field?

    hi everyone.
      when i enter value in one field , automatically some xyz value should be populated  in second field. How would this be possible without any enter? I mean i don want to perform any action like press enter or like that.

    Hello manumb6 ,
    You coud also use "TimedTrigger" UI element for the same and you can specify the "delay" value in seconds.
    Suppose if you enter x value.
    After X seconds it will trigger the particular action associated to UI element.
    My suggestion would be that you generate this UI element Dynamically when you expect end user to enter the value in the input field and system would keep invoking the method and as soon as your objective is met, Delete the UI element .
    Hope this would help.
    Regards
    Anurag Chopra

  • How can I make a dropdown box populate with values from other fields?

    I am trying to create a NCAA bracket where they select teams from a dropdown menu. For example, they choose which teams win in game 1 and 2 through a dropdown box. The winner of games 1 and 2 then play each other, so how can I populate the dropbox with their selections for game 1 and 2?
    Game 1 winner --
         (game 9)        |--- Game 9 winner
    Game 2 winner --
    Game 9 winner needs to populate with their selections from game 1 winner and game 2 winner.

    I would look at using the setItems Acrobat JavaScript method.
    Have you considered using  a Mouse Up action for "Game 1" and "Game 2" to fill "Game 9"

  • Default value in LOV field in Create and Update page in OAF

    Hi All,
    I am unable to default LOV field in Create and Update page in OAF.
    I tried in below way :
    OAMessageLovInputBean lovBean1 = (OAMessageLovInputBean)webBean.findChildRecursive("AAA");
    But I am getting developer mode exception, so please guide me how i can set the default value for create and update page instead of using code in process request method in controller.
    Thanks

    Hi,
    1) In case of create, you can default the value either in EOImpl or in AM while initializing the row:
    //in EOImpl
    public void create(AttributeList attributeList)
    super.create(attributeList);
    setXXAttribute(<value>);
    //in AM, VO new row initialization :-
    VOImpl VO = getVO1();
    VO.setMaxFetchSize(0);
    VORowImpl row = (VORowImpl)VO.createRow();
    row.setXXAttribute(<value>);
    VO.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    2) In case of update, execute the VO (also set the where clause if required) in PR method of update page.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Need to update sequence value in two table

    Hi guys
    Please help me in the below query
    I will need to insert a row in two different table
    table1
    col1 col2
    table2
    column1 column2
    the col1 in table1 will be assigned a sequence.nextval
    i need to assign the same value in table2 column 1.
    can i do it in a single insert statement

    i would do like this. INSERT ALL is the way to go...
    SQL> create sequence my_seq;
    Sequence created.
    SQL> create or replace function my_seq_fn return number
      2  as
      3  lNum number;
      4  begin
      5  select my_seq.nextval into lNum from dual;
      6  return lNum;
      7  end;
      8  /
    Function created.
    SQL> create table t1(a number, b number);
    Table created.
    SQL> create table t2(c number, d number);
    Table created.
    SQL> insert all
      2  into t1(a,b) values(seq, val1)
      3  into t2(c,d) values(seq, val2)
      4  select my_seq_fn() as seq, level+5 as val1, level+10 as val2
      5  from dual
      6  connect by level <=10;
    20 rows created.
    SQL> /
    20 rows created.
    SQL> select * from t1;
             A          B
             1          6
             2          7
             3          8
             4          9
             5         10
             6         11
             7         12
             8         13
             9         14
            10         15
            11          6
             A          B
            12          7
            13          8
            14          9
            15         10
            16         11
            17         12
            18         13
            19         14
            20         15
    20 rows selected.
    SQL> select * from t2;
             C          D
             1         11
             2         12
             3         13
             4         14
             5         15
             6         16
             7         17
             8         18
             9         19
            10         20
            11         11
             C          D
            12         12
            13         13
            14         14
            15         15
            16         16
            17         17
            18         18
            19         19
            20         20
    20 rows selected.
    SQL> select my_seq.currval from dual;
       CURRVAL
            20 Thanks,
    Karthick

  • How to populate Initial value of a field from another item value

    Hi
    In my expense report entry screen I have justification and description fields. My description field is getting value from the database. I want justification field also get the value same as what description has. Could you guide me on how to achieve this via personalization?
    Thank you.

    Hi,
    user622444 wrote:
    In my expense report entry screen I have justification and description fields. My description field is getting value from the database. I want justification field also get the value same as what description has. Could you guide me on how to achieve this via personalization?---Copy the viewAttribute name of the description
    ---Paste it in Justification view Attribite property.
    Regards
    Mehar Irk

  • Populate a value into a field on a screen using userexit

    Hi all,
      I am using a standard program 'RIPLKO10' and a user exit include 'ZXAD2U04' to update a field to the screen. When i run the program the userexit gets triggerred, but i do not know how can i update the field value. Can anyone please tell me how can i achieve this.
    Thanks,
    Rajesh,

    Hi,
    Check if there is an export parameter, through which u can pass/update the field value and most of the exits will have a flag --> is_exit_active , pass 'X' to this field if available, so that the values do not get overwritten in the standard program.
    Rgds,
    Hema

  • Is it needed to convert the values frm text field to numeric for sql server

    hi all,
    i'm using tomvat4.0,back end sql server 200.
    when i insert the values in to the table it is giving an exception sayin "Error in converting varchar to numeric"
    is it necessary to convert those strings from text fields into int before passing them to the sql query..
    i think it is not necessary for oracle..but not sure with sql server..
    pls help me
    cheers
    chandu

    yap, every thing is fine...
    n i got the solution...when the text field is left blank....the requst.getParameter returns [coe]""(null)
    wen the database is lookin for a numeric it is giving null...which is not acceptable...
    so inserted this code...
    if(request.getParameter("...").equals("")) {
      //assign zero to a variable then insert that variable....
    }thanx for the responses
    cheers
    May the solutions to one's problem pop up in one's mind itself
    chandu

  • Sequence value incrementing by one after commit

    I am using the following code to insert a sequence number into a form field in a data block pre-insert trigger. When I commit the record the trigger fires again and increments the sequence again. So the record I get in the database has a primary key value of 1 more than what was on the form. Any help would be appreciated.
    Joe Merkel
    BEGIN
         SELECT DAD_ID_SEQUENCE.NEXTVAL INTO :DAD_ROSCO_INFO.DAD_ID
         FROM SYS.DUAL;
         EXCEPTION
         WHEN OTHERS THEN
         MESSAGE('Unable to assign DAD ID');
         RAISE FORM_TRIGGER_FAILURE;
         :DAD_RO_NOTES.DAD_ID := :DAD_ROSCO_INFO.DAD_ID;
         :DAD_FR_NOTES.DAD_ID := :DAD_ROSCO_INFO.DAD_ID;
         END;

    I was just talking to a colleague that suggested that. Thanks for your response. I will look into it.

Maybe you are looking for