Application Development and Automation 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: 
Read only

show error message in smartforms

former_member185116
Active Participant
0 Likes
2,272

Hello all,

my requirement is to throw an error in smartforms(i.e in flow logic->program lines),

for this i have written a code like below,

if lv_tbft is INITIAL.

  CALL FUNCTION 'SSF_MESSAGE'
  EXPORTING
    I_MSGID       = '00'
    I_MSGTY       = 'E'
    I_MSGNO       = '5'
    I_MSGV1       = 'No data Exists'
*   I_MSGV2       =

*   I_MSGV3       =

*   I_MSGV4       =
    .

endif.

i have declared a custom exception MY_ERROR in driver program as well as exception tab in smartform.(as suggested in some threads),

how ever the error message is not getting displayed(only the smartform is not getting printed),

please can any one suggest where i am going wrong(my intention is to display the error 'No data exists' for the end user)..

thanks.

3 REPLIES 3
Read only

developerone
Contributor
0 Likes
1,302

You will have to raise this exception in the function module that is getting called

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,302
please can any one suggest where i am going wrong

The whole thing is wrong, sorry. There should be no error messages in the forms.

If there is any kind of exception then this must be handled in the program that calls the form before the form is called. Depending on what it is exactly, there are different ways to implement this. But overall that's the proper design.

If there is no data for the form to output, why are you even calling the form? Think about it.

Read only

former_member185116
Active Participant
0 Likes
1,302

Instead of showing error message in smartforms , i have tried to throw error message through driver program,

as suggested by experts..

thank you all for your valuable suggestions..

thread closed..