Skip to Content
author's profile photo
Former Member

doubt in DELETE

Hi all.

I have internal table ,it has few fileds like

vbeln TYPE likp-vbeln,

kunnr TYPE likp-kunnr,

tknum TYPE vttk-tknum,

daten TYPE vttk-daten,

now it has values.i need to delete record which one have "tknum" is blank in this internal table.

please help me.

To be reward all helpfull answers.

Jay

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

9 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 12:39 PM

    hi,

    <b>DELETE ITAB WHERE tknum IS INITIAL.</b>

    With Rgds,

    S.Barani

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2007 at 12:39 PM

    loop at itab.

    if itab-tknum is initial.

    delete itab index sy-tabix.

    endif.

    endloop.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 12:39 PM

    Hi,

    Use below syntax to delete records..

    DELETE ITAB WHERE TKNUM = ' '.

    Regards,

    Sankar

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 12:43 PM

    delete * from itab where tknum = ' '.

    regards,

    srinivas

    <b>*reward for useful answers*</b>

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 12:46 PM

    Hi,

    Try This.

    DATA: BEGIN OF itab OCCURS 0,

    vbeln LIKE likp-vbeln,

    kunnr LIKE likp-kunnr,

    tknum LIKE vttk-tknum,

    daten LIKE vttk-daten,

    END OF itab.

    itab-vbeln = '12222'.

    itab-kunnr = '1224'.

    itab-tknum = ''.

    itab-daten = ''.

    APPEND itab.

    itab-vbeln = '12223'.

    itab-kunnr = '1223'.

    itab-tknum = 'abc'.

    itab-daten = 23082007.

    APPEND itab.

    LOOP AT itab.

    DELETE itab WHERE tknum = ''.

    ENDLOOP.

    LOOP AT itab.

    WRITE:/ itab-vbeln ,itab-kunnr,itab-tknum,itab-daten.

    ENDLOOP.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 12:47 PM

    Hi Jay,

    Use like this.

    Loop at i_tab.

    if i_tab-tknum = space.

    delete i_tab.

    endif.

    endloop.

    regards

    Sourabh Verma

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 12:49 PM

    hi,

    to delete single record use

    delete itab where tknum = ' '.

    for no of records.

    loop at itab.

    if itab-tknum = ' '.

    delete itab-tknum.

    endif.

    endloop.

    if helpful reward some points.

    with regards,

    Suresh Aluri.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 01:12 PM

    Hello,

    Deleting from an Internal Table

    1. DELETE itab.

    2. DELETE TABLE itab WITH TABLE KEY k1 = v1 ... kn = vn.

    3. DELETE TABLE itab [FROM wa].

    4. DELETE itab INDEX idx.

    5. DELETE itab FROM idx1 TO idx2.

    6. DELETE itab WHERE logexp.

    7. DELETE ADJACENT DUPLICATES FROM itab.

    You can use these methods according to your need.

    eg: delete itab where tknum = ' '.

    regards,

    LIJO

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 01:16 PM

    Hi Jay,

    <b>DELETE <INTERNAL-TABLE NAME> WHERE TKNUM = SPACE.

    Reward points if this helps,</b>

    Kiran

    Add comment
    10|10000 characters needed characters exceeded