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: 

Integrity check on a table maintenance view (SM30)

gastn_jareo
Active Participant
0 Kudos

I have a zheader table and a zlines table. The zlines has a relation with zheader. Field 'Check required' is checked, 'Key-fields/candidates selected, and a cardinality of 1:CN with zheader. All the primary key of zheader is fully determined by fields of zlines.

I created table maintenance views for both of them to allow the user maintain them by SM30. Now you can't create on zlines a record with no relation to one header on zheader. But if you have a header with lines on SM30 you can delete zheader record without problem. Table zlines remains with his lines but no header stays on zheader.

I want to avoid this behavior. Any sugestion?

Thanks!

Note: The SAP version is 4.7

Edited by: Gastón Jareño on Sep 15, 2008 2:32 PM

1 ACCEPTED SOLUTION

alejandro_bindi
Active Contributor
0 Kudos

You probably have to code Events to implement such checks yourself:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20im...

Regards

3 REPLIES 3

alejandro_bindi
Active Contributor
0 Kudos

You probably have to code Events to implement such checks yourself:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20im...

Regards

0 Kudos

It appears to be usefull... but the document is not detailed enough.

On my example I should use the event 03 - "Before deleting the data displayed" to check if there are still lines. In this case I should give a message and avoid the data save. I'm trying to do this with a message type E but the message is shown once, and again, and again... in an endless loop. Do you know how to do it properly?

And as I can see there are some internal tables with important data, like total or extract. But you know how may I realise wich lines are selected when user press delete button? Remember that a user can delete more than one line each time.

Thanks again!

0 Kudos

I solved the problem with event 03 with the folowing documentation [http://help.sap.com//saphelp_470/helpdata/EN/a7/5133ac407a11d1893b0000e8323c4f/frameset.htm]

I made a LOOP on EXTRACT and checking <XMARK>. For every line marked with M on <XMARK> I check if there are any line on other table and if it's the case I give a message type w and I clear <XMARK> and updated EXTRACT to avoid deleting.

I used a type W message to avoid the error loop I mentioned before.

Thanks!