Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Report to delete records...????

naveen_inuganti2
Active Contributor
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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