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

Error messages shown outside the view/table.

0 Likes
1,430

Hi People,

I have created a view & added an event 'Before saving the data' to it. So when we enter data into the view & try to save it, it will trigger the event & that will call a function module, which will check if the user entries are correct, If the entries are incorrect then i am showing an error message. The problem is, this error message is shown outside the view maintenence screen but inside the sm30 transaction! then I have to navigate back to my view maintenence screen. Kindly guide me on how to avoid this & make the error message appear in the same view maintenence screen.

Thanks & Regards,

Deepak

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,157

hi,

you should try even create entry if you want to validate the entries.

Hi People,

I have created a view & added an event 'Before saving the data' to it. So when we enter data into the view & try to save it, it will trigger the event & that will call a function module, which will check if the user entries are correct, If the entries are incorrect then i am showing an error message. The problem is, this error message is shown outside the view maintenence screen but inside the sm30 transaction! then I have to navigate back to my view maintenence screen. Kindly guide me on how to avoid this & make the error message appear in the same view maintenence screen.

Thanks & Regards,

Deepak

7 REPLIES 7
Read only

Former Member
0 Likes
1,157

Code the validation in the event 05.

Read only

0 Likes
1,157

Hi Suman,

The event '05' stands for 'After saving data to the database' in view cluster & 'creating a new entry' in the view. So are you suggesting me to use the event for view cluster or view?

Regards,

Deepak

Read only

lijisusan_mathews
Active Contributor
0 Likes
1,157

You could try this method even though it is not highly recommended as recreation of this table maintenance generator will delete this code.. :

Take the man program that is generated and take the flow logic for that particular screen

Now take the Flow Logic

there will be a field statement for your particular field for which you need to check.

Write a module XXXX on request .. against that field. Here if you do teh coding, it will stop at exactly that field.

Read only

Former Member
0 Likes
1,158

hi,

you should try even create entry if you want to validate the entries.

Read only

0 Likes
1,157

Hi,

I have now used the event '05' For new entries. I am able to validate the entries, & show the error messages for invalid entry. Now when I enter valid input, still the vent is triggered & it shows me the error message. I am using the following code

FORM CHECK_BEFORE_SAVE.

DATA: wa_total(1000) TYPE c.

DATA: BEGIN OF ls_total,

mandt type mandt,

FUNCTIONAL_ID type /PRA/RESP_FUNC_AREAS,

HIER_ID type /PRA/HIER_ID,

DESCRIPTION type /PRA/HIER_DESC,

CHANGE_FLAG type boolean,

END OF ls_total.

LOOP AT TOTAL INTO wa_total.

ls_total = wa_total.

IF ls_total-functional_id IS INITIAL.

MESSAGE E208(00) WITH 'Functional Area cannot be empty'.

ENDIF.

ENDLOOP.

ENDFORM.

I see that when i enter the valid entry & this event is triggered, The global table for view TOTAL is not refreshed with new values & hence I still get the error. How do i refresh this TOTAL table?

Regards,

Deepak

Read only

0 Likes
1,157

hi,

why you are looping the table?

whenever user will create entry and press enter that time this event should trigger and you will get the entries in corresponding fields of z table.

please refer the following link for your clarity.

http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=93454609

Read only

0 Likes
1,157

Thank you all for the suggestions, all i need to do was display the message as status eg.

MESSAGE s001(<message_class>) DISPLAY LIKE 'E',

this solves the problem.