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: 

error-handling in form routines to be called from maintenance view

Former Member
0 Kudos

hello,

i have created a table maint. dialog. Under 'enviroment->modification->events' you can create form-routines for your own coding.

I have the maint.event '01 - Before saving the data in the database'. Here i do some checks if entered values in some fields are okay or not etc.....

When the users enters 'wrong' data i do a "message e000 with 'text' " So i got a error-message and the user is not able to save the data before changing it.

BUT: i get the right error-message in the status-line, but i got an EMPTY screen, all the fields disapear. I have to go back with enter or the red cancel button. But then i 'fall back' to the selection screen of the maint. view. Thats not very user-friendly.

Any ideas ?

6 REPLIES 6

Former Member
0 Kudos

Hi

Why don't use the event 05 for new entry?

Max

0 Kudos

hi max,

i ALSO use event 05. but event 05 is for creating a NEW entry in the database !! i make my checks there, and there it works right.

but i can't use the event 05 for changing data, right ? so i have to use the event 01.

regards, martin

Former Member
0 Kudos

Hi martin,

1. use different message types.

2. form mysave.

break-point.

if ZAM_TBL01-MATNR is initial.

message 'error ' type 'E'.

else.

message 'OK' type 'S'.

endif.

endform.

regards,

amit m.

0 Kudos

Amit,

i can see no difference between my error-handling and yours ?? I don't understand your posting

what do you mean by 'use different message types' ? i only can use 'E', as i DONT'T want the data to be saved !

Also you use type 'E'in your mysave-coding. So what do you want to explain to me ?

reg, martin

0 Kudos

Hi Martin

You can try to use the event 21 to fill the hide fields, infact I saw the SM30 triggers that event although it doesn't use hide fields.

Max

0 Kudos

hi,

think you have place your module not correct:

try that: (without event)

PROCESS AFTER INPUT.
...
  LOOP AT EXTRACT.
...
    FIELD VIM_MARKED MODULE LISTE_MARK_CHECKBOX.
    CHAIN.
      FIELD Y789.
      FIELD Y012.
      ...
      MODULE LISTE_UPDATE_LISTE.
    ENDCHAIN.
*begin of insertation
    CHAIN.
      FIELD Y123.
      FIELD Y456.
      module check_field  ON CHAIN-input.
    ENDCHAIN.
*end of insertation
  ENDLOOP.
...

Andreas