2004 Nov 04 11:19 AM
I am using this user exit in transaction XD02 (customer..) and there is a user exit check before saving.
If there is an error, how should I popup this message in user exit?
I saw a function module which the same transaction is using MESSAGE_STORE. Can I use this function module ? Is there any setting that I need to do in SPRO for message collection ?
Regards,
Subramanian V.
2004 Nov 04 4:28 PM
This program example shows how to display messages in a message popup using function modules of function group SMSG. It's quite simple.
Good luck
Volker
DATA: BEGIN OF lt_nachrichten OCCURS 0,
arbgb LIKE smesg-arbgb,
msgty LIKE smesg-msgty,
msgv1(50),
msgv2(50),
msgv3(50),
msgv4(50),
txtnr(03),
END OF lt_nachrichten.
*...Activate Message-Handler
CALL FUNCTION 'MESSAGES_INITIALIZE'.
*...Store message
LOOP AT lt_nachrichten.
CALL FUNCTION 'MESSAGE_STORE'
EXPORTING
arbgb = lt_nachrichten-arbgb
msgty = lt_nachrichten-msgty
msgv1 = lt_nachrichten-msgv1
msgv2 = lt_nachrichten-msgv2
msgv3 = lt_nachrichten-msgv3
msgv4 = lt_nachrichten-msgv4
txtnr = lt_nachrichten-txtnr.
ENDLOOP.
*...Display messages
CALL FUNCTION 'MESSAGES_SHOW'
EXPORTING
object = 'Error messages'
EXCEPTIONS
inconsistent_range = 1
no_messages = 2
OTHERS = 3.
I am using this user exit in transaction XD02 (customer..) and there is a user exit check before saving.
If there is an error, how should I popup this message in user exit?
I saw a function module which the same transaction is using MESSAGE_STORE. Can I use this function module ? Is there any setting that I need to do in SPRO for message collection ?
Regards,
Subramanian V.
2004 Nov 04 11:29 AM
Hi Subramanian,
As far as I know the only way to generate a message in this exit is using MESSAGE (if you want to prevent the customer is saved) of a FM like POPUP_TO_INFORM if it's only informational.
Regards,
John.
2004 Nov 04 12:03 PM
Hi John,
Thanks for your reply, but I am not sure whether it will work, but I will definitely give it a shot.
In ME21N transaction, I had used an user exit and even there the messages were stacked up and on clicking the save button, SAP automatically showed all the messages. I can't recollect which function module I had used(then I didn't have that excel sheet). It used to show 3 error messages, 4 warnings. So similarly, I am looking for a function module which is being used by XD02 for stacking up messages and showing them in final display.
Regards,
Subramanian V.
2004 Nov 04 12:22 PM
Hi Subramanian,
In ME21N the functions MESSAGE_STORE (to store messages in global table) and MESSAGES_SHOW are used. But as far as I'm aware of this functionality is not used (yet?) for customer maintenance.
Regards,
John.
2004 Nov 04 4:44 PM
Not all application is using the message store. To check whether that application is using it, put a break-point in those message function modules. Execute your application and generate some errors. See whether it stop in that function.
If that application is not using similar message storing technique, you might want to popup the error message in that user exit, then call back that transaction and skip the initial screen.
2004 Nov 04 4:28 PM
This program example shows how to display messages in a message popup using function modules of function group SMSG. It's quite simple.
Good luck
Volker
DATA: BEGIN OF lt_nachrichten OCCURS 0,
arbgb LIKE smesg-arbgb,
msgty LIKE smesg-msgty,
msgv1(50),
msgv2(50),
msgv3(50),
msgv4(50),
txtnr(03),
END OF lt_nachrichten.
*...Activate Message-Handler
CALL FUNCTION 'MESSAGES_INITIALIZE'.
*...Store message
LOOP AT lt_nachrichten.
CALL FUNCTION 'MESSAGE_STORE'
EXPORTING
arbgb = lt_nachrichten-arbgb
msgty = lt_nachrichten-msgty
msgv1 = lt_nachrichten-msgv1
msgv2 = lt_nachrichten-msgv2
msgv3 = lt_nachrichten-msgv3
msgv4 = lt_nachrichten-msgv4
txtnr = lt_nachrichten-txtnr.
ENDLOOP.
*...Display messages
CALL FUNCTION 'MESSAGES_SHOW'
EXPORTING
object = 'Error messages'
EXCEPTIONS
inconsistent_range = 1
no_messages = 2
OTHERS = 3.
2004 Nov 05 9:22 AM
Thanks a lot all.
Problem was solved incredibly easily.
All I need to write is :
MESSAGE E563(F2) with 'my message'.
Regards,
Subramanian V.
2004 Nov 05 9:48 AM
Hi Subramanian,
Would like to give points regarding to SDN customs.
You can give points by clicking to the yellow star icon at the header of each post. By this way, you can give;
-one 10 points (solved)
-two 6 points (very helpful answer)
-many 2 points (helpful answer)
Thanks...
John.
2004 Nov 05 10:15 AM
John, I do understand about the points, and I never forget to give points. I have given points to every answer. I am always reminded of Mark Finnern's weblog about 'Good Karma'.
Regards,
Subramanian V.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |