‎2009 Apr 29 3:52 PM
I have added the below code to event 01 (before save). But if I output an error message then I am taken out of the table maintenace. I just want to stop the data from being saved and allow the user to correct the data. I have tried an information message, but then the data is saved..
lit_notif[] = EXTRACT[].
* Loop around the Modifed entries only.
LOOP AT lit_notif INTO ls_notif.
* WHERE ENTRY = 'M'. "M not always left Aligned
* Ensure entry is left aligned
CONDENSE ls_notif-ENTRY.
* If the entry has been modified(delete) and is a 'C' reason code
IF ( ls_notif-ENTRY = 'U' OR ls_notif-ENTRY = 'N' ) AND
ls_notif-TAGEN > 0 AND
ls_notif-LTRUR > 0.
* Not allowed to populate both hours and days
MESSAGE E007(Z1) with ls_notif-KUNUM.
ELSEIF ( ls_notif-ENTRY = 'U' OR ls_notif-ENTRY = 'N' ) AND
ls_notif-TAGEN = 0 AND
ls_notif-LTRUR = 0.
* Must populate hours or days
MESSAGE E008(Z1) with ls_notif-KUNUM.
ENDIF.
MOVE-CORRESPONDING ls_notif TO ls_prior.
APPEND ls_prior TO lit_prior.
ENDLOOP.
‎2009 Apr 30 12:12 PM
Hi ,
Change the message type to S and set this parameter .
vim_abort_saving = 'X'.
Regards,
Deepthi
‎2009 Apr 29 3:57 PM
Hi,
Use message type 'S'
and write 'EXIT' immediately after the message
Regards
Krishna
‎2009 Apr 29 3:57 PM
Hi,
change the message type E to S and after message write exit command.
put the flag when ever message is triggeres and capture the message in one text..
after the loop.
check the flag and if it is not intial.
again show the message with s and exit.
regards,
prabhduas
‎2009 Apr 29 4:22 PM
I have treid the mnessage S and EXIT, but the message doesn't appear now, and the data saves...
‎2009 Apr 29 4:25 PM
yes it happens.
because you kept the exit inside the loop so it comes from the loop and it does not comes from the screen.
so catch the message in the loop and put in some text.
and outside the loop check the message if it is not initial then again write exit command.
then it will works.
regards,
Prabhudas
‎2009 Apr 29 4:43 PM
I've treid at at the end of the subroutine too, and still no joy???
‎2009 Apr 30 5:17 AM
Use warning Message 'W' instead of Error or any other message.
Or :
Use Information message and After that Use Check statement the later half of the code will not be executed.
This will resolve the issue.
Regards,
Gurpreet
‎2009 Apr 30 12:12 PM
Hi ,
Change the message type to S and set this parameter .
vim_abort_saving = 'X'.
Regards,
Deepthi