2011 Oct 19 4:23 PM
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
2011 Oct 20 5:07 AM
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
2011 Oct 19 5:31 PM
2011 Oct 20 4:50 AM
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
2011 Oct 20 4:57 AM
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.
2011 Oct 20 5:07 AM
hi,
you should try even create entry if you want to validate the entries.
2011 Oct 20 5:59 AM
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
2011 Oct 20 6:06 AM
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
2011 Nov 16 12:05 PM
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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |