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: 

unable to edit validated field in table maintance

Former Member
0 Kudos

Hi all,

my requirement is to show an warning message on non key field if validation is not correct and edit on the same screen.

solution: I have created an event new-entry in table maintance and tried to validate that field field (email)

form new_entry.

if table-email na '@'.

message w001(incorrect email id)

endif.

enfdform.

- In this way it show the warning correctly but i am not able to edit that email field on the same screen.

do i need to validate in chain endchain. If yes how ??

Can anyone suggest the solution with demo code .

Thanks,

Aisha

5 REPLIES 5

awin_prabhu
Active Contributor
0 Kudos

Simple set sy-subrc some value after message statement and change message type as 'S' like below.


FORM new_entry.
  IF table-email NA '@'.
    MESSAGE s001(incorrect email id).  " Message type 'S' to stay in same screen
        sy-subrc = 1.  " Set some value other than zero to abort saving
  ENDIF.
ENDFORM.                    "new_entry

0 Kudos

this isssue is resolved . we need to valididate the field in chain endchain with module modulename and write the logic inside that.

not in the event new-entry.

Thanks,

Aisha

0 Kudos

Hi Aisha, thank you for the feedback. Could you set the thread as answered. Thanks!

Sandra

0 Kudos

no....never never put logic in a table maintance screen....if you make changes in your table y regenerate the table maintenance you will loose all the validations....

always use events..

regards, Sebastiá

0 Kudos

Sebastian is correct. Have a look at: [Custom Validation on Table Maintenance Generator (SM30)|http://musicodez.wordpress.com/2010/09/13/custom-validation-on-table-maintenance-generator-sm30/] to see how to handle this with events.

Rob