Skip to Content
author's profile photo Former Member
Former Member

Delete Itab where .........

Hi,

I want to delete an itab and the condition is the filed name TEXT first 2 char is ne select option and also not to delete if the first 2 char is 'GE'.so how to write the code in this condition.Pls help to solve this issue

Thanks,

Deesanth

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jun 19, 2008 at 05:42 AM

    Hi Deesanth,

    Here is the solution.

    
    Loop at itab.
     IF itab-text+0(2) NE  S_OPTION-LOW 
         or itab-text+0(2) GE  S_OPTION-LOW.
    
      Delete itab index sy-tabix.
    
     ENDIF.
    Endloop.
    
    

    &*******************Reward Point if helpful****************&

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 05:44 AM

    Hi,

    Try this.

    data : w_2(2) type c,

    index type sy-tabix.

    Loop at itab.

    index = sy-tabix.

    w_2 = itab-text + 0(2).

    If w_2 ne s_option-low and w_2 gt s_option-high.

    delete itab index index.

    endif.

    clear : w_2, index.

    endloop.

    Reward pts if useful.

    Regards,

    Dhan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 19, 2008 at 05:50 AM
    I want to delete an itab and the condition is the filed name TEXT first 2 char is ne select option and also not to delete if the first 2 char is 'GE'.so how to write the code in this condition.Pls help to solve this issue

    loop at itab into wa_itab.
    if text+0(2) eq 'GE' and text+0(2) in so_options.
    skip.
    else.
    delete itab index sy-tabix.
    endif.
    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2008 at 06:08 AM

    REPORT Z_DELETE.

    tables : vbap.

    types : begin of ty_vbap,

    vbeln type vbeln_va,

    posnr type posnr_va,

    matnr type matnr,

    end of ty_vbap.

    data : it_vbap type standard table of ty_vbap initial size 0,

    wa_vbap type ty_vbap.

    selection-screen : begin of block b1 with frame title text-001.

    select-options : s_vbeln for vbap-vbeln.

    selection-screen : end of block b1.

    start-of-selection.

    select vbeln

    posnr

    matnr

    from vbap

    into table it_vbap

    where vbeln in s_vbeln.

    if sy-subrc ne 0.

    • do nothing

    endif.

    delete it_vbap where ( vbeln0(2) ne s_vbeln ) and ( vbeln0(2) ge s_vbeln ).

    loop at it_vbap into wa_vbap.

    write : / wa_vbap-vbeln,

    wa_vbap-posnr,

    wa_vbap-matnr.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.