03-18-2009 2:43 AM
Hi,
How can I issue an error in the table maintenance event without exiting the screen.
When an event is triggered (Before Save), it will perform a check in the data changed or created. It will issue an error when the changes are not correct. But when I press enter or click on the check button, it will exit the table maintenance screen.
What do I have to do in order to issue an error but will still go back to the table maintenance view.
Making the message as information or type I, will not work because it will still save.
03-18-2009 3:11 AM
U can try this workaround, get the unchanged values in a temporary record and then whenever a warning message is issued just reassign these values back to the changed record.
Ok did u try setting sy-subrc value in ur code.
set sy-subrc like this
sy-subrc = 4
now issue ur message, this time it should not save
кu03B1ятu03B9к
Edited by: kartik tarla on Mar 18, 2009 8:42 AM
03-18-2009 2:51 AM
Hi,
When an event is triggered (Before Save), it will perform a check in the data changed or created. Issue the message as information or type I. Before issuing information message, use ROLLBACK statement. It will not commit the changes made to database. It will just throw pop-up message and will not save data.
IF error.
ROLLBACK.
message i000 with ''changes not saved'.
ENDIF.
Regards,
Sachin
03-18-2009 3:04 AM
Hi Thanks for the suggestion but ROLLBACK does not work, i've tried both ROLLBACK WORK and ROLLBACK CONNECTION con. and none of them worked.
03-18-2009 2:52 AM
Hi Dude,
Table Maintenance Generator Events:
Go through this Link:[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-8765287250fc]
03-18-2009 3:03 AM
From SAP Help:
All S, I and W messages are ignored in automatic adjustment. As view cluster event error messages must always be sent as S or I messages, the errors are not logged
[ More info>>>|https://help.sap.com/saphelp_nw04/helpdata/en/77/06b11859f511d2a6070000e82deaaa/frameset.htm]
[Sample code for Roll back>>>|http://abap-gallery.blogspot.com/2007/07/dynamic-table-maintenance.html]
03-18-2009 3:11 AM
U can try this workaround, get the unchanged values in a temporary record and then whenever a warning message is issued just reassign these values back to the changed record.
Ok did u try setting sy-subrc value in ur code.
set sy-subrc like this
sy-subrc = 4
now issue ur message, this time it should not save
кu03B1ятu03B9к
Edited by: kartik tarla on Mar 18, 2009 8:42 AM
03-18-2009 3:19 AM
IF v_flag EQ c_x. "It means there's an Error
MESSAGE text-002 TYPE 'S' DISPLAY LIKE 'E'.
ENDIF.
Making it as Type S does not work. It still saves.
But i'm considering to do what you've suggested. The work around.
But if there's an easier way, it's much appreciated.
03-18-2009 3:50 AM
Hi Al,
How are you? You can implement the check in the PAI of your table maintenance screen. Hope it helps....
Ex.
PROCESS AFTER INPUT.
CHAIN.
FIELD field_a.
FIELD field_b .
MODULE check_val ON CHAIN-REQUEST.
ENDCHAIN.
MODULE check_val.
IF field_a IS INITIAL
OR field_b IS INITIAL.
MESSAGE e398(00) WITH 'test'.
ENDIF.
ENDMODULE.
01-21-2014 1:57 PM
Hi,
I came to the same problem, maybe this will help someone.
You can move check into view cluster event.
1. load the view
PERFORM vcl_set_table_access_for_obj
USING 'view'
CHANGING error_flag.
2. assing to structure
LOOP AT <vcl_total> INTO ls_view
3. perform check, set VCL_STOP which will stop saving and will display message
VCL_STOP = 'X'.
MESSAGE ....