Deleting a record in an internal table

hi,
  loop at itab,
   ..... if a particular record alone matches a condition then that particular record alone has to be deleted.
endloop.
only the particular record which matches the  condition inside the loop should be deleted. remaining records should be there in that internal table itself.
can anyone explain me how to do this.
Regards,
Phyrose.

hi,
u can specify the condition in th loop statement itself..
loop at itab where condition.
delete itab.  " itab - internal table with header line
endloop.
else if u want to specify it inside the loop..
loop at itab.
if condition.
delete itab.
endif.
endloop.
hope it answers ur requirement...
Regards,
Viji

Similar Messages

  • Deleting selected record in Dynamic Internal table

    Hi Friends,
    I want to delete selected row from a dynamic internal table. The selected entry should be deleted from Adobe and as well as Webdynpro abap.
    Kindly help me how to solve this problem.
    Thanks in advance.
    Regards,
    Phani.

    Hi Matthias,
    Thanks a lot for responding.
    In my adobe i kept a check box to delete the record. It should delete the selected ones. But right now, its deleting one by one.
    I have coded following script for delete button:
    IT_TIME_SHEET --> is my internal table
    G_ROW_STATUS is the field to track the action performed.
    var tlength = xfa.resolveNodes("IT_TIME_SHEET.DATA[*]").length;
    for ( var i=0; i<tlength; i++
    if(xfa.resolveNode("IT_TIME_SHEET.DATA["i"].FLAG").rawValue ==
    1 )
    IT_TIME_SHEET.DATA.instanceManager.removeInstance(i);
    G_ROW_STATUS.rawValue = "DELETE";
    In the Webdynpro abap following code I wrote:
        row_count = 1.
        FIELD-SYMBOLS <wa> TYPE zshr_time_sheet_time.
        LOOP AT it_time_sheet ASSIGNING <wa>.
          <wa>-srl_no = row_count.
          row_count = row_count + 1.
        ENDLOOP.
        last_row = <wa>-srl_no.
          DELETE it_time_sheet WHERE srl_no EQ last_row.
    Suppose if two records checkboxes are selected I can loop at the internal table IT_TIME_SHEET in webdynpro and delete where checkbox is selected.
    But problem is once user deletes records, adobe is deleting only one record and if i delete two records from webdynpro it looks like something wrong for the user.
    Please help me how to solve this problem.
    Regards,
    Phani.

  • How to delete records from dynamic internal table.

    Hi Experts,
    Need urgent help!!!
    Issue is with Dynamic internal tables.
    Below is code written by me :
    FORM select_query USING Lw_tabnam
                      TYPE  t682i-kotabnr.
      DATA :  lw_line  TYPE REF TO data,
              lw_line1 TYPE REF TO data.
        CREATE DATA Lw_line    TYPE (lw_TABNAM).
        ASSIGN      Lw_line->* TO   <WA_tbl>.
        CREATE DATA LW_LINE    TYPE STANDARD TABLE OF (Lw_tabnam)
                               WITH NON-UNIQUE DEFAULT KEY.
        ASSIGN      Lw_line->* TO <TBL>.
        SELECT * FROM  (Lw_tabnam)
                 INTO CORRESPONDING FIELDS OF TABLE <TBL>
                 WHERE (t_keys).
    Endform.
    code is working fine.
    here even the table name and where condition are dynamic,everything is fine upto this point.
    Now i have to delete some record from <TBL> based on some conditons.
         for ex : ( here lc_fieldname is KUNNR)
          loop at t_kunnr.
              lw_tabix = sy-tabix.
            Read table <tbl>
                    with key (lc_fieldname) = t_kunnr-kunnr ASSIGNING <wa_tbl>.
            If sy-subrc = 0.
            *Delete
            delete <tbl> from <wa_tbl>
    delete <tbl> index  lw_tabix.
            Endif.
         Endloop.
    The above delete statement doesn't work ,even we can't use index as it gives a syntax error " something related to "index is not allowed in standard table or hash table.
    Can you help me ab't how to delete records in Dynamic internal table?
    Other option that i am thinking of is to create a static table of type dynamic table.
    means, data itab type standard table of <tbl> .I know the syntax is wrong ,however is there any way to do this?
    Thanks in advance ,
    If you have any suggestion ab't this then do let me know.
    bye,
    Gaurav.

    Hi
    I wrote this code and it works fine:
    DATA LW_TABNAM(10) VALUE 'LFA1'.
    DATA : LW_LINES TYPE REF TO DATA,
           LW_LINE  TYPE REF TO DATA.
    FIELD-SYMBOLS: <TABLE> TYPE TABLE,
                   <WA>    TYPE ANY.
    CREATE DATA LW_LINES TYPE TABLE OF (LW_TABNAM)
    WITH NON-UNIQUE DEFAULT KEY.
    ASSIGN LW_LINES->* TO <TABLE>.
    CREATE DATA LW_LINE TYPE (LW_TABNAM).
    ASSIGN LW_LINE->* TO <WA>.
    DO 10 TIMES.
      APPEND INITIAL LINE TO <TABLE>.
    ENDDO.
    SY-TABIX = 4.
    DELETE <TABLE> INDEX SY-TABIX.
    WRITE SY-SUBRC.
    I hope it help you
    Max

  • Delete records in a internal table

    I Have an ALV in which I have selected several lines to delete (icon "-").
    The method get_selected_rows returns the index of the selected lines.
    In a loop I try to delete the lines of the internal table by the index. But I have a problem because when I delete a line, the index number is updated, therefore the second record that I try to delete doesn´t work because the index has changed.
    does there exist the possibility that the index is not updated?
    Thanks

    hi
    try to delete like this
    loop at itab
    delete itab                    
    endloop
    it deletes all the records in the internal table
    outside of the loop
    delete itab index 2   -
    > it deletes the record of index 2
    put it into the while or do while
    i =1.
    while i < 5
    i = i+ 1.
    delete itab index i.
    endwhile.
    it deletes 5 records in the internal table

  • Delete records in an internal table

    I uploaded the data incorrectly into a ztable .how can i delete all entries in a that table now. I am afraid the table gets deleted.

    Hi,
      you can delete the entries in the table by using DELETE command.
    1. DELETE FROM dbtab WHERE cond.
    DELETE FROM (dbtabname) WHERE cond.
    2. DELETE dbtab.
    DELETE *dbtab.
    DELETE (dbtabname) ...
    3. DELETE dbtab FROM TABLE itab.
    DELETE (dbtabname) FROM TABLE itab.
    4. DELETE dbtab VERSION vers.
    DELETE *dbtab VERSION vers.
    Effect
    Deletes lines from a database table(see Relational Databases ). You can specify thename of the database table either in the program itself with DELETEFROM dbtab ... or at runtime as the contents of the fielddbtabname with DELETE FROM (dbtabname) .... In bothcases, the database table must be known to the ABAP Dictionary.Only data from the current client is usually deleted. You can deletedata using a view only if the view refers to a singletable and was created in the ABAP Dictionary with themaintenance status "No restriction".
    DELETE belongs to the Open SQLcommand set.
    Notes
    The DELETE statement does not performauthorization checks. You must programthese yourself.
    The final (irrevocable) deletion of lines with the DELETEstatement is not performed until after a database commit (seeLogical Unit of Work (LUW)). Prior to this,you can reverse any database update with a database rollback (seeProgramming Transactions).
    You cannot rely exclusively on the locking mechanism of the database system to synchronize several users trying toaccess the same dataset at the same time. You should therefore use theSAP locking mechanism.
    <b>Variant 1</b>
    DELETE FROM dbtab WHERE cond.
    DELETE FROM (dbtabname) WHERE cond.
    Addition:
    ... CLIENT SPECIFIED
    Effect
    Deletes lines in a database table that satisfy the WHERE clause cond. With thisvariant, specification of a WHERE condition is obligatory .
    When the statement has been executed, the system field SY-DBCNTcontains the number of deleted lines.
    The return code is set as follows:
    SY-SUBRC = 0:
    At least one line was deleted.
    SY-SUBRC = 4:
    No lines were deleted, since no line was selected.
    Example
    Delete all bookings for the Lufthansa flight 0400 on02.28.1995 (in the current client):
    TABLES SBOOK.
    DELETE FROM SBOOK WHERE CARRID = 'LH'       AND
                            CONNID = '0400'     AND
                            FLDATE = '19950228'.
    Note
    To delete all the lines in a table, you must specify aWHERE condition that is true for all lines. You can achieve thiswith
    ... WHERE f IN itab
    If the internal table itab is empty, such a condition wouldselect all lines.
    Addition
    ... CLIENT SPECIFIED
    Effect
    Switches off automatic client handling. This allows youto delete data across all clients in the case of client-specifictables. The client field is then treated like a normal table field, forwhich you can formulate suitable conditions in the WHERE clause.
    You must specify the addition CLIENT SPECIFIED immediately afterthe name of the database table.
    <b>Variant 2</b>
    DELETE dbtab.
    DELETE *dbtab.
    DELETE (dbtabname) ...
    Additions:
    1. ... FROM wa
    2. ... CLIENT SPECIFIED
    See Short forms not allowed and* work areas not allowed.
    Effect
    These are SAP-specific short forms used to deleteone line of a database table. If the name of the database tableis specified in the program, the primary key ofthe line to be deleted is taken from the specified work area -dbtab or *dbtab. If the name of the database table is notdetermined until runtime ( DELETE (dbtabname) ...), the addition... FROM wa is obligatory .
    When the statement has been executed, the system field SY-DBCNTcontains the number of deleted lines (0 or 1).
    The return code is set as follows:
    SY-SUBRC = 0:
    The line was deleted.
    SY-SUBRC = 4:
    No lines could be deleted, since no line exists withthe primary key specified.
    Example
    Delete the booking with the booking number 3 for theLufthansa flight 0400 on 28.02.1995 (in the current client):
    TABLES SBOOK.
    SBOOK-CARRID = 'LH'.
    SBOOK-CONNID = '0400'.
    SBOOK-FLDATE = '19950228'.
    SBOOK-BOOKID = '00000003'.
    DELETE  SBOOK.
    Addition 1
    ... FROM wa
    Effect
    Takes the primary key for the line to be deleted notfrom the table work area dbtab, but from the explicitlyspecified work area wa. Here, the key values from left to rightare taken from wa according to the structure of the primarykey in the table work area dbtab (see TABLES). The structure of wa is not taken intoaccount. Therefore, the work area wa must be at least as wide(see DATA) as the primary key in thetable work area dbtab and the alignment ofthe work area wa must correspond to the alignment of the primarykey in the table work area. Otherwise, you get a runtime error.
    Note
    If a work area is not explicitly specified, the values forthe line to be deleted are taken from the table work area dbtab,even if the statement appears in a subroutine (see FORM) or function module (see FUNCTION) where the table work area is stored in a formalparameter or a local variable of the same name.
    Addition 2
    ... CLIENT SPECIFIED
    Effect
    As with variant 1.
    <b>Variant 3</b>
    DELETE dbtab FROM TABLE itab.
    DELETE (dbtabname) FROM TABLE itab.
    Addition:
    ... CLIENT SPECIFIED
    Effect
    Mass deletion: Deletes all database table lines forwhich the internal table itab contains values for theprimary key fields. The lines of the internaltable itab must satisfy the same condition as the work areawa in addition 1 to variant 2.
    The system field SY-DBCNT contains the number of deleted lines,i.e. the number of lines of the internal table itab for whosekey values there were lines in the database table dbtab.
    The return code is set as follows:
    SY-SUBRC = 0:
    All lines from itab could be used to deletelines from dbtab.
    SY-SUBRC = 4:
    For at least one line of the internal table in thedatabase table, there was no line with the same primary key. All foundlines are deleted.
    Note
    If the internal table itab is empty, SY-SUBRC and SY-DBCNT are set to 0.
    Addition
    ... CLIENT SPECIFIED
    <b>
    Effect</b>
    As with variant 1.
    <b>Variant 4</b>
    DELETE dbtab VERSION vers.
    DELETE *dbtab VERSION vers.
    This variant is not allowed in an ABAP Objectscontext. See VERSION addition not allowed.
    <b>Note</b>
    This variant is now obsolete, since variants 1 - 3 allowyou to specify the database table name dynamically.
    <b>Effect</b>
    Deletes a line in a database table, the name of which istaken from the field vers at runtime. The database table must beknown to the ABAP Dictionary and its name must conform to thefollowing naming convention: It must begin with 'T' and canconsist of four additional characters. The field vers mustcontain the table name without a leading 'T'. Only lines in thecurrent client are deleted. The line to be deleted is taken from thestatically specified table work area dbtab or *dbtab.
    The return code is set as follows: SY-SUBRC = 0:
    The line was deleted.
    SY-SUBRC = 4:
    No lines could be deleted because no line existedwith the specified primary key.
    Regards,
    Vara

  • Count the Records in  an internal table without a loop.

    How do i count the number of records in an internal table without using the loop  statement.
    The Describe statement give the total no. of records in the internal table.But i want the count of the key fields in the internal table
    For eg
    Row Field
    1       A
    2       A
    3       A
    4       B
    5       B
    6       C
    Count of A = 3
    Count of B = 2
    Count of C = 1

    Dilip,
      I think isn't posible. Only 3 ideas:
    1ª, make other table "table2", similar to your actual table.
         table2[] = yourtable[].
         delete table2 where key <> 'A'.
         describe table table2 lines contA.
        But depending the amount of data, you may have problems in performance or memory consumption...
    2ª, make other table, only with the keys fields and a count field,
        data begin table2
           key_field1,
           cont type i.
        end data.
       when you append lines to yourdata, make a collect to this table:
        table2-keys = yourtable-keys.
        table2-cont = 1.
       collect table2.
       But only works if you can modify the program where data is appended, and you may be carefull when data is deleted :-(...
    3ª if your data if filled in a select, you may fill the table2 of point 2ª, making a similar select but:
       select keyfields count( * ) into table table2
      from ...
      where (the same you have to fill your original table...)
       group by keys.
    But you have the same problem is data is deleted later...
    I hope that any of the three is useful for you...
    Edited by: Diego Alvarez on Jan 5, 2010 5:09 PM

  • @Inserting Records in an Internal Table

    Hi,
    How can I Insert records in an internal table..such that i can insert the records somewhere in the middle based on the entry in a field?

    INSERT wa INTO TABLE itab INDEX idx .
    Effect
    This variant can only be used for standard tables and sorted tables. Each line line_spec to be inserted into the line before the table index idx and the table index of the following lines is increased by one. A data object of the type i is expected for idx.
    If idx contains a value equal to the number of the existing table lines plus one, the new line is appended as the last line in the internal table. If idx contains a greater value, no line is inserted and sy-subrc is set to 4.
    An exception that cannot be handled is raised when:
    idx contains a value less than or equal to 0
    A line to be inserted would cause a duplicate entry in tables with a unique table key
    A line to be inserted would disrupt the sort order of sorted tables
    Within a LOOP loop, you can omit the addition INDEX. Each line to be inserted is inserted before the current table line of the LOOP loop. However, if the current line is deleted in the same loop pass, the response is undefined.

  • To count number of records in an internal table for a condition

    Hello All,
            I want to count number of records in an internal table for a condition.
    For e.g. -- I have one internal table IT which having fields F1, F2, F3, F4, F5.
                     Now, I want number of records in itnternal table IT where F1 = 'ABC'.
    Is it possible to do..?? If yes, then how.??
    Thanks in advance...!!
    Regards,
    Poonam.

    Hi,
    If you mean an internal table, there are a few ways to do this.
    1 One would be to loop over the table with a WHERE clause and increment a counter.
    data: lv_counter type i.
    clear lv_counter.
    loop at itab where fld1 = 'ABC'.
    lv_counter = lv_counter + 1.
    endloop.
    lv_counter now has the number of rows per the condiction.
    2  Well, you may want to try this as well, and compare to the LOOP way. Not sure what kind of overhead you may get doing this way. Here ITAB is our main internal table, and ITAB_TMP is a copy of it. Again I think there may be some overhead in doing the copy. Next, delete out all records which are the reverse of your condition. Then whatever is left is the rows that you want to count. Then simply do a LINES operator on the internal table, passing the number of lines to LV_COUNT.
    data: itab type table of ttab.
    data: itab_tmp type table of ttab.
    itab_tmp[] = itab[].
    delete table itab_tmp where fld1  'ABC'.
    lv_count = lines( itab_tmp ).
    Thanks & Regards,
    ShreeMohan

  • Records in an internal table

    Hi,
    How to check if all the records in an internal table are identical.
    could you help soon

    Hi,
    use the code,
    data : begin of itab occurs 0,
              matnr like mara-matnr,
              maktx like makt-maktx.
              end of itab.
    parameters : p_matnr like mara-matnr.
    start-of-selection.
    select * from makt into corresponding fields of table itab
                                where  matnr = p_matnr.
    delete adjacent duplicates from itab comparing matnr.
    if sy-subrc eq 0.
    write : /1 'Entries are identical.' .
    endif.
    Regards,
    Sankar.

  • Filtering records from one internal table based on ranges in another itab

    Hi guys,
    I have 1 internal table with set of GL accounts. I have 2nd internal table where lower interval  and upper interval of GL accounts
    How to filter out records from 1 internal table by comparing with the GL account ranges present in 2nd internal table.
    Please reply.

    Hi
    Create a RANGE for GL Accounts.
    LOOP the second Internal Table.
    And assign HIGH & LOW to ranges from second ITAB.
    And Delete the accounts which are not there in the range.
    Use the below code as reference.
    DATA: itab TYPE TABLE OF mara WITH HEADER LINE.
    DATA: r_matnr TYPE RANGE OF matnr WITH HEADER LINE.
      SELECT * FROM mara INTO TABLE itab UP TO 10 ROWS.
      r_matnr-sign = 'I'.
      r_matnr-option = 'BT'.
      r_matnr-low  = '000000000016900036'.
      r_matnr-high = '000000000016900040'.
      APPEND r_matnr.
      DELETE itab WHERE matnr NOT IN r_matnr.

  • Maximum record length in internal table?

    Is there a maximum record length in an internal table?  Please note:  My question is NOT related to table space.  I'm referring only to the length of an individual record (A.K.A. row length).
    I am using a work area to insert data into an internal table.  Both the work area and internal table are defined by the same structure.
    The structure has a total length of 672 bytes.  For the sake of this discussion I'll point out that at the end of the structure, bytes 669, 670, 671, and 672 are four separate fields of 1 character each.
    When viewing the work area record in the debugger I'm seeing all the fields and all the values.  When viewing the internal table in the debugger after a record is inserted, the internal table ends with the field defined at Byte 670.  The internal table does not include the two fields defined at Bytes 671 and 672.
    Am I to assume from the above explanation that the length of a record ( A.K.A. row) in an internal table cannot exceed 670 bytes?
    Thank you.

    Manish,
    False alarm!  While, technically, you didn't answer my question, your request for code ended up helping me answer my own question.
    To provide you with some code I wrote a simple test program using the record layout referred to above, with a DO loop to put some records into the internal table, followed by a LOOP AT, with accompanying WRITE statements to display the contents of the internal table and demonstrate that the last two fields weren't being stored.
    However, when I ran the test program, the last two fields were being displayed.
    It was at that point, when stepping through the debugger that I noticed the scroll arrows above the last column of my internal table that allowed me to scroll to the right and see my final two fields.
    Apparently, because of the large number of fields in my internal table I had reached the default display length of the debugger.  While I was obviously aware of the scroll bar found at the bottom of the display, I had never worked with an internal table of that width in the past and hadn't even noticed the scroll arrows above the last column before.
    Thanks for taking the time to respond helping me get to the solution.

  • Spilt the number of records in a internal table

    Hi all,
            I have a requirement where i must spilt the number of records in my internal table itab .Say if i have 2000 records , i must spilt it taking the first 990 records and doing some posting using Bapi and again take the next 990 records and do the posting .Can some one help me out.
    Good answers will be rewarded with points.

    Hi,
    You can use these instructions using two internal tables, but please be aware to not forget any line.
    REFRESH my_table2.
    APPEND LINES OF my_table FROM 1 TO 990 TO my_table2.
    CALL FUNCTION 'BAPI'....
                 (with my_table2)
    REFRESH my_table2.
    APPEND LINES OF my_table FROM 991 TO my_table2.
    CALL FUNCTION 'BAPI'....
                 (with my_table2)
    Regards,
    Mathieu

  • Count number of records in a internal table

    hi
    i want to count number of records in internal table
    pls let me know how to count the number of records in a internal table.
    regards
    Arora

    hi
    one way is
    data field type i.
    Decribe table itab lines field.
    write: / field.
    displays the no of records in tha internal table
    or if u want to write logic.
    data:
      w_count type i.
    loop at itab.
    w_count = w_count + 1.
    endloop.
    write: / w_count.
    displays the no of records.
    reward points if useful.

  • Summarizing records in a internal table

    hi
    what is meant by summarizing records in an internal table
    vamsi

    HI
    please go through this:
    u will get some idea.
    Appending Summarized Lines
    The following statement allows you to summate entries in an internal table:
    COLLECT <wa> INTO <itab>.
    <itab> must have a flat line type, and all of the fields that are not part of the table key must have
    a numeric type (F, I, or P). You specify the line that you want to add in a work area that is
    compatible with the line type.
    When the line is inserted, the system checks whether there is already a table entry that matches
    the key. If there is no corresponding entry already in the table, the COLLECT statement has the
    same effect as inserting the new line [Page 282]. If an entry with the same key already exists, the
    COLLECT statement does not append a new line, but adds the contents of the numeric fields in
    the work area to the contents of the numeric fields in the existing entry.
    You should only use the COLLECT statement if you want to create summarized tables. If you
    use other statements to insert table entries, you may end up with duplicate entries.
    Lines are added to internal tables as follows:
      Standard tables
    If the COLLECT statement is the first statement to fill the standard table, the system
    creates a temporary hash administration that identifies existing entries in the table. The
    hash administration is retained until another statement changes the contents of key fields
    or changes the sequence of the lines in the internal table. After this, the system finds
    existing entries using a linear search. The runtime for this operation increases in linear
    relation to the number of existing table entries. The system field SY-TABIX contains the
    index of the line inserted or modified in the COLLECT statement.
      Sorted tables
    The system uses a binary search to locate existing lines. The runtime for the operation
    increases logarithmically with the number of existing lines. The system field SY-TABIX
    contains the index of the line inserted or modified in the COLLECT statement.
      Hashed tables
    The system finds existing lines using the hash algorithm of the internal table. After the
    COLLECT statement, the system field SY-TABIX has the value 0, since hashed tables
    have no linear index.
    Example
    DATA: BEGIN OF LINE,
    COL1(3) TYPE C,
    COL2(2) TYPE N,
    COL3 TYPE I,
    END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE
    WITH NON-UNIQUE KEY COL1 COL2.
    BC - ABAP Programming SAP AG
    Appending Summarized Lines
    286 April 2001
    LINE-COL1 = 'abc'. LINE-COL2 = '12'. LINE-COL3 = 3.
    COLLECT LINE INTO ITAB.
    WRITE / SY-TABIX.
    LINE-COL1 = 'def'. LINE-COL2 = '34'. LINE-COL3 = 5.
    COLLECT LINE INTO ITAB.
    WRITE / SY-TABIX.
    LINE-COL1 = 'abc'. LINE-COL2 = '12'. LINE-COL3 = 7.
    COLLECT LINE INTO ITAB.
    WRITE / SY-TABIX.
    LOOP AT ITAB INTO LINE.
    WRITE: / LINE-COL1, LINE-COL2, LINE-COL3.
    ENDLOOP.
    Thanks
    Shiva

  • Record count in internal table

    i want to know record count for the records stored in
    internal table.
    do we have any system field to display record count?

    Hi,
    Try this:
    Data: count_lines type i.
    describe table my_table lines count_lines.
    Regards,
    Arjan

Maybe you are looking for

  • Logon fail when creating Connection in Crystal Reports SP3

    Greetings, I am working on an issue where we have installed the SAP GUI 7.10, Crystal reports 2008 SP3, and SAP IK FP 3.1. We are testing the access to ECC.  We have setup the server in the GUI and can successfully logon to the server in the GUI.  We

  • Disable updates of deleted apps

    How do I disable updates on deleted, inappropriate apps (17+) downloaded by my kid?  He deleted them but they come back in updates.  I understand they can't come off history but how can we get rid of them for good?

  • OFF TOPIC: Mac Pro fried 2 system drives.

    Sorry to post this in this forum but I find the other forums to be fairly unhelpful. My Mac Pro tower fried my system drive (or it died) so I broke out my backup system drive. After that failed to mount I restarted using the option key. I found the s

  • When I call out which number do they see?

    I have an online number for my german friends w/o skype to call me. If I call them from my online number on skype, will they see my german Online Number in their caller ID when I call them?

  • Java.lang.Integer defaulting to zero

    I am using JAXB for several years, but never dived into details. I am not using a schema. When I am unmarshalling a XML file, JAXB always defaults my java.lang.Integer attributes to zero instead to null, when the attribute is not given in the XML fil