Skip to Content

Report to delete records...????

Hi...all...

Iam having one custom table... in that iam having records for 10 fields....

So now i hav to develop one report... in that selction i hav to maintain two key fields of that above table... if i give input to that two field and exucute the programmm the records in the table has to delete.. according to that in puts....

Thanks,

Naveen.I

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 09:15 AM

    hiiii

    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
    
    SELECT-OPTIONS s_matnr FOR mard-matnr OBLIGATORY.
    
    
    SELECTION-SCREEN END OF BLOCK a.
    
     SELECT *  FROM z_mara
          WHERE matnr IN s_matnr.
    
    
    delete * from z_mara where matnr IN s_matnr.

    reward if useful

    thx

    twinkal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 09:07 AM

    hi this can be done by giving the name of the field and the field value in the loop statement..

    loop at s_matnr.

    r_ranges-low = s_matnr-low.

    r_ranges-sign = s_matnr-sign.

    r_ranges-options = s_matnr-options.

    r_ranges-lhigh = s_matnr-high.

    append r_ranges.

    endloop.

    select * from mara into table itab where matnr in s_matnr .

    loop at itab .

    delete matnr where matnr in r_matnr .

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 09:15 AM

    HIiii

    select * from <dbtable> into table <itab> where <field> in <select-options>

    loop at <itab>.

    delete from <dbtab> where <field> = <itab-field>.

    endloop.

    regards

    chandu reddy

    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.