DataTable: adapt auto-generated fields

Hi,
I have a table, which is generated at the startup of my jsp-page... I want in one column, the sum of the values of two other columns...
Is this possible and how???
Thx a lot
Ann

I guess you would hand-edit the query to have a third column, and make the SQL command do it...
something like "SELECT col1, col2, (col1 + col2) AS sum FROM table....."
and then your dataTable, when assigned, should see the third column and display the value SQL created there.
no?
-Kristofer

Similar Messages

  • Auto Increment Field / Sequence - How?

    Am I missing something here - is there no build in support to tie a datatables auto incriment field to a sequence so that it will be automatically retrieved on a update command?
    I have a table that has a field (RECORD_ID) that gets it's value from a Sequence (RECORD_IDSEQ).
    I am retrieving a dataset and setting the RECORD_ID field to autoincrement, setting the seed & step to -1. Then I am adding some records & I see the autoincrement field i working correctly. UNFORTUNATELY, I still have to iterate through the table before I call an update in order to insert (from another function) the RECORD_IDSEQ.NEXTVAL value into the RECORD_ID column.
    Surely I am missing something. It sure seems simple enough to have a property of the autoincrement field/command builder that relates to the SEQUENCE name so that the update method generates the RECORD_IDSEQ.NEXTVAL automagically.
    Can anyone shed any light on this for me?
    Thanks!

    Bob,
    Currently, there's no built-in "link" between the .NET DataTable's auto-increment field and the Oracle sequence.
    Therefore, you will need to execute a custom update command or a custom insert command which uses the RECORD_IDSEQ.NEXTVAL for the RECORD_ID column (rather than the auto-generated SQL via the CommandBuilder).
    Furthermore, in your custom SQL you can have a RETURNING clause which returns the RECORD_ID column value to populate back into the DataTable so that the sequence values in the Database is in sync with those in the DataTable.
    We'll consider providing a way to "link" the DataTable auto-increment column to an Oracle sequence in a future release.

  • How to auto-generate a "empno" field at run time in oracle forms 6i

    Hello!
    I have connected to a SCOTT schema. And i am using emp table. At run time mode when i press F8 then the data is displayed in the fields.
    My task is to generate auto "empno" as soon as i run the form. Kindly do the needful.
    Thanks in advance

    Hi Francios,
    I think with your solution our user only able to see the current information in the form.I donot think it will auto generate the empno.
    Dear user,
    I suggest what you can do is to create one sequence in your database and use it to generate automatic
    empno.
    In post query trigger try to implement the idea.
    Suppose in the name of the sequence is empno_seq.
    if emp.empno is null then
    :emp.empno := empno_seq+1;
    end if;
    Try i hope it will work
    Regards
    Rajat

  • HOW TO GET AUTO GENERATED PRIMARY ID KEY BACK FROM AN INSERT STATEMENT IN .

    Just recently I ran into a problem with what seems to be a deficiency in the Oracle Database. When trying to return an auto-generated key as is done in Microsoft's SQL database, it seems Oracle for whatever reason didn't add this capability, the key couldn't be passed back to the .Net call. After tinkering with the .Net software and talking with the Oracle techs, a decent work around to the problem (presented here) comes fairly close. Two things have to be done first before this will work. A sequence has to be created on the Oracle DB. Also a trigger has to be created against the table the keys are going to be returned from.
    The class works by passing to the function 'update_datasets_return' a DataSet with as many tables as you want. The function spins through the tables and put the keys in each row inserted. It's assumed the first row will either be the primary key or some numeric value. This can be changed by modifying the: dt.Columns(0).ColumnName
    Notice the word Inserted. On Updates and Deletes the key value is ignored because it's already present. The routine just updates the database as usual.
    So in other words you could send a table to the function with rows inserted, deleted, or updated and it will take care of them all. One routine for all.
    ' ======================================================================
    ' Created by SEF and Oracle SR: 5607364.993 This is a complete Redo
    ' of the initial concept. SEF...
    ' Sample of sequence and trigger at bottom.
    ' Uses the ODP.NET data provider.
    ' update_datasets_return: Goes thru each table in the dataset and
    ' updates, deletes, or inserts as needed.
    ' If inserting, a 'sequence counter' and a 'trigger'
    ' using the 'before insert' must be present. The sequence
    ' counter is set to auto increment by 1 starting at 1.
    ' The trigger is specific to the table.
    ' Create the trigger and sequence in the database or run the samples
    ' below in PL/SQL. Be sure the logon with a user that has enough rights.
    ' Routine assumes the first column is going to hold the sequence
    ' number. Actually any column could be used. Just change the
    ' dt.Columns(0).ColumnName to whatever you want or leave as default.
    ' The da_RowUpdated sub is where the 'sequence number' gets returned
    ' on each row that is inserted into a table. Routine is ignored on
    ' deletes and updates. SEF...
    ' =======================================================================
    Imports System
    Imports System.Data
    Imports Oracle.DataAccess.Client
    Imports Oracle.DataAccess.Types
    Public Class OracleUpdate
    Private Shared m_conn As OracleConnection
    Private Shared da As New OracleDataAdapter
    Private Shared dt As DataTable
    Private Shared conn As New OracleConnection
    Private Shared dr As DataRow
    Private Shared astep As Long
    Private Shared rwIndex As Integer = 0
    Private Shared tblIndex As Integer = 0
    Public Shared Function update_datasets_return(ByVal constr As String, ByVal ds As DataSet) As DataSet ''ByRef ds As DataSet)
    Dim selectstmt As String
    m_conn = New OracleConnection(constr)
    Try
    m_conn.Open()
    Catch ex As Exception
    Throw New ArgumentException(" Error: connection lost." & ex.Message)
    End Try
    For Each dt In ds.Tables
    ''Uncomment the code only if auto numbering
    ''is NOT turned on for the table being updated. SEF...
    ''rwIndex = 0
    ''For Each dr In dt.Rows
    '' Try
    '' Select Case dr.RowState
    '' Case DataRowState.Added
    '' astep += 1
    '' ' =======================================================
    '' ' This "Try Catch" section created only if auto numbering
    '' ' is NOT turned on for the table being updated. SEF...
    '' ' It's a crude attempt at creating a unique number.
    '' ' A more serious approach would be to use a GUID.
    '' ' Use only if you decide not to have a sequence and a
    '' ' trigger for the table.
    '' ' =======================================================
    '' Try
    '' 'ds.Tables(tblIndex).Rows(rwIndex).Item(0) = astep
    '' Catch
    '' ' ignore the error corrected integer identity so don't randomize it
    '' End Try
    '' dr.Item("createdDate") = Now
    '' dr.Item("changedDate") = Now
    '' Case DataRowState.Modified
    '' dr.Item("changedDate") = Now
    '' End Select
    '' Catch ex As Exception
    '' conn.Close()
    '' conn.Dispose()
    '' Throw New ArgumentException(" Error: update_datasets " & ex.Message)
    '' End Try
    '' rwIndex += 1
    ''Next
    selectstmt = "SELECT * From " & dt.TableName & " Where " & dt.Columns(0).ColumnName & " = " & 0
    da = New OracleDataAdapter(selectstmt, m_conn)
    Dim bldr As OracleCommandBuilder = New OracleCommandBuilder(da)
    AddHandler da.RowUpdated, New Oracle.DataAccess.Client.OracleRowUpdatedEventHandler(AddressOf da_RowUpdated)
    Dim insCmd As OracleCommand = Nothing
    Try
    insCmd = CType(bldr.GetInsertCommand(), OracleCommand)
    Catch ex As Exception
    Throw New Exception("")
    End Try
    insCmd.CommandText += " returning " + dt.Columns(0).ColumnName + " into :seqno"
    insCmd.Parameters.Add(New OracleParameter("seqno", OracleDbType.Int16, _
    4, ParameterDirection.Output, False, CType(0, System.Byte), CType(0, _
    System.Byte), dt.Columns(0).ColumnName, DataRowVersion.Current, Nothing))
    da.InsertCommand = insCmd
    Try
    ' ===========================
    da.Update(ds, dt.TableName)
    ' ===========================
    Catch ex As Exception
    Throw New ArgumentException(" Error: update_datasets_return " & ex.Message)
    End Try
    Next
    m_conn.Close()
    m_conn.Dispose()
    Return ds
    End Function
    Friend Shared Sub da_RowUpdated(ByVal sender As Object, ByVal e As OracleRowUpdatedEventArgs)
    If e.StatementType = StatementType.Insert Then
    e.Row(0) = Int64.Parse(e.Command.Parameters("seqno").Value.ToString())
    End If
    End Sub
    ' ================================================================================
    ' Notes:
    ' =================== How To -- Sample section for PL/SQL ==================================
    ' myTrigger, myTable, mySequence, and myColumn are values you need to supply.
    ' Note: A trigger needs to be created for each table.
    ' A sequence needs to be created only once and referenced each time
    ' in the trigger(s). Or you could create a new sequence each time you
    ' create a trigger. Sort of a waste of effort.
    ' Explanation:
    ' myTrigger = The name you are giving this trigger.
    ' If a trigger with same name already
    ' exist, it will be overwritten.
    ' myTable = Table you want to add the sequence numbers to.
    ' mySequence = Sequence counter you created. Whatever name you called it.
    ' myColumn = The column to update with the sequence number.
    ' =================================================================================
    ' -- Run in PL/SQL or create at DB. --
    ' create or replace trigger myTrigger
    ' before insert on myTable for each row
    ' begin
    ' select mySequence.nextval into :new.myColumn from dual ;
    ' end;
    ' -- Run in PL/SQL or create at DB. --
    ' create sequence mySequence
    ' MINVALUE 1
    ' START WITH 1
    ' INCREMENT BY 1
    ' NOCACHE; can be set to CACHE but sequence may contain gaps.
    ' Explanation of CACHE from: http://www.techonthenet.com/oracle/sequences.php
    ' With respect to a sequence, the CACHE option specifies how many sequence
    ' values will be stored in memory for faster access. The downside of creating
    ' a sequence with a CACHE is that if a system failure occurs, all cached
    ' sequence values that have not be used, will be "lost". This results in
    ' a "gap" in the assigned sequence values. When the system comes back up,
    ' Oracle will CACHE new numbers from where it left off in the sequence,
    ' ignoring the so called "lost" sequence values.
    ' Note: To recover the lost sequence values, you can always execute an
    ' ALTER SEQUENCE command to reset the counter to the correct value.
    ' NOCACHE means that none of the sequence values are stored in memory.
    ' This option may sacrifice some performance, however, you should not encounter
    ' a gap in the assigned sequence values.
    End Class
    C#:
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    public class OracleUpdater2
    private static OracleConnection m_conn;
    private static OracleDataAdapter da = new OracleDataAdapter();
    private static OracleConnection conn = new OracleConnection();
    public static DataTable load_it(string constr, string strqry, string tblName)
    // =====================================================================
    // constr = User Id=myUser;Password=myPass";Data Source=myDataSource
    // strqry = Select * from something?
    // tblName = The table name to fill.
    // =====================================================================
    conn = new OracleConnection(constr);
    conn.Open();
    da = new OracleDataAdapter(strqry, conn);
    OracleCommandBuilder bldr = new OracleCommandBuilder(da);
    DataTable dt = new DataTable(tblName);
    da.Fill(dt);
    conn.Dispose();
    return dt;
    public static DataSet update_datasets_return(string constr, DataSet ds)
    //'ByRef ds As DataSet)
    string selectstmt = null;
    m_conn = new OracleConnection(constr);
    try
    m_conn.Open();
    catch (Exception ex)
    throw new ArgumentException(" Error: connection lost." + ex.Message);
    foreach (DataTable dt in ds.Tables)
    selectstmt = "SELECT * From " + dt.TableName + " Where " +
    dt.Columns[0].ColumnName + " = " + 0;
    da = new OracleDataAdapter(selectstmt, m_conn);
    OracleCommandBuilder bldr = new OracleCommandBuilder(da);
    da.RowUpdated += new
    Oracle.DataAccess.Client.OracleRowUpdatedEventHandler(da_RowUpdated);
    OracleCommand insCmd = null;
    try
    insCmd = (OracleCommand)(bldr.GetInsertCommand());
    catch (Exception ex)
    throw new Exception("" + ex.Message);
    insCmd.CommandText += " returning " + dt.Columns[0].ColumnName + " into
    :seqno";
    insCmd.Parameters.Add(new OracleParameter("seqno", OracleDbType.Int16, 4,
    ParameterDirection.Output, false, System.Convert.ToByte(0),
    System.Convert.ToByte(0), dt.Columns[0].ColumnName, DataRowVersion.Current,
    null));
    da.InsertCommand = insCmd;
    try
    // ===========================
    da.Update(ds, dt.TableName);
    // ===========================
    catch (Exception ex)
    throw new ArgumentException(" Error: update_datasets_return " +
    ex.Message);
    m_conn.Close();
    m_conn.Dispose();
    return ds;
    If you need a working program of how this works, let me know.

    Oh my god, it is too long! You definitely check out types, casting and especially ODP.Net (it does everything for you)... etc. They can help you to simplify your code. I do not have enough time to copy paste it to Studio and understand and solve your issue, so I got title of your message as your main question.
    In Oracle, you can create an autonumber field by using sequences object. This is really useful when you need to create a unique number to act as a primary key.
    Basically you can create a sequence simply typing;
    CREATE SEQUENCE MY_SEQUENCE;
    now you have a sequence called "MY_SEQUENCE"... Then, I advice you select a number from sequence;
    select MY_SEQUENCE.nextval from dual;
    I said I advice actually kinda must, although it called sequence, I cannot be sequential. Do not even try to predict the value. You can be sure that it is unique number so you can use it.
    Then insert you record and use that number part of your primary key. I think that's it. Have fun.

  • Update Fund & Fund center data in auto generated PR during MRP RUN

    Problem in the MRP auto generated PRs.
    The normal PRs created manually have all relevant fields of fund center viz CO area ,commitment item,Funds center, fund.
    But the problem is with respect to the Purchase Requisitions generated automatically during the MRP RUN.
    How to include the fund centers in MRP generated PRs automatically in the creation stage itself instead of going into change mode using ME52n Transaction code and change it to include fund centers one by one for each line item.
    We require this as we have hundreds of PRs generated every day.

    Hi,
    In order to fulfill this requirement, transaction FM_MRP_PR should be used.
    Please also take a look to FM_MRP_PR on-line documentation :
    The PRs generated from the MRP run are considered as planning documents
    and do not have any impact on the budget. To encumber these PRs in the
    corresponding settlement receivers, you have to execute this program for
    the relevant PRs.
    Best Regards,
    Arminda Jack

  • How do you remove or change auto generated text in returned form e-mails?

    Hello,
    I am currently using Adobe Acrobat 8 Professional (Version 8.1.3) to create a form that will be sent to a group of people.  When testing it, I've noticed that when the end user presses the "SUBMIT FORM" button and a new e-mail opens with the completed form attached, the following text is automatically added to the body of the e-mail:
    Form Returned: XXXXXXX.pdf
    Instructions to add this form to a data set:
    1. Double-click the attachment.
    2. Acrobat will prompt you to select a data set.
    What I need to know is whether or not there is a way to either prevent this auto generated text from appearing or revise it so it gives a custom message instead.
    Any insight would be greatly appreciated!
    Regards,
    Jeff

    It sounds like you are getting a basic message that is telling you submitting the PDF is unnecessary and asking if you want to submit the data instead. I have not seen this one before, but that is my guess. If you are using the form fields created in Acrobat (not Designer), then just select FDF or XML for the data type to be submitted, not the form.

  • How to Create a Auto Generated number with some preceding text in Sharepoint 2010

    I am trying to create a auto generated number field in Sharepoint 2010 list item. My requirement is to have the following format number generated when new request is created in Sharepoint using form. Auto generated Ticket ID should be in the following format
    "IR13000" "IR13001" "IR13002"....... Please let me know how to get this done. I tried to use combination of default ID and Characters but its not working for new requests, its only reflecting for existing uploaded requests. I
    am trying this for taking up Ticket requests by filling up some fields in the form. Any quick help is much appreciated.
    Thanx

    Here are the steps:
    1 - Open your SharePoint site in SP Designer 2010.
    2 - Click Workflows and add a List workflow. Associate this workflow on the list where you want the Random Text to be generated.
    3 - Inside the workflow editor, select the Action "Update list item"
    4 -  Select 'Current Item'.
    5 - Click Add.. and select the field which needs to be updated with the Random Text. Make sure this column is not of type "Calculated" type, otherwise you won't see it in the list of the fields within the workflow.
    6 - Click "..." button in the next textbox which will open String Builder dialog box.
    7 - Type IR and then click 'Add or Change Lookup and select ID column from "Field from source". Hit OK.
    8 - It should look like IR[%Current Item:ID%]
    9 - Hit OK.
    10 - Save and publish the workflow. (Please note that currently this workflow is not set to auto run on creating new items. That's because we want to test it at this point of time).
    11 - Go to your list in SharePoint and create a new item. After creating, select the item and click Workflows and then run this workflow.
    12 - You should be able to see the text "IR1" in the designated column.
    13 - Once you see that it's working, go to SPD and set the workflow to run automatically on creation of the new item. Save and publish and then return to your list in SharePoint.
    14 - Create a new item there and you should see the Random value in the column.
    15 - You will also see the column in the New form. In order to remove it, go to List settings > content types > Item content type > and select Hidden for this column so that it doesn't showup in any form.
    Try it and let me know how it goes.
    Thanks,
    Ashish

  • Integer auto-increment fields

    I am using 3.0.3 and have a PC class that uses application identity and
    MSSQL server, so we are using auto-increment fields for our primary keys.
    In the past (with sequence-generated ids) we have used Integers for our
    mapped attributes, but with the application identity, it seems we need to
    use ints. Is there a reason for this, or is it a bug?
    Nathan

    Great. Thanks for the help.
    Nathan
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Nathan-
    This is a bug. I've reported it at:
    http://bugzilla.solarmetric.com/show_bug.cgi?id=910
    I expect it will be fixed in the next release. In the meantime, if you
    want to use a numeric wrapper for your auto-increment field, it will
    need to be of type java.lang.Long.
    In article <[email protected]>, Nathan Voxland wrote:
    It does work with Longs. I could switch my code to use Longs, although
    I
    don't always need that large of an id field.
    Nathan
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Nathan-
    If you change them both from Integer to a Long field, then does it
    work?
    >>>
    >>>
    In article <[email protected]>, Nathan Voxland wrote:
    Here is the code for the class and the ApplicationId class. The
    ApplicationId class was generated using the appidtool.
    public class Portfolio {
    private Integer id;
    private String name;
    private String notes;
    private Organization client;
    private Portfolio parentPortfolio;
    private Set subPortfolios;
    private Set projects;
    private Date created;
    private Person createdBy;
    private Date lastModified;
    private Person lastModifiedBy;
    public Portfolio(PersistenceManager pm) {
    pm.makePersistent(this);
    this.subPortfolios = new HashSet();
    this.projects = new HashSet();
    this.created = new Date();
    this.createdBy = new PersonPeer(pm).findLoggedIn();
    this.lastModified = this.created;
    this.lastModifiedBy = this.createdBy;
    public Integer getId() {
    return new id;
    public String getName() {
    return name;
    public void setName(String name) {
    this.name = name;
    public void jdoPostLoad() {
    public void jdoPreStore() {
    if (!((PersistenceCapable) this).jdoIsNew()) {
    this.lastModified = new Date();
    this.lastModifiedBy = new
    PersonPeer(((PersistenceCapable)
    this).jdoGetPersistenceManager()).findLoggedIn();
    public void jdoPreClear() {
    public void jdoPreDelete() {
    * Auto-generated by:
    * kodo.enhance.ApplicationIdTool
    public class PortfolioId
    implements Serializable
    static
    // register persistent class in JVM
    Class c = Portfolio.class;
    public Integer id;
    public PortfolioId ()
    public PortfolioId (String fromString)
    if ("null".equals (fromString))
    id = null;
    else
    id = new Integer (fromString);
    public String toString ()
    return String.valueOf (id);
    public int hashCode ()
    return ((id == null) ? 0 : id.hashCode ());
    public boolean equals (Object obj)
    if (this == obj)
    return true;
    if (!(obj instanceof PortfolioId))
    return false;
    PortfolioId other = (PortfolioId) obj;
    return ((id == null && other.id == null)
    || (id != null && id.equals (other.id)));
    Nathan
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]...
    Nathan-
    Is the primary key field an Integer in both the application
    identity
    class and the persistent class itself? They need to both be the same
    class.
    If they are the same, and you are still getting the exception, could
    you post the code for the classes (or else mail them to
    [email protected])?
    In article <[email protected]>, Nathan Voxland
    wrote:
    When I have my object use an int id, my test runs fine, when Iswitch
    to
    an
    Integer, I get the exception:
    kodo.util.FatalException: java.lang.ClassCastException
    NestedThrowables:
    java.lang.ClassCastException
    at
    kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:563)
    at
    com.correlat.intranet.projectmanagement.PortfolioTest.testFlush(PortfolioTes
    t.java:393)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(UnknownSource)
    at
    com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(Unknown
    Source)
    at
    com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(Unknown
    Source)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(UnknownSource)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.application.AppMain.main(UnknownSource)
    Caused by: java.lang.ClassCastException
    at
    com.correlat.intranet.projectmanagement.Portfolio.jdoReplaceField(Portfolio.
    java)
    atkodo.runtime.StateManagerImpl.replaceField(StateManagerImpl.java:2771)
    at
    kodo.runtime.StateManagerImpl.storeObjectField(StateManagerImpl.java:2272)
    atkodo.runtime.StateManagerImpl.storeObject(StateManagerImpl.java:2252)
    at
    kodo.jdbc.meta.ValueFieldMapping.setAutoIncrementValue(ValueFieldMapping.jav
    a:346)
    atkodo.jdbc.meta.ClassMapping.setAutoIncrementValue(ClassMapping.java:381)
    at
    kodo.jdbc.runtime.PreparedStatementManager.flush(PreparedStatementManager.ja
    va:137)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:357)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:153)
    at
    kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:72)
    atkodo.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:507)
    at
    kodo.runtime.DelegatingStoreManager.flush(DelegatingStoreManager.java:158)
    at
    kodo.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:412)
    at
    kodo.runtime.PersistenceManagerImpl.flushInternal(PersistenceManagerImpl.jav
    a:794)
    at
    kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:550)
    ... 24 more
    NestedThrowablesStackTrace:
    java.lang.ClassCastException
    at
    com.correlat.intranet.projectmanagement.Portfolio.jdoReplaceField(Portfolio.
    java)
    atkodo.runtime.StateManagerImpl.replaceField(StateManagerImpl.java:2771)
    at
    kodo.runtime.StateManagerImpl.storeObjectField(StateManagerImpl.java:2272)
    atkodo.runtime.StateManagerImpl.storeObject(StateManagerImpl.java:2252)
    at
    kodo.jdbc.meta.ValueFieldMapping.setAutoIncrementValue(ValueFieldMapping.jav
    a:346)
    atkodo.jdbc.meta.ClassMapping.setAutoIncrementValue(ClassMapping.java:381)
    at
    kodo.jdbc.runtime.PreparedStatementManager.flush(PreparedStatementManager.ja
    va:137)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:357)
    atkodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:153)
    at
    kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:72)
    atkodo.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:507)
    at
    kodo.runtime.DelegatingStoreManager.flush(DelegatingStoreManager.java:158)
    at
    kodo.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:412)
    at
    kodo.runtime.PersistenceManagerImpl.flushInternal(PersistenceManagerImpl.jav
    a:794)
    at
    kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:550)
    at
    com.correlat.intranet.projectmanagement.PortfolioTest.testFlush(PortfolioTes
    t.java:393)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(UnknownSource)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.application.AppMain.main(UnknownSource)
    Nathan
    "Patrick Linskey" <[email protected]> wrote in message
    news:[email protected]...
    What behavior are you seeing that is preventing you from using
    Integers?
    -Patrick
    Nathan Voxland wrote:
    I am using 3.0.3 and have a PC class that uses application
    identity
    and
    MSSQL server, so we are using auto-increment fields for our
    primary
    keys.
    In the past (with sequence-generated ids) we have used Integers
    for
    our
    mapped attributes, but with the application identity, it seems
    we
    need
    to
    use ints. Is there a reason for this, or is it a bug?
    Nathan
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Auto generated selection screen in Modulepool program

    Hi Experts!!
    How to develop/Desing auto-generated screen for accepting values from the user as criteria for database selections while running a report.
    pls. guide me.
    Thanks in advance

    Use this - two FMS-
    here is the code -
    FORM extended_selection.
      DATA : t_dyn    LIKE rsdsfields OCCURS 0 WITH HEADER LINE.
    *Work Areas.
      DATA : wa_range  TYPE LINE OF rsds_trange,
             wa_ranget TYPE rsds_frange_t,
             wa_line   TYPE LINE OF rsds_frange_t,
             t_selopt  TYPE rsds_selopt_t.
    *Fields to be Put on the dynamic selection screen
      t_dyn-tablename = 'KNA1'.
      t_dyn-fieldname = 'KUNNR'.
      APPEND t_dyn.
      CLEAR  t_dyn.
      t_dyn-tablename = 'CEPC'.
      t_dyn-fieldname = 'PRCTR'.
      APPEND t_dyn.
      CLEAR  t_dyn.
      IF ( ( g_sel IS INITIAL ) OR ( t_ranges[] IS INITIAL ) ).
    *Initialize Free Selection Mode.
        CALL FUNCTION 'FREE_SELECTIONS_INIT'
             EXPORTING
                  kind                     = 'F'
             IMPORTING
                  selection_id             = g_sel
             TABLES
                  fields_tab               = t_dyn
             EXCEPTIONS
                  fields_incomplete        = 1
                  fields_no_join           = 2
                  field_not_found          = 3
                  no_tables                = 4
                  table_not_found          = 5
                  expression_not_supported = 6
                  incorrect_expression     = 7
                  illegal_kind             = 8
                  area_not_found           = 9
                  inconsistent_area        = 10
                  kind_f_no_fields_left    = 11
                  kind_f_no_fields         = 12
                  too_many_fields          = 13
                  dup_field                = 14
                  field_no_type            = 15
                  field_ill_type           = 16
                  dup_event_field          = 17
                  node_not_in_ldb          = 18
                  area_no_field            = 19
                  OTHERS                   = 20.
        IF sy-subrc NE 0.
          MESSAGE e717(db).
        ENDIF.
      ENDIF.
    *Dialog for Selection.
      REFRESH t_ranges.
      CALL FUNCTION 'FREE_SELECTIONS_DIALOG'
           EXPORTING
                selection_id    = g_sel
                title           = 'Extended Selection'(s12)
                as_window       = true
                start_row       = 5
                start_col       = 20
                tree_visible    = space
           IMPORTING
                field_ranges    = t_ranges
           TABLES
                fields_tab      = t_dyn
           EXCEPTIONS
                internal_error  = 1
                no_action       = 2
                selid_not_found = 3
                illegal_status  = 4
                OTHERS          = 5.
      IF sy-subrc NE 0.
        CHECK sy-subrc NE 2.
        MESSAGE e717(db).
      ENDIF.
    This will create a dynamic selection screen for you. For more information u can refer to the documentations of those function mdoules.
    Hope it solves ur prob.

  • Problem in using Auto-generated Table in Program

    Hi experts,
    I'm using some auto-generated table in my program. But the Problem is program is not activated due to non-existance of any type of table or structure or view of that Table type in the development server. i.e. table name in development is FMFMOADE12200014 and same in Production is FMFMOAPE14000018.
    How can I solve this problem to active the program and transport it?
    Thnaks in advance.
    Goutam

    Hi Friend  ,
    If  an Auto-generated tables  inside your program ,then you should not use that table directly  as internal table type .
    In that case you have used the Dynamic structure  in your program .
    tips is  you should check first the table is there in the  database  through your  programing using the standard function module for checking the table exsisting , then use the field symbols  for dynmaic creating of program  strucuture  ,including field creation  to tat strcuture  . this  will  make your  program more  lines in that  case you can  write  subroutine  for  creating the  fields  and adding  inside the dynamice strucure  .
    simple example  please see this link  :  [http://www.sap-img.com/ab030.htm]
    becasuse  we do have the  same  auto-generating table  concept  in Finance  base  on the Operating cencern  out table  name  & fields  inside  will be changing  ,Our  program has to support world wide Rollouts . so we used  dynamic structuring  inside Our program .
    Regards,

  • Redirect to 3 diffrent pages based on value in the Auto complete field.

    Hi Friends,
    I am using an "Auto complete field" in a page for searching(Apex version 4.0). But i need to get values from 3 tables and when clicking on the value redirect to any of the 3 pages based on the value.
    For example i am having 3 tables. 1.Customers 2.Sites 3.Employees. When i enter 'c' in the search field i need to get values from 3 tables to be listed in that "auto complete" field. i.e, if i am having customer with name 'cusotmer1', 'customer2' and site with names 'cisc1','cisc2' and employees with name'cid1','cid2' ; when i enter 'c' in the auto complete field all 6 values must be listed in the "auto complete" field and when clicking on 'customer1'/'customer2' need to redirect to page 'customer'. When clicking on 'cisc1'/'cisc2' redirect to "site" when clicking on 'cid1'/'cid2' redirect to employees page. Is there any way to achieve this. Please help.
    Regards,
    Nav

    Hi Nav,
    OK - on my page 1, I have a "Text Field with autocomplete" item called P1_SELECTION. The List of Values definition setting for this is:
    WITH D AS (SELECT ENAME || ' (Employee)' X
    FROM EMP
    UNION ALL
    SELECT DNAME || ' (Department)' X
    FROM DEPT)
    SELECT X
    FROM D
    ORDER BY 1This adds the appropriate suffix to each item to show where the data is from - you can change this if you want as this becomes part of the searchable text.
    On page 1, I have a normal SUBMIT button.
    Then I have two branches:
    1 - settings are:
    Branch Type: Branch to Page or URL
    Branch Point: On Submit: After Processing (After Computation, Validation, and Processing)
    Target Type: Page in this Application
    Page: 2 (the employee edit page)
    Clear Cache: 2
    Set these items: P2_ENAME
    With these values: &P1_SELECTION.
    Condition Type: Exists (SQL query returns at least one row)
    Expression 1:
    SELECT 1
    FROM DUAL
    WHERE :P1_SELECTION LIKE '%(Employee)'When Button Pressed: SUBMIT
    2 - settings are:
    Branch Type: Branch to Page or URL
    Branch Point: On Submit: After Processing (After Computation, Validation, and Processing)
    Target Type: Page in this Application
    Page: 3 (the department edit page)
    Clear Cache: 3
    Set these items: P3_DNAME
    With these values: &P1_SELECTION.
    Condition Type: Exists (SQL query returns at least one row)
    Expression 1:
    SELECT 1
    FROM DUAL
    WHERE :P1_SELECTION LIKE '%(Department)'When Button Pressed: SUBMIT
    On page 2 (the employee edit form), I have Computation with the following settings:
    Item Name: P2_EMPNO
    Type: SQL Query (return single value)
    Computation Point: Before Header
    Computation:
    SELECT EMPNO
    FROM EMP
    WHERE ENAME || ' (Employee)' = :P2_ENAME Condition Type: Exists (SQL query returns at least one row)
    Expression 1:
    SELECT 1
    FROM DUAL
    WHERE :P2_ENAME LIKE '%(Employee)'On page 3 (the department edit form), I have Computation with the following settings:
    Item Name: P2_DEPTNO
    Type: SQL Query (return single value)
    Computation Point: Before Header
    Computation:
    SELECT DEPTNO
    FROM DEPT
    WHERE DNAME || ' (Department)' = :P3_DNAMECondition Type: Exists (SQL query returns at least one row)
    Expression 1:
    SELECT 1
    FROM DUAL
    WHERE :P3_DNAME LIKE '%(Department)'The idea is that we append some fixed text to the end of the names in the autocomplete list. When the user clicks submit after selecting a name, one of the branches will be triggered depending on which fixed text is there. The branch sets the ENAME or DNAME value on the edit page and the computation on that page retrieves the appropriate EMPNO or DEPTNO value to put into the primary key page item (the main "Fetch Row..." process will then use that to get the real data for the record).
    Note that this assumes that ENAME and DNAME are unique on their tables - otherwise, the computations will not be able to find a single record and an error would be generated.
    Andy

  • Formatted search to auto generate Item No.

    Hi,
    Customer is using 2007A PL47. They had requirement to auto generate Item No based on UDF created in Item Master Data(OITM). The stock code structure is as follow:
    Item No=EP(hardcode 2 char)+U_ProdRange U_ProdGroupU_ProdFamily+user defined text
    The keystroke steps are:
    1. Key in item description
    2. Select drop down list for U_ProdRange in OITM
    3. Select drop down list for U_ProdGroup in OITM
    4. Select drop down list for U_ProdFamily in OITM
    5. Formatted search to generate Item No based on 2,3, 4
    6. User keys in user defined text in Item No
    7. Fill in other relevant fields in Item Master Data
    8. Add Item Master Data
    May I know how to write the query in formatted search?
    Regards
    Thomas

    Hi,
    I had got solution.
    Try this Select TOP 1 'EP' +$[OITM.U_ProdRange] +$[OITM.U_Prodgroup] +$[OITM.U_ProdFamily]
    Regards
    Thomas

  • Auto generate displayname

    Hey IDers,
    A customer pointed out to me that the displayname for any given person created within the company is always %MX_FIRSTNAME% <space> %MX_LASTNAME%. So I implemented that idea thinking it would be a minute work.
    First sign of a problem however popped up when I tried to remove DISPLAYNAME from the create identity task, he mentioned that the DISPLAYNAME was mandatory but I could continue. Now I added a step at the bottom of my create task/job to IDstore using the mskeyvalue and simply adding the DISPLAYNAME using first and lastname fields but still when I create a new user it just uses the MSKEYVALUE in the displayname field.
    So now I'm curious, am I not able to generate the displayname, is this some kind of build in safety?
    Secondly, in future releases we'll also have to make the MSKEYVALUE auto generated using first and last name because of multiple AD domains etc. Will I be able to do that or is this also limited?
    Thx in advance.

    I'm not 100% sure if I get what you're saying, but here's one thought:
    You could create a custom entry type that does not have these required fields. It will need an MSKEYVALUE still but that can be autogenerated, or autoincremented numbers, or whatever. It doesn't matter.
    So, say you want to add Joe Smith. You create a new entry type:
    MSKEYVALUE=TEMP12345
    FIRSTNAME=Joe
    LASTNAME=Smith
    Then you generate the other things you want:
    DISPLAYNAME=Joe Smith
    REALMSKEYVALUE=ADMIN:CORP:HQ:SMITHJOE
    Then you have a pass that uses that entry to make the real entry.
    That's just one thought, it still might be possible to do what you need to do more directly, but this will work (and we do something similar for some more complicated processes already, this is just a simple example).

  • Auto generate forms in Oracle BPM 10.3?

    Is there an option to auto generate a form in Oracle BPM 10.3?
    The scenario is like I(as a customer) have to fill a form with few details. the next I want (in the process) is, to auto generate a form with these details and a few extra ones...how is this possible?
    Im a newbie to Oracle BPM!:)
    thanks in advance

    There's no out of the box way to automatically generate a form on the fly from a customer perspective.
    There are three ways forms are usually created in Oracle BPM 10g. You can use the out of the box BPM Object presentations, hand code JSPs based on a BPM Object using a tag library Oracle provides, and hitting external web pages.
    Of the three, BPM Object presentations are the easiest if your team is unfamiliar with JSPs. BPM Object presentations are very simple to build initially - there's a wizard that prompts you for the attributes (fields) to display and the sequence you want them displayed. As the UI is built, you'll see text labels automatically added to the left of the fields. The labels added are based on the attribute's name. Modifying the presentations after they are build is fairly easy using a table and cell drag and drop paradigm.
    If you're a JSP shop, you should definitely go the JSP route.
    If your development team is building forms using another technology and are heavily invested in this, then go the external route.
    Hope this helps,
    Dan

  • How to auto generate SFC Number(using the Old SFC Num) when I split a SFC

    when I split a SFC (SFC Number:A001), I want to auto generate  the new SFC number, and the new SFC number pattern is A001-01 (the prefix is old SFC number). I don't know how to do.
    Please help me if you  know  it.

    Wenjun,
    SFC ID is actually a key field so I would suggest you following [Note 1363812|https://service.sap.com/sap/support/notes/1363812] "SAP ME 5.2: Key Field Character
    Restrictions" to use only legal characters in Next Number patter. If the system does not generate serialized SFCs in accordance with the patter even in this case, then it is definitely a bug.
    Per on-line help: "SFC Number Serialize - the pattern that uniquely identifies the serialized SFC number during serialization, split, or relabel"
    Sergiy

Maybe you are looking for

  • IS-OIL: Exchange Third-party feedstock material for on-spec material

    Dear All, We are using SAP ERP ECC 6.0 + IS-Oil Downstream and we are trying to figure out how to record the following business flow in the system: 1. A third-party partner send us feedstock/off-spec material to our oil depot for an exchange with on-

  • Renaming iPod Nano

    I bought an iPod Nano at Best Buy that had been previously opened. The previous person who owned the iPod named it with her first name, how do I change the name of the iPod to my name? Thanks.

  • Webutil reading registry entries.

    I have the following program unit that works in forms 6i using the win_api_environment.read_registry program unit. l_filetype := WIN_API_ENVIRONMENT.Read_Registry ('HKEY_CLASSES_ROOT\'||l_extension, null, TRUE); -- Get associated OPEN command e.g. --

  • RE: Firefox keeps crashing

    I just bought an imac 27 in I3. My problem is that firefox keeps crashing on certain sites. I can bring those sites up on Safari without any problems. Any one else have this problem and how did you solve the problem? I really like Firefox and don't w

  • Appstore in mac osx maverick say "Error Conexion"

    I want update some applications and AppStore say "Error Conexion"  when try connect to appStore. My user and my password are correct. I use this data in iPhone and Icloud.com and works