2007 Sep 20 6:23 AM
HI all,
I have to validate the 'Todate' field in ztable. Validation is Todate should be greater than 'Fromdate'.
For this i have written some code in maintainance event (05-New entries).It is working fine.See the code below.
----
***INCLUDE LZKM0007F01 .
----
FORM AT_NEWENTRY.
IF ZKM0007-ZTO_DATE LT ZKM0007-ZFROM_DATE.
MESSAGE E001(ZKM) WITH 'ENTER TODATE GREATER THAN FROMDATE'.
ENDIF.
ENDFORM.
If i enter the 'Todate' less than 'fromdate' it is showing an error massege. After showing the error message these two fields are greyed out(disabled). But it should not happened. I want error message and i want to change (or correct) the 'Todate' here itself instead of cancelling and re entering the record line totally.
Rewards to all.
Thanks,
Anu.
HI all,
I have to validate the 'Todate' field in ztable. Validation is Todate should be greater than 'Fromdate'.
For this i have written some code in maintainance event (05-New entries).It is working fine.See the code below.
----
***INCLUDE LZKM0007F01 .
----
FORM AT_NEWENTRY.
IF ZKM0007-ZTO_DATE LT ZKM0007-ZFROM_DATE.
MESSAGE E001(ZKM) WITH 'ENTER TODATE GREATER THAN FROMDATE'.
ENDIF.
ENDFORM.
If i enter the 'Todate' less than 'fromdate' it is showing an error massege. After showing the error message these two fields are greyed out(disabled). But it should not happened. I want error message and i want to change (or correct) the 'Todate' here itself instead of cancelling and re entering the record line totally.
Rewards to all.
Thanks,
Anu.
2007 Sep 20 6:29 AM
Hi anupama,
Please do the following,
FORM AT_NEWENTRY.
IF ZKM0007-ZTO_DATE LT ZKM0007-ZFROM_DATE.
MESSAGE<b> I001</b>(ZKM) WITH 'ENTER TODATE GREATER THAN FROMDATE'.
<b>EXIT.</b>
ENDIF.
ENDFORM.
change error to information message and write..exit after that..which will bring you back to the same screen
Pls check and revert
Regards
Byju
2007 Sep 20 9:27 AM
Hi,
I have already tried this. It shows only information.If we forgot to change the date, then it saves in database. It allow to save. so i want to display error message.
Is it possible with error message?
Thanks
Anu.
2007 Sep 21 4:53 AM
Issuing an "E" type message is the correct way to proceed, I reckon... look at one of the SAP events that does a similar validation e.g. view V_WOSCR_GRP_003 has an event '05' called "validate_account" in (include LWOST_CR_IMG01FNG)... it issues "E" messages (with some amusing comments too).
An "E" message in a table control would normally lock all the rows other than the current one... but if fields on the current (exception) row are getting locked, have a look at the screen flow - in the PAI there should be a " LOOP AT EXTRACT." followed by a "CHAIN." and then all the fields to keep open on the row in case of error and "module set_update_flag"... check the ones you want are there, as I think that's where your event will be called.
Jonathan
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |