Problem while inserting the same value on a primary key column

hi all ,
in my application there is a block with a pat_id column "primary key" ,
if the user inserts the same value in this column , a message appears asking me if i want to save the changes or not ,
i do not know what changes is the message asking about , and sure i do not want this message to appear to the user
when he insert the same values by mistake ?
thanks

as a primary key field dont fill this with manually try use db seq.
Use pre-insert trigger .

Similar Messages

  • Getting the UPDATEd value and its primary key

    I have two procedures, proc1 and proc2.
    In proc1 there is an update happening like
    CREATE OR REPLACE procedure proc1
    as
    TYPE NumList IS TABLE OF employees.employee_id%TYPE;
    enums NumList;
    TYPE NameList IS TABLE OF employees.last_name%TYPE;
    names NameList;
    BEGIN
    UPDATE emp set sal=900 WHERE department_id = 30
    RETURNING employee_id, last_name BULK COLLECT INTO enums, names;
    DBMS_OUTPUT.PUT_LINE('Updated ' || SQL%ROWCOUNT || ' rows:');
    FOR i IN enums.FIRST .. enums.LAST
    LOOP
    DBMS_OUTPUT.PUT_LINE('Employee #' || enums(i) || ': ' || names(i));
    END LOOP;
    END;
    /In proc2 which is getting executed just after proc2 i want to SELECT the sal column values and its primary keys(employee_id) which got updated in proc 1.
    How can i achieve this?

    add two out parameters from proc1 so that you can pass them into proc2 (obv. you'd need to add two in parameters to proc2 if they aren't there already)

  • Hi friends, I have a doubt in inserting a field to database table and inserting the same values in two different tables

    I have a mpp screen for a cd library management system (we are practicing on it).
    We have a main screen where a user should enter the enteries and while clicking a add button it should be inserted in a table, Here the problem rises the table name are ztransaction and zstatus.The fields in mpp are cdid,customerid,transaction id,date of issue and duedate.Now after entering all the values on clicking add button it should be inserted to database table ztransaction and the field cdid alone should be inserted both in ztransaction and zstatus.
    Thank you

    Hi Raghuram R G,
    Check for Primary key and foreign key in the Database table??? Because of this it was not inserting...check and confirm??
    Regds,
    Vijay SR

  • Problem while updating the forecast value in m.master by direct input menth

    Hi All
      Good Day
      I am updating the forecast value in material master by direct input method.
    my program is working fine when I am running it online.
    but when i am runnig in back ground I am getting one error which is mentioned below
                                                                                    Job ZM_OPTIMIZA_UPLOAD: Data does not match the job definition; job terminated    BD    078     E    
    Please anyone can help ne in above case.
    Thanks in advance.
    Cheers
    Vallabhaneni

    Hi Hakim
    How are you
    Thanks for your valuable suggestion.
    I am executing my program in background with bmv0 transaction with variant, in development I can run this job in background with out any logical errors but in QA I am getting errors.
    Can you please help me in the above case.
    In Bmv0 transaction first I defined the job and in  program rmdatind (execute) screen first I mentioned the Max. no of logical errors as 500 and Transactions per commit unit as 500 and I run the program in background in bmv0 transaction and I am getting the message background job terminated immediately
    Because of this again I changed the Max. no of logical errors 500 to 99999 and transaction per commit unit 500 to 999999 and then i scheduled my program in background.
    Alomost it ran for 27 hours and then it has given the message background job terminated.
    Job log entries are as follows.
    22.12.2008  11:19:46  A system error has occurred while locking                                 
    22.12.2008  11:19:46  Transaction 0000040840; material number SUJ82J8400; error gravity E       
    22.12.2008  11:19:46  Transaction 0000040840: Taxes for sales org.  cannot be transferred       
    22.12.2008  11:19:46  A system error has occurred while locking                                 
    22.12.2008  11:19:46  Transaction 0000040841; material number SUJ84G3001; error gravity E       
    22.12.2008  11:19:46  Transaction 0000040841: Taxes for sales org.  cannot be transferred       
    22.12.2008  11:19:46  A system error has occurred while locking                                 
    22.12.2008  11:19:46  Transaction 0000040842; material number SUJ84G3002; error gravity E       
    22.12.2008  11:19:46  Transaction 0000040842: Taxes for sales org.  cannot be transferred       
    22.12.2008  11:19:46  A system error has occurred while locking                                 
    22.12.2008  11:19:46  Transaction 0000040843; material number SUJ86G0100; error gravity E       
    22.12.2008  11:19:46  Transaction 0000040843: Taxes for sales org.  cannot be transferred       
    22.12.2008  11:19:46  A system error has occurred while locking                                 
    22.12.2008  11:19:46  Transaction 0000040844; material number SUJ86G0300; error gravity E       
    22.12.2008  11:19:46  Transaction 0000040844: Taxes for sales org.  cannot be transferred       
    22.12.2008  11:19:46  A system error has occurred while locking                                 
    22.12.2008  11:19:46  Transaction 0000040845; material number SUJ86G0900; error gravity E       
    22.12.2008  11:19:46  Transaction 0000040845: Taxes for sales org.  cannot be transferred       
    22.12.2008  11:19:46  A system error has occurred while locking                                 
    22.12.2008  11:19:46  Transaction 0000040846; material number SUJ86G9600; error gravity E       
    22.12.2008  11:19:46  Transaction 0000040846: Taxes for sales org.  cannot be transferred       
    22.12.2008  11:19:46  A system error has occurred while locking                                 
    22.12.2008  11:19:46  Transaction 0000040847; material number SUJ86G9601; error gravity E       
    22.12.2008  11:19:46  Transaction 0000040847: Taxes for sales org.  cannot be transferred       
    22.12.2008  11:19:46  A system error has occurred while locking                                 
    22.12.2008  11:19:46  Transaction 0000040848; material number SUJ86J0000; error gravity E       
    22.12.2008  11:19:46  Transaction 0000040848: Taxes for sales org.  cannot be transferred       
    22.12.2008  11:19:46  A system error has occurred while locking                                 
    22.12.2008  11:20:54  Transaction 0000040848 completed Mat. no.  No. of log. errors 0000040848  
    22.12.2008  11:21:30  ABAP/4 processor: TSV_TNEW_PAGE_ALLOC_FAILED                              
    22.12.2008  11:21:30  Job cancelled      
    I know it has taken long time to process the job  because of I changed the transactions per commit unit (500 to 999999) it kills the system
    But I am supposed to provide some number < 999999 in transactions per commit unit
    actually I haven't tried like I said above < 999999 because i don't have any hopes.
    Please look at this problem and help me in this case.
    Thanks in advance.
    Vallabhaneni

  • Problems while saving the tax values in a Draft Document to AP Invoice

    Hi All
    I have an interface .net where I use a DIAPI to enter values in B1 2007 B (8.60.039) PL 15.
    I have the following cases:
    First case
    - I create a document type oPurchaseInvoices, where I set the tax values for IRPF, INSS, ISSQN (Brazil).
      When i execute the code that inserts this A/P Invoice in SAP, it works perfectly, including by setting the values of the taxes correctly.
    Second case
    - I create a document type oDrafts, and say that this draft is the type oPurchaseInvoices.
      After that I follow the same steps to launch a note entry, laying the tax values(IRPF, INSS, ISSQN) and everything else.
      When i execute the code that inserts this values in the draft, the tax values are not entered and that everything else works perfectly. 
    You can tell me whether the taxes really are not inserted when I issue a draft or I'm leaving to score some parameter.
    I am in the look of your response
    Regards
    Luis Felipe

    Hi Gordon.
    You can see below the part of the code to add the Draft Document.
    oAPInvoice = oCompany.SapCommand.GetBusinessObject(BoObjectTypes.oDrafts)
    oAPInvoice.DocObjectCode = BoObjectTypes.oPurchaseInvoices
    With oAPInvoice
        .Lines.TaxLiable = BoYesNoEnum.tYES
        .Lines.ItemCode = Itemcode
        .Lines.Quantity = Quantity
        .Lines.UnitPrice = Unitprice
        .Lines.TaxCode = Taxcode
        .Lines.WTLiable = BoYesNoEnum.tNO
        .Lines.Usage = "Consumo"
        If oDTO.IRRF > 0 Or oDTO.INSS > 0 Or oDTO.ISSQN > 0 Then
            If oDTO.WtLiable = "Y" Then .Lines.WTLiable = BoYesNoEnum.tYES
            Add tax values
            For i As Int16 = 1 To 3
                vlrImposto = 0
                addTax = False
                If IRRF > 0 And Not addIR Then
                    codImposto = CodeIRRF   (tax code)
                    vlrImposto = IRRF             (tax value)
                    addIR = True
                    addTax = True
                ElseIf INSS > 0 And Not addINSS Then
                    codImposto = "F501"  (tax code)
                    vlrImposto = INSS       (tax value)
                    addINSS = True
                    addTax = True
                ElseIf ISSQN > 0 And Not addISSQN Then
                    codImposto = CodeISSQN  (tax code)
                    vlrImposto = ISSQN            (tax value)
                    addISSQN = True
                    addTax = True
                End If
                If addTax Then
                    (If include more one tax then add line)
                    If i > 1 And vlrImposto > 0 Then .Lines.WithholdingTaxLines.Add()
                    .Lines.WithholdingTaxLines.WTCode = codImposto                     (tax code)
                    .Lines.WithholdingTaxLines.TaxableAmount = Unitprice              (base value calculation)
                    .Lines.WithholdingTaxLines.WTAmount = vlrImposto                   (tax value)
                End If
            Next
        End If
        .CardCode = Cardcode
        .CardName = Cardname
        .HandWritten = BoYesNoEnum.tNO
        .DocDueDate = DueDate
        .DocDate = DocDate
        .TaxDate = TaxDate
        .SequenceCode = -2      '-1=Manual  -2=External
        .SeriesString = "RCB"
        .SequenceModel = 37
        lRetCode = .Add()
    End With
    Regards
    Luis Felipe

  • Problem while updating the forecast value in m.master by direct input metho

    Hi Hakim
    Thanks for your prompt response.
    Yeah, I can see the same in St22 as you said, If I contaced the basis team for memory extension
    is my problem can get solved?
    and I will change the Transactions per commit unit to 100 again.
    Is there anything else is causing the background job termination
    really I couldn't find anything wrong in my program and it is running successfully in development client
    and it is giving the message completed and
    Job name Last update Current status
    ZM_OPTIMIZA_FORECAST 23.12.2008 09:18:47 C Completed: job executed w/o logical errors
    ZM_OPTIMIZA_FORECAST 19.12.2008 11:22:31 C Completed: job executed w/o logical errors
    ZM_OPTIMIZA_FORECAST 19.12.2008 11:21:20 C Completed: job executed w/o logical errors
    and the job log is as follows in development client.
    23.12.2008 09:18:47 The field MARA-FORMT is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-KUNNR is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-MEINS is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-PRZUS is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 No changes made
    23.12.2008 09:18:47 Transaction 0000000004; material number 2210017320; error gravity W
    23.12.2008 09:18:47 Transaction 0000000004: Taxes for sales org. cannot be transferred
    23.12.2008 09:18:47 Not possible to transfer tax data
    23.12.2008 09:18:47 The field MARA-BEGRU is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-BMATN is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-FERTH is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-FORMT is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-KUNNR is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-MEINS is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-PRZUS is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 No changes made
    23.12.2008 09:18:47 Transaction 0000000005; material number 6777295J01; error gravity W
    23.12.2008 09:18:47 Transaction 0000000005: Taxes for sales org. cannot be transferred
    23.12.2008 09:18:47 Not possible to transfer tax data
    23.12.2008 09:18:47 The field MARA-BEGRU is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-BMATN is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-FERTH is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-FORMT is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-KUNNR is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-MEINS is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 The field MARA-PRZUS is not ready for input and was therefore not initialized
    23.12.2008 09:18:47 No changes made
    23.12.2008 09:18:47 Transaction 0000000005 completed Mat. no. T6777295J01 No. of log. errors 0000000000
    23.12.2008 09:18:47 Data transfer (job 00000007) completed
    23.12.2008 09:18:47 No logical (business) errors occurred
    23.12.2008 09:18:47 Job finished
    But in QA it is behaving totally different like i said in my earlier threat .
    Thanks
    Vallabhaneni

    Hi Nani,
    Dont open multiple threads for the same question. Im requesting you to close your threads similar to this thread.Keep only one thread open for the same issue.
    Please read the Rules of Engagement in SCN.
    Regards,
    Hakim

  • Problem in Inserting the new values into Ztable

    Hi Techies,
    I have a requirement that when ever user enters the value in Billing Qty input which is in VF01 tcode and the table is VBRP-FKIMG, and client want billing qty and previous month reading, the fields are not in VBRP. So I have created a custom table name as YSD-EXPORT_QTY with fields of CUSTOMER, MONTH, YEAR, BILL_QTY, PREV_READING, CUMULATIVE... When ever user enter the Billing Qty I want to update database table and initally there is no data in custom table. I tried below code but i am not getting and i am getting the error as
    "The type of the database table and work area (or internal table) "WA_EXPORT" are not Unicode convertible. "
    So, How can I resolve this issue.. I am trying this since from 3 days... if u have any sample code please give me...
    MOVE WA_VBRP-FKIMG TO WA_EXPORT-BILL_QTY.
    WA_EXPORT-CUMULATIVE = WA_EXPORT-BILL_QTY + WA_EXPORT-PREV_READING.
    WA_EXPORT-PREV_READING = WA_EXPORT-CUMULATIVE.
    APPEND WA_EXPORT TO IT_EXPORT.
    INSERT INTO YSD_EXPORT_QTY VALUES WA_EXPORT.

    If it overrides existting record, you should add new key fields to your database table, there can be only one record per set of key values.
    I suppose  keys look like MANDT, KUNNR, GJAHR, MONAT or MANDT VBELN POSNR or a combination of both set of keys (not sure to understand you requirement)
    You have to first read from database if some data already exists,
    - if yes, add the new quantities and UPDATE the record
    - if no, INSERT a new record
    Remember keys define a unique record, and cannot be updated once inserted.
    If your program should never update records, add a "technical" key field, and fill it using a timestamp or a number range counter (FM NUMBER_GET_NEXT)
    Regards,
    Raymond

  • SQL: while insert the number value

    Hi All,
    I have one doubt.please see the below issue.
    SQL>create table test (no number(10));
    Table created.
    SQL>insert into test values (001);
    1 rows inserted.
    SQL> select * from test;
    NO
    1
    But I need the value is 001.
    Note: I couldn't change the table structure.
    Regards
    RajaBaskar Thangaraj
    www.dbarajabaskar.blogspot.com

    what is the difference between 001 and 1?
    if it is only for display purposes, then use TO_CHAR
    select to_Char (no, '099')
      from test

  • Problem with inserting into table that has autogenerated primary key

    hi
    i am working on EJB3.
    i am trying to insert object into table.Primary key of table will be generated automatically.I tried following statement for insertion,
    em.persistent(customerObj);
    but it throw following exception,
    javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): customer.CustomerInfo
         at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
         at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
         at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
         at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
         at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:211)
         at org.jboss.ejb3.stateless.Stateles
    can anyone tell me is there any other way to acheive the same.
    i thought of doing using insert query,but i am not sure about the syntax to be used.
    could anyone help me ?
    thanks in advance...

    That's why you should use PreparedStatement instead of Statement. Its setString() method will escape that value for you properly when you bind it.
    %

  • Problem while setting the selected value of h:selectOneMenu to bean

    Hi all,
    I am new to JSF. I am working on application where i have combo boxe on the page. I am setting some values to the combobox from database using <f:selectItems> tag and one value using <f:selectItem> tag. The value combobox value selected by user is set to the bean property which is String. I am able to display all the values in the combobox but when clicked on button (present at the end of form) i am getting following error-
    ERROR HtmlRendererUtils:354 - Error finding Converter for
    component with id interviewStageOneForm:acceptanceChannelList
    I am setting the combobox selected value to the to the bean property which is String and the value selected in also String. Then which converter it is asking for. I am not able to find out what is the problem.
    Your suggestions will be really appreciated.
    Here is my code snippet:-
    JSF:-
    <h:selectOneMenu id="acceptanceChannelList"
         value="#{interviewStageOneBean.index}">
         <f:selectItem itemValue="Select" itemLabel="#{Message.combo_select}" />
         <f:selectItems value="#{MasterDataBean.acceptanceChannelList}" />  <!-- The list coming from database-->
    </h:selectOneMenu>Bean:-
    public class InterviewStageOneBean {
         private String index;
         public String getIndex() {
              return index;
         public void setIndex(String index) {
              this.index = index;
    }

    Hi!
    First I would try next:
    Try to leave out
    <f:selectItem itemValue="Select" itemLabel="#{Message.combo_select}" />
    line. And check if it works after that. If it didn't repeat step but you leave in message selectItem and dump out database selectItem line.
    Second:
    I would check acceptanceChannelList creation and what type of objects you put while doing setValue and setLabel on UISelectItem
    Probably selectItem value has been assigned an object of type the engine doesn't know how to convert from String to it.

  • ORA-01438 error while inserting the BLOB value in the column

    Hi All,
    I have created a table with definition:
    CREATE TABLE stories (id NUMBER(4), story BLOB);
    Now I am trying to populate this table with some values from other table with:
    insert into stories
    select sensitivity_id, multi_value from sensitivity where sensitivity_id=3983021541;
    Here the multi_value column from th source table is also declared as BLOB so I shlould not get this error. What kind of precision needs to be set so the query doesnt faills?
    Regards,
    aashish

    Hi,
    Can you elaorate more on this..I never tried his thing but this is just a part of big procedure where I have to do this.
    Thanks,
    aashish

  • "Setup encountered a problem while validating the state of Active Directory: Exchange organization-level objects have not been created, and setup cannot create them because the local computer is not in the same domain and site as the schema master. Run se

    Team,
    I am trying to Install Exchange on my Lab, getting below error
    message.
    The Schema Role is installed on Root Domain and trying to install
    exchange on Child domain.
    1 Root Domain - 1 Child domain. both are located on single site.
    “Setup encountered a problem while validating
    the state of Active Directory: Exchange organization-level objects have not been created, and setup cannot create them because the local computer is not in the same domain and site as the schema master. Run setup with the /prepareAD parameter and wait for
    replication to complete.”
    Followed below articles:
    http://support.risualblogs.com/blog/2012/02/21/exchange-2010-sp2-upgrade-issue-exchange-organization-level-objects-have-not-been-created-and-setup-cannot-create-them-because-the-local-computer-is-not-in-the-same-domain-and-site-as-the-sche/
    http://www.petenetlive.com/KB/Article/0000793.htm
    transferred the schema roles to different server on root domain, still no luck.
    can someone please help me.
    regards
    Srinivasa k
    Srinivasa K

    Hi Srinivasa,
    I guess, you didn't completed the initial setup schemaprep and adprep before starting the installation. You can do it as follows:
    1. Open command Prompt as administrator and browse to the root of installation cd and run Setup.exe /PrepareSchema /IAcceptExchangeServerLicenseTerms
    After finishing this,
    2. Setup.exe /PrepareAD /OrganizationName:"<organization name>" /IAcceptExchangeServerLicenseTerms
    3. To prepare all domains within the forest run Setup.exe /PrepareAllDomains /IAcceptExchangeServerLicenseTerms. If you want to prepare a specific domain run Setup.exe /PrepareDomain:<FQDN of the domain you want to prepare> /IAcceptExchangeServerLicenseTerms
    4. Once you complete all of the 3 steps, install the pre-requisities for Exchange 2013
    5. Finally, run the setup program
    Hope this will help you
    Regards from Visit ExchangeOnline |
    Visit WindowsAdmin

  • Insert an attachment while writing the same

    Good night,
    Do you know how we can to insert an attachment/file in an email but while writing the same, for example, when we reply a message "... please see the attached file..." and insert then the file.
    I only see that this only is possible if we for example press on the file (on Docstogo) and send, and then e open a new email already with the attachement.
    Could you please help me.
    Thanks

    alphabet soup,
    Yes, windows helpfully prevents two processes from accessing a file simultaneously. Operating Systems on the other hand uniformly support it.
    Which probably doesn't help you very much, as I imagine that you can't just up and change the source machine over to *nix, but there you have it.
    You'll just have to close the program which has the database open, copy the database, and restart the program which uses the database.
    keith.
    Message was edited by: corlettk

  • Problem while inserting into a table which has ManyToOne relation

    Problem while inserting into a table *(Files)* which has ManyToOne relation with another table *(Folder)* involving a attribute both in primary key as well as in foreign key in JPA 1.0.
    Relevent Code
    Entities:
    public class Files implements Serializable {
    @EmbeddedId
    protected FilesPK filesPK;
    private String filename;
    @JoinColumns({
    @JoinColumn(name = "folder_id", referencedColumnName = "folder_id"),
    @JoinColumn(name = "uid", referencedColumnName = "uid", insertable = false, updatable = false)})
    @ManyToOne(optional = false)
    private Folders folders;
    public class FilesPK implements Serializable {
    private int fileId;
    private int uid;
    public class Folders implements Serializable {
    @EmbeddedId
    protected FoldersPK foldersPK;
    private String folderName;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "folders")
    private Collection<Files> filesCollection;
    @JoinColumn(name = "uid", referencedColumnName = "uid", insertable = false, updatable = false)
    @ManyToOne(optional = false)
    private Users users;
    public class FoldersPK implements Serializable {
    private int folderId;
    private int uid;
    public class Users implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer uid;
    private String username;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "users")
    private Collection<Folders> foldersCollection;
    I left out @Basic & @Column annotations for sake of less code.
    EJB method
    public void insertFile(String fileName, int folderID, int uid){
    FilesPK pk = new FilesPK();
    pk.setUid(uid);
    Files file = new Files();
    file.setFilename(fileName);
    file.setFilesPK(pk);
    FoldersPK folderPk = new FoldersPK(folderID, uid);
         // My understanding that it should automatically handle folderId in files table,
    // but it is not…
    file.setFolders(em.find(Folders.class, folderPk));
    em.persist(file);
    It is giving error:
    Internal Exception: java.sql.SQLException: Field 'folderid' doesn't have a default value_
    Error Code: 1364
    Call: INSERT INTO files (filename, uid, fileid) VALUES (?, ?, ?)_
    _       bind => [hello.txt, 1, 0]_
    It is not even considering folderId while inserting into db.
    However it works fine when I add folderId variable in Files entity and changed insertFile like this:
    public void insertFile(String fileName, int folderID, int uid){
    FilesPK pk = new FilesPK();
    pk.setUid(uid);
    Files file = new Files();
    file.setFilename(fileName);
    file.setFilesPK(pk);
    file.setFolderId(folderId) // added line
    FoldersPK folderPk = new FoldersPK(folderID, uid);
    file.setFolders(em.find(Folders.class, folderPk));
    em.persist(file);
    My question is that is this behavior expected or it is a bug.
    Is it required to add "column_name" variable separately even when an entity has reference to ManyToOne mapping foreign Entity ?
    I used Mysql 5.1 for database, then generate entities using toplink, JPA 1.0, glassfish v2.1.
    I've also tested this using eclipselink and got same error.
    Please provide some pointers.
    Thanks

    Hello,
    What version of EclipseLink did you try? This looks like bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=280436 that was fixed in EclipseLink 2.0, so please try a later version.
    You can also try working around the problem by making both fields writable through the reference mapping.
    Best Regards,
    Chris

  • Problem while inserting a record to infotype 416

    Iam facing a problem while inserting a record to the infotype 416 for a personnel no using the FM 'HR_INFOTYPE_OPERATION'.I have created a FM to insert a record to the infotype 416.In that FM iam using the FM 'HR_INFOTYPE_OPERATION' to create a record for infotype 416.while executing  my FM the FM 'HR_INFOTYPE_OPERATION' is returning the return value 0.But when i check in PA30 for the infotype 416,there is no record created for that personnel no.Also in the table PA0416 the record is not get created.SO what might be the problem.can anyone please provide me help on this.
    I have attached the code of my FM for ur reference.
    FUNCTION Y_ESS_FL_ENCASH.
    DATA: G_COMPENSATION_AMOUNT LIKE PA0416-AMONT,
          G_RETURN TYPE BAPIRETURN1.
    DATA T_PA0416 LIKE P0416 OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
           TCLAS                 = 'A'
           PERNR                 = '00000014'
           INFTY                 = '0416'
         BEGDA                 = sy-datum
         ENDDA                 =  sy-datum
           BYPASS_BUFFER         = 'X'
         LEGACY_MODE           = ' '
    IMPORTING
         SUBRC                 =
          TABLES
            INFTY_TAB             = T_PA0416
    EXCEPTIONS
      INFTY_NOT_FOUND       = 1
      OTHERS                = 2
        LOOP AT T_PA0416
        WHERE SUBTY = '1002'.
        ENDLOOP.
        IF SY-SUBRC <> 0.
          CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
            EXPORTING
               NUMBER = '00000014'
            IMPORTING
               RETURN = G_RETURN.
          IF SY-SUBRC <> 0.
             MESSAGE I016(RP) WITH ' RECORD IS ALREADY LOCKED'.
          ENDIF.
          T_PA0416-PERNR = '00000014'.
          T_PA0416-SUBTY = '1002'.
          T_PA0416-INFTY = '0416'.
          T_PA0416-OBJPS = ''.
          T_PA0416-SPRPS = ''.
          T_PA0416-SEQNR = ''.
          T_PA0416-AEDTM = SY-DATUM.
          T_PA0416-UNAME = SY-UNAME.
          T_PA0416-ENDDA = SY-DATUM.
          T_PA0416-BEGDA = SY-DATUM.
          T_PA0416-NUMBR = '10'.
          T_PA0416-WGTYP = '1530'.
          T_PA0416-AMONT = '15000'.
          T_PA0416-WAERS = 'INR'.
          T_PA0416-QUONR = '1'.
          APPEND T_PA0416.
          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              INFTY                  = '0416'
              NUMBER                 = '00000014'
              SUBTYPE                = '1002'
      OBJECTID               =
      LOCKINDICATOR          =
             VALIDITYEND            = '31129999'
             VALIDITYBEGIN          = SY-DATUM
            RECORDNUMBER           = ''
              RECORD                 = T_PA0416
              OPERATION              = 'INS'
              TCLAS                  = 'A'
      DIALOG_MODE            = '0'
            NOCOMMIT               = 'X'
      VIEW_IDENTIFIER        =
      SECONDARY_RECORD       =
            IMPORTING
              RETURN                 = G_RETURN.
      KEY                    =
          IF G_RETURN+0(1) EQ 'E'.
                  MESSAGE I086(ZHR) WITH 'Record is not inserted in IT416'.
          ELSE.
              COMMIT WORK.
          ENDIF.
          CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
            EXPORTING
              NUMBER = '00000014'
            IMPORTING
              RETURN = G_RETURN.
        ENDIF.
    ENDFUNCTION.

    Hi Murthy
    With a first glance, I think you have given a wrong parameter value to "validityend". It should be '99991231' not '31129999' .
    If your problem still persists, try inserting the data online from PA30. If your input causes no errors, then please state what the return parameter contains.
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

Maybe you are looking for

  • Unable to browse Internet for any length of time

    I am having constant screen blackouts in Chrome where I am redirected back to my home screen (desktop). Facebook seems to work fine, this happens when I click on a link that opens in Chrome. Could it be a Chrome problem or a lack of phone coverage in

  • Flash CS5 ACE, missing certificate

    Hi! I've succesfully passed the Flash CS5 ACE recertification exam on 4th of May, but I've not received any certificate yet. PS: I'm not sure this is the right section for this topic, in case it's not i'm sorry.

  • ITunes Corruption after Xcode Install

    Hi All I'm hoping some-one can help. Up until earlier this week everything was perfect with iTunes and my 2nd gen iPod Touch. I then installed xCode 4.0 from the Apple App Store. Everything appeared to go smoothly. However, now whenever I plug my Ito

  • Do you have numbers to 'prove' centralized is better than decentralized or hybrid Demand Center models?

    Hi all I am fairly sure I have see something on the interweb that referenced research that made the case for centralizing demand, and showed quantitatively the benefits and impact that having a center of excellence gave an organisation versus those t

  • DW 8 - Inline Frame TOP alignment

    Greetings, I have a table with couple columns. Left column has Iframe of text links. Basically my navigation links for my site. Next colums are just editible regions. Problem is that my left cell with iFrame top text is lower than my next columns tex