Application Development and Automation 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: 
Read only

Avoid from user to delete data in internal table inside view

Former Member
0 Likes
572

HI ,

i have a VIEW and i want to avoid from the user the option to delete specific combination for that in the view code i keep the table extract before the modify and after and then i have 2 internal tables one with original data and the second with data after modifying.

i give example.

Assume i want to avoid from the user to delete the combination a1 b1 c1 mail.

and the user mark the line in the view to delete, i see in second table that i get mark sign.

itab before

field1  field 2 field 3 description 
a1       a2        a3              mail
b1       b2        b3              notif
c1       c2        c3              mail  
d1       d2        d3              notif
a1       a2        a3              task
 f1       f2         f3               notif


 itab after

field1  field 2 field 3   description  mark
a1        a2         a3           mail  
b1        b2         b3           notif
c1        c2         c3           mail
d1        d2         d3           notif
a1        a2         a3           notif       M
 f1        f2          f3            task  

Another thing i want to give the user option to delete the combination just if in the table

there is no entry with the combination but different description i.e.

if in the table i have for the combination :

a1 a2 a3 mail

a1 a2 a3 notif

the user can't delete it.

but if he have in table just one entire like below with description mail :

a1 a2 a3 mail

he can delete it .

what is the best way to do that ?

Regards

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
541

Hi Michael,

The best thing to do is to use [table maintanance events|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc].

I think in your case you can use 03 event - Before deleting the data displayed. In the routine you just check appropriate conditions like if certain combinations of records exists.

This should help you

Marcin

3 REPLIES 3
Read only

MarcinPciak
Active Contributor
0 Likes
543

Hi Michael,

The best thing to do is to use [table maintanance events|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc].

I think in your case you can use 03 event - Before deleting the data displayed. In the routine you just check appropriate conditions like if certain combinations of records exists.

This should help you

Marcin

Read only

0 Likes
541

HI,

Thanks ,

What if the user Modify the combination and after that he push to delete it,

i want also to avoid that any idea?

u have idea how to do the loop i new to abap.

Best Regards

Read only

Former Member
0 Likes
541

Hi ,

Assume i want to do that in the screen (i don't want to use event for this issue) i need some help with the loop on the 2 table assume i have itab_before and itab_after,

i any appreciate help with that .

Best Regards

Michael A

Edited by: Michael A on Dec 31, 2008 7:59 AM