09-15-2008 7:24 PM
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
09-15-2008 7:35 PM
You probably have to code Events to implement such checks yourself:
Regards
09-15-2008 7:35 PM
You probably have to code Events to implement such checks yourself:
Regards
09-16-2008 1:36 PM
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!
09-16-2008 3:17 PM
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!