IDENTITY field problem

Could anyone please suggest me the best way to retrieve value inserted
in the identity field in case of concurrent connections for databases
(RDBMS) like DB2, SQL Server or Oracle.<br> Particularly in case of
DB2.<br> And if the suggestion is to use Stored Procedures and
<b>'@@IDENTITY'</b> in case of SQL server then please suggest the
method/statement to be used in case of DB2.<br> I m using Db2 with a
JSP application and need to link multiple tables through IDENTITY field
value generated in one table.

Hi Guys,
I found the Solution to get back the auto generated IDENTITY column value.
Steps to follow.
1. Get Database Connection
2. Set AutoCommit to false (use setAutocommit(false) )
3. Set the PreparedStement for Insert and fire the SQL.
4. Close the PreparedStatement.
5. Fire this SQL to get the auto generated ID.
SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM.SYSDUMMY1
6. This generated ID will always double. Get this ID to the attribute fo the bean.
7. Now you can commit.
Example.
ResultSet rs = prepStmt.executeQuery("SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM.SYSDUMMY1");
double id = 0.0;
if (rs.next()) {
System.out.println("rs.next() ");
setGeneratedId(rs.getDouble(1));
System.out.println(" getGeneratedId() : " + getGeneratedId());
connection.commit();

Similar Messages

  • Combing PDF forms with identical field names while retaining unique values.

    I have several PDF files of the same form that has been filled out by multiple users. I need to create a combined file of all the responses for reporting purposes. However, the forms (obviously) all have the same field names, and when I combine them the values of the first form autofill the values of the matched fields on the other forms. I need a way to combine the forms while retaining the unique field values. I thought I could write a js to rename the fields, but that isn't possible.
    *EDIT: The fields need to retain editability because some contain long, scrolling text. Flattening or read-only isn't an option, not that either fixes the above problem.
    Suggestions?

    UPDATE:
    I solved this problem, at least for my own needs. Following try67's advice in a related post, I had to delete the existing fields and create new ones with new names. Given my desired outcome, this meant collecting all of the field properties of the fields (with some variation by field type), storing it, erasing the existing fields, and using that stored information to create new, identical fields (again with some variation by field type). Since I didn't want to retain actions or javascript, this was a perfect solution. I also no longer needed the buttons to function (since I wasn't retaining their javascript), so I made them read-only. I'm listing my working code below, in case anyone else could benefit from some or all of it.
    My question to the community is this: Why doesn't Adobe allow for fields to be renamed via javascript? Is it a security issue? My life would have been a lot easier the last few days if I could simply rename existing fields.
    The following script is used in a Combine Files action via the Action Wizard. The PDF optimizer is also used to strip out or flatten additional items.
    //This script is used to rename all the fields in a document while also removing any javascript or actions associated with those fields. Makes buttons read only without renaming.
    //Function to create a random alphanumeric ID.
    function makeid(n) {
        var text = "";
        var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
        for( var i=1; i <=n; i++ )
            text += possible.charAt(Math.floor(Math.random() * possible.length));
        return text;
    //List variables for collecting arrays of field properties.
    var fieldNum = this.numFields;
    var fieldNameArray = new Array();
    var fieldTypeArray = new Array();
    var pageNumArray = new Array();
    var fieldRectArray = new Array();
    var fieldValueArray = new Array();
    var borderStyleArray = new Array();
    var borderColorArray = new Array();
    var borderThicknessArray = new Array();
    var fillColorArray = new Array();
    var textColorArray = new Array();
    var textFontArray = new Array();
    var textSizeArray = new Array();
    var textAlignmentArray = new Array();
    var textMultilineArray = new Array();
    var checkmarkStyleArray = new Array();
    var radiowidgetNumArray = new Array();
    var radiowidgetRectArray = new Array();
    var radiowidgetPageNumArray = new Array();
    //Get the properties of all the current fields, including widgets.
    for (var i = 0; i < fieldNum; i++) {
        var currentField = this.getNthFieldName(i);
        fieldNameArray[i] = makeid(5);
        fieldTypeArray[i] = this.getField(currentField).type;
        borderStyleArray[i] = this.getField(currentField).borderStyle;
        borderColorArray[i] = this.getField(currentField).strokeColor;
        borderThicknessArray[i] = this.getField(currentField).lineWidth;
        fillColorArray[i] = this.getField(currentField).fillColor;
        textColorArray[i] = this.getField(currentField).textColor;
        textFontArray[i] = this.getField(currentField).textFont;
        textSizeArray[i] = this.getField(currentField).textSize  
        if (this.getField(currentField).type == "text") {
            fieldRectArray[i] = this.getField(currentField).rect;
            pageNumArray[i] = this.getField(currentField).page;
            fieldValueArray[i] = this.getField(currentField).value;
            textAlignmentArray[i] = this.getField(currentField).alignment;
            textMultilineArray[i] = this.getField(currentField).multiline;
        if (this.getField(currentField).type == "checkbox") {
            fieldRectArray[i] = this.getField(currentField).rect;
            pageNumArray[i] = this.getField(currentField).page;
            fieldValueArray[i] = this.getField(currentField).value;
            checkmarkStyleArray[i] = this.getField(currentField).style;
        if (this.getField(currentField).type == "radiobutton") {
            checkmarkStyleArray[i] = this.getField(currentField).style;
            fieldValueArray[i] = this.getField(currentField).value;
            var n = 0;
            while (this.getField(currentField + "." + n) != null) {
                radiowidgetNumArray[n] = this.getField(currentField + "." + n).name;
                n++;
            for (x = 0; x < radiowidgetNumArray.length; x++) {
                radiowidgetRectArray[x] = this.getField(radiowidgetNumArray[x]).rect;
                radiowidgetPageNumArray[x] = this.getField(radiowidgetNumArray[x]).page;
    //Delete all the current fields, except for buttons, which become read-only.
    for (var i = (fieldNum - 1); i > -1; i--) {
        var currentField = this.getNthFieldName(i);
        if (this.getField(currentField).type != "button") {
            this.removeField(currentField);
        } else {
            this.getField(currentField).readonly = true;
    //Using the stored arrays of field properties, generate new, identical fields.
    for (var i = 0; i < fieldNum; i++) {
        if (fieldTypeArray[i] == "text") {
            var newField = this.addField(fieldNameArray[i], fieldTypeArray[i], pageNumArray[i], fieldRectArray[i]);
            newField.value = fieldValueArray[i];
            newField.borderStyle = borderStyleArray[i];
            newField.strokeColor = borderColorArray[i];
            newField.lineWidth = borderThicknessArray[i];
            newField.fillColor = fillColorArray[i];
            newField.textColor = textColorArray[i];
            newField.textFont = textFontArray[i];
            newField.textSize = textSizeArray[i];
            newField.alignment = textAlignmentArray[i];
            newField.multiline = textMultilineArray[i];
            newField.doNotSpellCheck = true;
        if (fieldTypeArray[i] == "checkbox") {
            var newField = this.addField(fieldNameArray[i], fieldTypeArray[i], pageNumArray[i], fieldRectArray[i]); 
            newField.value = fieldValueArray[i];
            newField.borderStyle = borderStyleArray[i];
            newField.strokeColor = borderColorArray[i];
            newField.lineWidth = borderThicknessArray[i];
            newField.fillColor = fillColorArray[i];
            newField.textColor = textColorArray[i];
            newField.textFont = textFontArray[i];
            newField.textSize = textSizeArray[i];
            newField.style = checkmarkStyleArray[i];
            newField.readonly = true;
        if (fieldTypeArray[i] == "radiobutton") {
            for (y = 0; y < radiowidgetNumArray.length; y++) {
                var newField = this.addField(fieldNameArray[i], fieldTypeArray[i], radiowidgetPageNumArray[y], radiowidgetRectArray[y]);
                newField.value = fieldValueArray[i];
                newField.borderStyle = borderStyleArray[i];
                newField.strokeColor = borderColorArray[i];
                newField.lineWidth = borderThicknessArray[i];
                newField.fillColor = fillColorArray[i];
                newField.textColor = textColorArray[i];
                newField.textFont = textFontArray[i];
                newField.textSize = textSizeArray[i];
                newField.style = checkmarkStyleArray[i];
                newField.readonly = true;           
    //End script.

  • Auto Increment Not Working - SQL Identity field

    I am new to Visual Basic & SQL server but have some experience in Access & VBA. But this is a steep learning curve!
    I am banging my head against a wall with a problem..
    All of my tables in this database are in the dataset. The main one being tblItems with a PK 'ITEMID'
    I have 2 forms - the first one is used to lookup an item the second displays the item's full details.
    On the first form (lookup) I have a 'Add New' button which launches the second form with the code - frmProductDetail.VItemsBindingSource.AddNew()
    This opens the form with empty boxes as expected. I have a 'Save' button on the second form with the following code -
            Dim row As SASHItemsDataSet.tblItemsRow
            row = SASHItemsDataSet.tblItems.NewRow
            With row
                .ITEMCODE = txtItemCode.Text
                .ITEMDESCRIPTION = txtItemDescription.Text
                .CATEGORY = cmbItemCategory.SelectedValue
                .PURCHCOST = txtPurchCost.Text
                .SELLCOST = txtSellPrice.Text
                .UNIT = cmbUOM.SelectedValue
                .VATID = cmbVAT.SelectedValue
                .WHLOCATION = cmbWHLoc.SelectedValue
            End With
            SASHItemsDataSet.tblItems.Rows.Add()
            Try
                Me.Validate()
                Me.VItemsBindingSource.EndEdit()
            Catch ex As Exception
                MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "UPDATE FAILED")
            End Try
    My problem is I get the error msg box with the following error 'Column 'ITEMID' does not allow nulls'
    This field is set as a auto incrementing identity field with all the correct settings shown in Visual Studio so it shouldn't be coming back as null.
    I have Googled for hours & tried all sorts with no luck..
    I have clearly gone wrong somewhere but I can't work out where... any help appreciated!
    James

    This is the code on frmProductLookup that opens the form...
            frmProductDetail.Show()
            frmProductDetail.VItemsBindingSource.AddNew()
    This is the code on frmProductDetail_Load...
            'TODO: This line of code loads data into the 'SASHItemsDataSet.tblVAT' table. You can move, or remove it, as needed.
            Me.TblVATTableAdapter.Fill(Me.SASHItemsDataSet.tblVAT)
            'TODO: This line of code loads data into the 'SASHItemsDataSet.tblWarehouseLocations' table. You can move, or remove it, as needed.
            Me.TblWarehouseLocationsTableAdapter.Fill(Me.SASHItemsDataSet.tblWarehouseLocations)
            'TODO: This line of code loads data into the 'SASHItemsDataSet.tblStockUnits' table. You can move, or remove it, as needed.
            Me.TblStockUnitsTableAdapter.Fill(Me.SASHItemsDataSet.tblStockUnits)
            'TODO: This line of code loads data into the 'SASHItemsDataSet.tblItemCategory' table. You can move, or remove it, as needed.
            Me.TblItemCategoryTableAdapter.Fill(Me.SASHItemsDataSet.tblItemCategory)
            'TODO: This line of code loads data into the 'SASHItemsDataSet.vItems' table. You can move, or remove it, as needed.
            'Me.VItemsTableAdapter.Fill(Me.SASHItemsDataSet.vItems)
            Me.VItemsTableAdapter.Fill(Me.SASHItemsDataSet.vItems)
            Me.VItemsBindingSource.Position = Me.VItemsBindingSource.Find("ITEMID", _passedText)
            Me.txtWKSName.Text = Environment.MachineName
            Me.txtSellPrice.Text = FormatCurrency(Me.txtSellPrice.Text)
            Me.txtPurchCost.Text = FormatCurrency(Me.txtPurchCost.Text)
            Me.txtPriceIVAT.Text = FormatCurrency(Me.txtSellPrice.Text + (Me.txtSellPrice.Text * 0.2))
    On the tblItemTableAdapter this is the Command Text for the Insert Command...
    INSERT INTO tblItems
                             (ITEMCODE, ITEMDESCRIPTION, UNIT, WHLOCATION, VATID, PREFSUPPLIER, CATEGORY, PURCHCOST, SELLCOST, INACTIVE)
    VALUES        (@ITEMCODE,@ITEMDESCRIPTION,@UNIT,@WHLOCATION,@VATID,@PREFSUPPLIER,@CATEGORY,@PURCHCOST,@SELLCOST,@INACTIVE)
    SQL Server Management Studio clearly shows the column as an Identity column. If I add a row through SSMS it does create an PK identity automatically. I have also dropped the ITEMID column & recreated through SSMS which has no effect.
    I am now considering creating a separate form just for adding an item but I have managed it in Access but am just struggling with VB!
    Thanks,
    James

  • Identity field in Oracle 11.2 with EF6

    Hi,
    I am in model first and I need to use Identity field to generate PK
    This is my code
    using (var ctx = new Model14Container())
    var newElem = ctx.Entity12.Add(new Entity12());
    ctx.SaveChanges();
    var elem = ctx.Entity12.FirstOrDefault();
    The Id is always 0. And I have a PK error the second time
    I use Generate Oracle Via T4 (TPT).xaml (VS) and SSDLToOracle.tt (VS) in VS2013 with ODP 12c release3
    The SQL code is generated without sequence
    I tried with Devart and I had no problem
    Thanks
    Romain

    I try the trial version of DevArt and this is the result
    -- This is auto-generated SQL script.
    -- This DDL was generated by 'Devart SSDLToOracle.tt' template.
    -- SQL is generated on: 01/23/2015 16:17:07
    -- Generated from EDMX file: c:\Model1.edmx
    -- Dropping existing foreign keys
    -- Dropping existing tables
    DROP TABLE "Entity1"
    DROP SEQUENCE "Entity1_SEQ"
    -- Creating all tables
    -- Table "Entity1"
    CREATE TABLE "Entity1"  (
        "Id" NUMBER(10) NOT NULL,
        PRIMARY KEY ("Id")
    CREATE SEQUENCE "Entity1_SEQ"
    CREATE OR REPLACE TRIGGER "Entity1_INS_TRG"
        BEFORE INSERT ON "Entity1" FOR EACH ROW
    BEGIN
        SELECT "Entity1_SEQ".NEXTVAL INTO :NEW."Id" FROM DUAL;
    END;
    And this is the SQL script generated by Oracle
    -- Entity Designer DDL Script for Oracle database
    -- Date Created: 1/23/2015 4:28:48 PM
    -- Generated from EDMX file: C:\Model1.edmx
    -- Dropping existing FOREIGN KEY constraints
    -- Dropping existing tables
    -- Creating all tables
    -- Creating table 'Entity1'
    CREATE TABLE "dbo"."Entity1" (
       "Id" NUMBER(10) NOT NULL
    -- Creating all PRIMARY KEY constraints
    -- Creating primary key on "Id"in table 'Entity1'
    ALTER TABLE "dbo"."Entity1"
    ADD CONSTRAINT "PK_Entity1"
       PRIMARY KEY ("Id" )
       ENABLE
       VALIDATE;
    -- Creating all FOREIGN KEY constraints
    -- Script has ended
    For both tests, I use the standard EMDX Designer
    You can see the diffrence: no "dbo", "/" instead of ";", SEQ created
    With DevArt, we have a real working Oracle SQL script
    All the code is in the .tt file
    Can you have the same result ?
    I am ready to test your fix
    Regards
    Romain

  • Using Identity Field in Entity Bean

    hi.....
    i am using Orion 2.0 with SQL Server 2000(professional) on Windows 2k...
    i got database with 10 tables...
    each table got an identity field where i am getting new value by database whenever i enter some data....
    now i don't have any access with the indentity field as it is totally managed by Database.....
    whenever i tried to set in ejb-jar.xml the column name,...while intestion ..it is giving me insert error as i don't have any access to that field( indentity field)
    and if i don't mention primary key...as that field....there is error for deployment...saying that no primary key defined........or primary key is nullll.....
    and i need to use that indentity field....else i need to manage all the other insertion in BMP which i don't want to do...
    Pls help me asap
    THanks
    Aniruddha Navare
    [email protected]

    EJB doesn't support identity field. EJB expects you set primary key values explicitly. There is a well known pattern that makes use of a session bean to generate entity bean primary key. Your best option is to use BMP or give up auto increment identity fields.

  • DATE FIELD PROBLEMS - URGENT

    I´m having trouble with FormsCentral.
    My form is running about 8 months with no problems.
    Yesterday people started to complain that the system doesn´t accept any date.
    That means the date field restricts date entries, from date dd/mm/aaaa (brazilian format) to another dd/mm/aaaa, but every date that users input in, is considered by the system as invalid, even it´s a correct and valid date right between the interval specified!
    I need Help Urgent!!!
    I depend on these forms to finish the payrol service from here.
    Thanks
    I´ll be waiting.
    Maurício Galletti
    Message was edited by: SNOWMAUSS
    It look like the system accepts just dates starting from the date of today.
    I´m testing.
    Please help.
    Thanks
    Message was edited by: SNOWMAUSS
    It looks like the system have some problem just with the date 20/10/2013?!
    I´ve fixed the problem change the interval from 20/10/2013 to another date  and used  21/10/2013 to another date and it works!
    But I think something is wrong with the 20/10/2013 date?!
    To reproduce the erros just create a new form with date feature with this exaclty configurations and the bug appears:
    I´ll keep waiting
    Message was edited by: SNOWMAUSS

    Hi
    I´ve concluded that the problem persist if the date interval starts at the
    specific date "20/10/2013". Don´t know why?!
    Look at the screen capture above, you aks for
    Thanks a lot
    image: Imagem inline 1
    Maurício P. Galletti
    Contador
    [email protected]
    ( 55 11 3331-5567
    www.cadt.com.br
    2013/10/29 Genevieve Laroche <[email protected]>
       Re: DATE FIELD PROBLEMS - URGENT  created by Genevieve Laroche<http://forums.adobe.com/people/Genevieve+Laroche>in
    FormsCentral - View the full discussion<http://forums.adobe.com/message/5797083#5797083

  • ISE - EAP-FAST PAC Provisioning - Identity field??

    Hi all, very simple question regarding the fields in the PAC provisioning section of ISE. Basically wondering what the "identity" field under machine and tunnel PAC is meant to be? I am currently planning an EAP-FAST deployment and this is the only area I am wondering about. Essentially planning to auto-provision the PAC hopefully using authenticate in-band. The Cisco doco is a little vague on this particular field.
    Thanks in advance - have googled this for a day or so and frankly cannot find the information that I want.

    Use
    PAC
    •Tunnel PAC Time To Live—The Time to Live (TTL) value restricts the lifetime of the PAC. Specify the lifetime value and units. The default is 90 days. The range is between 1 and 1825 days.
    •Proactive PAC Update When: of PAC TTL is Left—The Update value ensures that the client has a valid PAC. Cisco ISE initiates an update after the first successful authentication but before the expiration time that is set by the TTL. The update value is a percentage of the remaining time in the TTL. The default is 90%.
    •Allow Anonymous In-band PAC Provisioning—Check this check box for Cisco ISE to establish a secure anonymous TLS handshake with the client and provision it with a PAC by using phase zero of EAP-FAST with EAP-MSCHAPv2. To enable anonymous PAC provisioning, you must choose both of the inner methods, EAP-MSCHAPv2 and EAP-GTC.
    •Allow Authenticated In-band PAC Provisioning—Cisco ISE uses SSL server-side authentication to provision the client with a PAC during phase zero of EAP-FAST. This option is more secure than anonymous provisioning but requires that a server certificate and a trusted root CA be installed on Cisco ISE.
    When you check this option, you can configure Cisco ISE to return an Access-Accept message to the client after successful authenticated PAC provisioning.
    –Server Returns Access Accept After Authenticated Provisioning—Check this check box if you want Cisco ISE to return an access-accept package after authenticated PAC provisioning.
    •Allow Machine Authentication—Check this check box for Cisco ISE to provision an end-user client with a machine PAC and perform machine authentication (for end-user clients who do not have the machine credentials). The machine PAC can be provisioned to the client by request (in-band) or by the administrator (out-of-band). When Cisco ISE receives a valid machine PAC from the end-user client, the machine identity details are extracted from the PAC and verified in the Cisco ISE external identity source. Cisco ISE only supports Active Directory as an external identity source for machine authentication. After these details are correctly verified, no further authentication is performed.
    When you check this option, you can enter a value for the amount of time that a machine PAC is acceptable for use. When Cisco ISE receives an expired machine PAC, it automatically reprovisions the end-user client with a new machine PAC (without waiting for a new machine PAC request from the end-user client).
    •Enable Stateless Session Resume—Check this check box for Cisco ISE to provision authorization PACs for EAP-FAST clients and always perform phase two of EAP-FAST (default = enabled).
    Uncheck this check box in the following cases:
    –If you do not want Cisco ISE to provision authorization PACs for EAP-FAST clients
    –To always perform phase two of EAP-FAST
    When you check this option, you can enter the authorization period of the user authorization PAC. After this period, the PAC expires. When Cisco ISE receives an expired authorization PAC, it performs phase two EAP-FAST authentication.
    •Preferred EAP Protocol—Check this check box to choose your preferred EAP protocols from any of the following options: EAP-FAST, PEAP, LEAP, EAP-TLS, and EAP-MD5. By default, LEAP is the preferred protocol to use if you do not enable this field.

  • Utilizing auto-increment/identity fields for primary key with "application" identity

    Is it possible to utilise an auto-increment (identity in MS SQL Server)
    field for the primary key field when using "application" identity?

    To the best of my knowledge, you cannot use auto-increment. Due to the
    differences in the way that identities are generated at the datastore
    (upon insert) vs. JDO (upon makePersistent), this feature of SQLServer is
    not supported yet.
    However, we do provide a variety of other ways of generating identity
    which may provide a closer fit to what you want, and
    our users may have some experience in solving your problem.
    On Tue, 28 Jan 2003 09:56:08 +0000, Sean Ryan wrote:
    Is it possible to utilise an auto-increment (identity in MS SQL Server)
    field for the primary key field when using "application" identity?--
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

  • Table Control Text  fields problem , help plz

    Hello Anand , Rich , John & All
      I hav problem with Text 3 fields( type c)(either L or R aligned )  , it is not geting updated , otherwise everything else is perfectly fine(scrolling,sorting etc ....) .
    Fields giving problem are
    1. Status(20) type c
    2. Fdat  type date
    3. Remark(100) type c
    All numerical fields are working fine .
    <u><b> My yahoo messenger-id is [email protected]</b></u>
    <b>Any light on this will be awarded plz .</b>
    FLOW LOGIC
    PROCESS BEFORE OUTPUT.
    MODULE SET_STATUS.
    LOOP AT      ITAB
          WITH    CONTROL TCL1
          CURSOR  TCL1-CURRENT_LINE .
       MODULE SET_LINE_COUNT .
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE UPD_OK_COD.
    MODULE EXIT_COMAND AT EXIT-COMMAND.
    MODULE SCROLL_SORT.
    LOOP AT ITAB.
          MODULE UPDATE_ITAB.
    ENDLOOP.
    MODULE UPDATE_TABLE.
    REPORT ZSD_REP_ORDER_BANK_CHANGE NO STANDARD PAGE HEADING LINE-SIZE 255.
    TABLES: VBAK,VBAP,VBRK,ZSD_TABL_ORDBANK,MARA,KONV.
    CONTROLS: TCL1 TYPE TABLEVIEW USING SCREEN 0200.
    DATA: ITAB LIKE ZSD_TABL_ORDBANK OCCURS 0 WITH HEADER LINE,
          WA_ITAB LIKE ZSD_TABL_ORDBANK,
          OK_CODE LIKE SY-UCOMM,
          SAVE_OK_CODE LIKE SY-UCOMM,
          UPD_OK_CODE LIKE SY-UCOMM,
          ANSWER TYPE C,
          I LIKE SY-LOOPC ,
          J LIKE SY-LOOPC,
          V_LINES LIKE SY-LOOPC,
          LINE_COUNT LIKE SY-LOOPC,
          STS  TYPE N,
          EMGRP LIKE MARA-EXTWG,
          QTY LIKE ZSD_TABL_ORDBANK-QTY,
          UPRICE LIKE ZSD_TABL_ORDBANK-UPRICE,
          TOT LIKE ZSD_TABL_ORDBANK-TOT,
          INO LIKE VBAP-POSNR,
          COL TYPE CXTAB_COLUMN,
          COPIED_ONCE ,
          FLDNAME(100),HELP(100).
    FIELD-SYMBOLS:
         <FS_ITAB> LIKE LINE OF ITAB,
         <FS_TCL1> LIKE LINE OF TCL1-COLS.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
      SELECT-OPTIONS: S_CCODE FOR ZSD_TABL_ORDBANK-CCODE
                              NO INTERVALS NO-EXTENSION  OBLIGATORY,
                      S_SORG  FOR ZSD_TABL_ORDBANK-SORG
                              NO INTERVALS NO-EXTENSION  OBLIGATORY,
                      S_DCHAN FOR ZSD_TABL_ORDBANK-DISTCHAN,
                      S_DIV FOR ZSD_TABL_ORDBANK-DIV,
                      S_MATNO FOR ZSD_TABL_ORDBANK-MATNO,
                      S_CUSTNO FOR ZSD_TABL_ORDBANK-CUSTNO ,
                      S_QTNO FOR ZSD_TABL_ORDBANK-QTNO,
                      S_QTDAT FOR ZSD_TABL_ORDBANK-QTDAT,
                      S_QTVDAT FOR ZSD_TABL_ORDBANK-QTVALDAT,
                      S_SONO   FOR ZSD_TABL_ORDBANK-SONO.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN.
       SELECT * FROM  ZSD_TABL_ORDBANK
                   INTO  TABLE ITAB
                   WHERE CCODE IN S_CCODE
                     AND SORG IN  S_SORG
                     AND DISTCHAN IN  S_DCHAN
                     AND DIV IN S_DIV
                     AND MATNO IN  S_MATNO
                     AND CUSTNO IN  S_CUSTNO
                     AND QTNO IN  S_QTNO
                     AND QTDAT IN  S_QTDAT
                     AND QTVALDAT IN  S_QTVDAT
                     AND SONO IN  S_SONO .
          IF SY-SUBRC EQ 0.
             REFRESH ITAB.
             CLEAR COPIED_ONCE.
             CALL SCREEN 0200.
          ELSE.
             MESSAGE E012(ZQOTBANK) .
          ENDIF.
    *&      Module  SET_STATUS  OUTPUT
    *       text
    MODULE SET_STATUS OUTPUT.
      SET PF-STATUS '0200'.
      SET TITLEBAR '0200'.
        IF COPIED_ONCE IS INITIAL.
          SELECT * FROM  ZSD_TABL_ORDBANK
                   INTO  TABLE ITAB
                   WHERE CCODE IN S_CCODE
                     AND SORG IN  S_SORG
                     AND DISTCHAN IN  S_DCHAN
                     AND DIV IN S_DIV
                     AND MATNO IN  S_MATNO
                     AND CUSTNO IN  S_CUSTNO
                     AND QTNO IN  S_QTNO
                     AND QTDAT IN  S_QTDAT
                     AND QTVALDAT IN  S_QTVDAT
                     AND SONO IN  S_SONO .
          IF SY-SUBRC EQ 0.
            DESCRIBE TABLE ITAB LINES V_LINES.
            TCL1-LINES = V_LINES.
          ENDIF.
          COPIED_ONCE = 'X'.
          REFRESH CONTROL 'TCL1' FROM SCREEN '0200'.
       ENDIF.
          LOOP AT ITAB.
             QTY = ITAB-QTY.
             UPRICE  = ITAB-UPRICE.
             TOT = QTY * UPRICE .
             ITAB-TOT = TOT .
             CLEAR: QTY, UPRICE, TOT.
             QTY = ITAB-CGL_QTY.
             UPRICE  = ITAB-CGL_UPRICE.
             TOT = QTY * UPRICE .
             ITAB-CGL_TOT = TOT .
             CLEAR: QTY, UPRICE, TOT.
             QTY = ITAB-BHEL_QTY.
             UPRICE  = ITAB-BHEL_UPRICE.
             TOT = QTY * UPRICE .
             ITAB-BHEL_TOT = TOT .
             CLEAR: QTY, UPRICE, TOT.
             QTY = ITAB-ALSTOM_QTY.
             UPRICE  = ITAB-ALSTOM_UPRICE.
             TOT = QTY * UPRICE .
             ITAB-ALSTOM_TOT = TOT .
             CLEAR: QTY, UPRICE, TOT.
             QTY = ITAB-SIEMENS_QTY.
             UPRICE  = ITAB-SIEMENS_UPRICE.
             TOT = QTY * UPRICE .
             ITAB-SIEMENS_TOT = TOT .
             CLEAR: QTY, UPRICE, TOT.
             QTY = ITAB-TELK_QTY.
             UPRICE  = ITAB-TELK_UPRICE.
             TOT = QTY * UPRICE .
             ITAB-TELK_TOT = TOT .
             CLEAR: QTY, UPRICE, TOT.
             QTY = ITAB-OTH_QTY.
             UPRICE  = ITAB-OTH_UPRICE.
             TOT = QTY * UPRICE .
             ITAB-OTH_TOT = TOT .
             CLEAR: QTY, UPRICE, TOT.
             MODIFY ITAB.
          ENDLOOP.
    ENDMODULE.                 " SET_STATUS  OUTPUT
    *&      Module  SET_LINE_COUNT  INPUT
    *       text
    MODULE SET_LINE_COUNT OUTPUT.
      LINE_COUNT = SY-LOOPC.
    ENDMODULE.                 " SET_LINE_COUNT  INPUT
    *&      Module  UPD_OK_CODE  INPUT
    *       text
    MODULE UPD_OK_COD INPUT.
    IF OK_CODE = 'SAVE'.
        UPD_OK_CODE = OK_CODE.
    *    CLEAR OK_CODE.
    ENDIF.
    ENDMODULE.                 " UPD_OK_CODE  INPUT
    *&      Module  EXIT_COMAND  INPUT
    *       text
    MODULE EXIT_COMAND INPUT.
    SAVE_OK_CODE = OK_CODE.
    CLEAR OK_CODE.
    CASE SAVE_OK_CODE.
        WHEN 'BACK'.
          CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
              TITLEBAR       = 'Order Bank Entry'
              TEXT_QUESTION  = 'Do you want to Go BacK ?'
              TEXT_BUTTON_1  = 'Yes'
              TEXT_BUTTON_2  = 'No'
              DEFAULT_BUTTON = '2'
            IMPORTING
              ANSWER         = ANSWER.
          IF ANSWER = '1'.
            LEAVE TO SCREEN 0.
          ELSE.
          ENDIF.
        WHEN '%EX'.
          CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
              TITLEBAR       = 'Order Bank Entry'
              TEXT_QUESTION  = 'Do you want to Exit ?'
              TEXT_BUTTON_1  = 'Yes'
              TEXT_BUTTON_2  = 'No'
              DEFAULT_BUTTON = '2'
            IMPORTING
              ANSWER         = ANSWER.
          IF ANSWER = '1'.
            LEAVE TO SCREEN 0.
          ELSE.
          ENDIF.
      ENDCASE.
    ENDMODULE.                 " EXIT_COMAND  INPUT
    *&      Module  UPDATE_MOD  INPUT
    *       text
    MODULE UPDATE_ITAB INPUT.
        MODIFY TABLE ITAB FROM ITAB.
    ENDMODULE.                 " UPDATE_MOD  INPUT
    *&      Module SCROLL INPUT
    *       text
    MODULE SCROLL_SORT INPUT.
    SAVE_OK_CODE = OK_CODE.
    CLEAR OK_CODE.
    CASE SAVE_OK_CODE.
      WHEN 'P--'.
          TCL1-TOP_LINE = 1.
      WHEN 'P-'.
          TCL1-TOP_LINE = TCL1-TOP_LINE - LINE_COUNT.
          IF TCL1-TOP_LINE LE 0.
             TCL1-TOP_LINE = 1.
          ENDIF.
      WHEN 'P+'.
          I = TCL1-TOP_LINE + LINE_COUNT.
          J = TCL1-LINES - LINE_COUNT + 1.
          IF J LE 0.
             J = 1.
          ENDIF.
          IF I LE J.
             TCL1-TOP_LINE = I.
          ELSE.
             TCL1-TOP_LINE = J.
          ENDIF.
      WHEN 'P++'.
          TCL1-TOP_LINE = TCL1-LINES - LINE_COUNT + 1.
          IF TCL1-TOP_LINE LE 0.
              TCL1-TOP_LINE = 1.
          ENDIF.
      WHEN 'SORTUP'.
          READ TABLE TCL1-COLS ASSIGNING <FS_TCL1> WITH KEY SELECTED = 'X'.
          IF SY-SUBRC = 0.
              SPLIT <FS_TCL1>-SCREEN-NAME AT '-' INTO HELP FLDNAME.
              SORT ITAB ASCENDING BY (FLDNAME).
          ENDIF.
      WHEN 'SORTDN'.
          READ TABLE TCL1-COLS ASSIGNING <FS_TCL1> WITH KEY SELECTED = 'X'.
          IF SY-SUBRC = 0.
              SPLIT <FS_TCL1>-SCREEN-NAME AT '-' INTO HELP FLDNAME.
              SORT ITAB DESCENDING BY (FLDNAME).
          ENDIF.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND  INPUT
    *&      Module  TABL_UPD  INPUT
    *       text
      MODULE UPDATE_TABLE INPUT.
       CASE UPD_OK_CODE.
       WHEN 'SAVE'.
         UPDATE ZSD_TABL_ORDBANK FROM TABLE ITAB .
         IF SY-SUBRC EQ 0.
             MESSAGE I002(ZQOTBANK) .
             CLEAR  UPD_OK_CODE.
         ELSE.
             MESSAGE E003(ZQOTBANK) .
         ENDIF.
       ENDCASE.
      ENDMODULE.                 " TABL_UPD  INPUT
    Thnx
    moni<b></b><b></b>
    Message was edited by: md monirujjaman
    Message was edited by: md monirujjaman

    Hi Moni,
    The problem as I had replied in your earlier post is with the MODIFY statement.
    MODIFY TABLE ITAB FROM ITAB. This statement will do the modifications based on the table key. When you have character fields as editable, then some problems are to be anticipated. In such a scenario, you must update the internal table based on the <i>index</i>, rather than based on <i>key</i>.
    So consider using
    MODIFY ITAB FROM ITAB INDEX TCL-CURRENT_LINE.
    Where TCL is the name of the Table Control. Also observe the difference in syntax here, don't use the TABLE keyword for the MODIFY statement.
    Please try it out and let me know.
    Regards,
    Anand Mandalika.

  • Selection screen field problem

    Hello experts..
    i have a selection screen , in that i have a field   s_bwart for mseg-bwart.
    some times the user will input the data in the field and sometimes he wont. we have fixed movement types combination like
    11-21 , 13-24 , 13-56 , 101-543 , 101-544 etc.
    if the user did not input any thing in the selection screen , i am populating s_bwart in at-selection screen event with all the mvt types. after executing the report when user presses the back button to come to the selection screen, there the s_bwart field is containing all the mvt types in single values ie in the select options screen. So the user dont want that, if he comes back nothing should be there in the selection screen field s_bwart if he has not inputted anything. if he inputs only 11 mvt type then when he comes back after executing the report he should see only 11 in the select screen field ie s_bwart. Please send the replies on how to solve the problem.

    hi,
    in ur program try to display values for users in START-OF-SELECTION event as it triggers after the selection screen displayed for users. if user doesn't give any input then display default values in this event. and also create a variable
    for ex:
    data: ws_flag type c,
             p_value type i.
    after u display default values for users in selection screen assign the flag as ' X '
    ws_flag = 'X'.
    before leaving ur program based on flag try to do like this.
    if ws_flag = ' X '.
        clear s_data. // s_data is the select options for u.
    else.
         s_data = p_value. // the value which user gave in selection screen as i/p.
    endif.
    if helpful reward some points.
    with regards,
    Suresh Aluri.

  • J1inqefile - Excel output - Date field problem

    Dear All,
           I am facing a problem while executing the tcode-J1IEQEFILE.
           When choosing excel file output and executing, 3 files are created. But the problem is, the value of date field in one of the files is not in date format.
        Please help me out on this regard.
    Thank you,
    S.Sridhar

    I am also facing same problem in text file as well as in Excel file also. kindly some one could help me ( Date on which Amount paid  and Date on which tax deducted).
    Thanks
    Venkat

  • Table Input Field Problem

    Hi All,
    I am facing a problem now where table row height is too big , as in 1 row size is actually a merged of 2 rows, the input field is shifted to the bottom of the cell.  And when you select the row, an asterik is visible at the bottom row, and the input field is shifted up to the top of the cell. I am using customized iterator and cl_crm_ic_inputfield to render the cell. Anyone have this problem before?
    Thanks!
    Cheers,
    cady

    Hi Guys,
    Some additional info i found on this issue. I am using design2003. I realized that the * added meant that its required field. However, upon further checking, when calling method RENDER_DESIGN2003 in class cl_crm_ic_inputfield, it checkes for me->required is not initial, which is kind of odd since the required field has the initial value of 'FALSE'. So , either required = 'TRUE' or 'FALSE', it will always be required field. Anyone encountered such problem before?
    Cheers,
    cady

  • DATE field problem in JSF code

    Hi,
    I am a newbie on JSF and working with a JSF application development. I have a problem with a data type: DATE. Here is what had happened; I tried to write a new record to a table, in my "write" paragraphs I have the following codes:
    tabelOneDataProvider.setValue("joindate", rowKey, joinDate1.getSelectedDate());
    tableOneDataProvider.commitChanges();
    The problem is when I was running the program to write a record, I got the following error:
    Cannot append new tableOne data: java.lang.RuntimeException: Number of conflicts while synchronizing: 1 SyncResolver.INSERT_ROW_CONFLICT row 1 Can't infer the SQL type to use for an instance of java.util.Date. Use setObject() with an explicit Types value to specify the type to use.
    At that point, I was trying to write a DATE value from a "calendar' component (joinDate1 field with MM/dd/yyyy format) into a field name: "joindate' (data type is DATE) in tableOne file.
    Any advice on resolving this problem? Please help me to get more knowledge on this. Thanks!

    Hi,
    You must use sql type. So instead of:
    tabelOneDataProvider.setValue("joindate", rowKey, joinDate1.getSelectedDate());
    tableOneDataProvider.commitChanges();try something like:
    java.util.Date date = joinDate1.getSelectedDate();
    java.sql.Date dateToInsert = new java.sql.Date(date.getTime());
    tabelOneDataProvider.setValue("joindate", rowKey, dateToInsert);
    tableOneDataProvider.commitChanges();best regards
    Grzegorz

  • Extraction from SAP, hidden fields problem

    Hi Expeerts,
    I have the following problem / question:
    From an SAP Datasource (2lis_11_vaitm) we have some fileds, those are HIDED, and we need them. This is a central SAP, and a lot of BW systems connect to this SAP.
    The problem is, that we need a field from that datasource (and other BWs do not need), that has 'HIDDEN' option. The SAP side is afraid of having problem, when they just uncheck that option. (TELF1; KONDA fields we need).
    Does anyone know, what is the affects on other BW systems, when we unhide this fields? Of course we load with delta from this source.
    If a field is hidden in SBIW-Maintain Datasources, am I right, that the delta does not collect those fields, or it is collected, just not sent to BW systems?
    Any good idea, how can we get that fields in other way, because it seems, that the datasource cannot be modifyed, because of the other countries' BWs, connected to teh centra SAP.
    I hope i were clear, but if not, please ask me.
    Thanks for Your help.
    Laszlo
    Edited by: László Györkös on Jan 30, 2009 11:07 AM

    Hi,
    If a field is hidden in SBIW-Maintain Datasources, am I right, that the delta does not collect those fields, or it is collected, just not sent to BW systems?
    --> As hidden fields are already available in extract strucute, unhiding will not create any problem. As far as i know hidden means it will transfer data from extract structure to further.
    --> You can try pulling this particular data using generic datasource. OR
    --> Enhance datasource by adding required fields and use. OR
    --> Unhide files and use.
    Note: Bit careful while transpporting datasource to production as time stamp changes.
    Srini

  • Display total of contents of 'fields a' for records that have identical 'fields b' in common

    Please forgive me for my inability to put this in simple
    terms. I tried to search the forums for a solution but when you
    can't formulate your question in a pithy manner it's nigh
    impossible!
    I am attaching code for a query that grabs all the records in
    a few tables that relate to workshops that have been attended but
    not yet paid for. What I want to do with them next is to add the
    "WorkshopCost" field for each of the records that has an identical
    "SchoolName" and display the result, so that we have a subtotal for
    each school.
    I suspect this should probably be very easy but for some
    reason I can't figure out how it should be accomplished - if there
    is another posting where this is answered I would be very happy is
    someone would point it out! or otherwise give me a shove in the
    right direction.
    I'm thinking I need to do something with the array created by
    my query...?

    If I am understanding correctly, you would like to display a
    subtotal for each school. A simple option is to use the "group"
    attribute of cfquery. Then you could calculate the subtotal as you
    loop through the results and display it after each section. Another
    option is to use a QoQ.
    Keep in mind that when using "group", your sql query
    must order the results the same way. In other words, if you
    are grouping by "s_SchoolName" then your query must also ORDER BY
    s_SchoolName. Otherwise, the results will display incorrectly.

Maybe you are looking for