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: 

Fetching the values

Former Member
0 Kudos
176

Hi,

In my coding have written a select query after that based on some cond have deleted the vendors.Now after deleting the vendors i need to know the wat details have been deleted.How to identify it

1 ACCEPTED SOLUTION

I355602
Product and Topic Expert
Product and Topic Expert
0 Kudos
158

Hi,

Use this code:-


loop at itab where <condition>. "loop at internal table
  MOVE : itab-field1 to it_temp-field1, "move records to temp table
         itab-field2 to it_temp-field2. "similarly move other records
  append it_temp. "append in temp

  delete itab. "delete from itab internal table

  clear itab.
  clear it_temp.
endloop.

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

9 REPLIES 9

Former Member
0 Kudos
158

Hi,

The delete query you are returning will be returning a subrc value. So after using the query, Check the value of sy-subrc.

IF SY_SUBRC EQ 0. means it was successful.

Also SY-DBCNT gives the number of records deleted.

Hope this helps.

Regards,

Deepthi.

Edited by: Deepthi S on Feb 3, 2009 3:48 PM

Former Member
0 Kudos
158

Hi,

Before deleting, pass the the lines of itab to a temp table inside the loop.

After coming out of the loop read the temp table and get the details.

Thanks,

Vivekanand

Former Member
0 Kudos
158

Hi,

Why don't keep the information in another internal tables which you are going to delete.

IT1

Ex: Vendor Name

100 A

200 B

if you are going to delete B then keep it away from IT1 to IT2.Further you can access IT2.

-Rick

GauthamV
Active Contributor
0 Kudos
158

Before deleting those vendors move that data to another internal table and

display the same after deleting.

Former Member
0 Kudos
158

HI

To know the what details have been deleted , you can use debugging ,

Before and after the delete statement just check the values in that table on which you are applying delete.

OR

keep the information in another internal tables which you are going to delete and after delete just compare

REGARDS

RAHUL

Edited by: RAHUL SHARMA on Feb 3, 2009 11:22 AM

Former Member
0 Kudos
158

hi,

move the data to be deleted to another internal table.

Former Member
0 Kudos
158

Hi,

Create one temp internal table.

pass the data in temp on the where condition those you want to delete

Now delete the record from the main table .

Check the deleted record from the temp table.

To check every time with new record clear the temp table.

after reading

Hope it will help you.

Thanks

Arun kayal

I355602
Product and Topic Expert
Product and Topic Expert
0 Kudos
159

Hi,

Use this code:-


loop at itab where <condition>. "loop at internal table
  MOVE : itab-field1 to it_temp-field1, "move records to temp table
         itab-field2 to it_temp-field2. "similarly move other records
  append it_temp. "append in temp

  delete itab. "delete from itab internal table

  clear itab.
  clear it_temp.
endloop.

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

Former Member
0 Kudos
158

Hi,

After delete perform write sy-subrc =0 then move to that record to other internal table and append that data in to that Itab. finally you can use Reuse_Alv_grid_display.

Regards

Md.MahaboobKhan