Raising error messages in user exit..
hi,
i have my code in sales order user exit FORM USEREXIT_SAVE_DOCUMENT.
the code needs to check for a condition and if that fails i do not want to allow the user to save the sales order, rather do the change as i expect.
i can display the message using my message class, right ? but then how to prevent further action of saving the sales order ?
thks
After you give the error message, set the FCODE to 'ENT1'.
Like:
message e398(00) with
'Some error occured. Press enter.'.
fcode = 'ENT1'.
Regards,
Naimesh Patel
Similar Messages
-
How to raise error message in substitution exits?
Hello Experts,
How to raise error message in substitution exits. I have tried with normal statement,
Message 'Welcome!!' type E.
But its inot stopped at that error message, Its goes next standard code and picked other messag and shown as error message.
Th exit seems U100, I that I want to stop by using error message based on some condition. Please throw the answer quicklyHI Sanjana,
In the Substitution exits you can create the message in the configuration it self.
You dont't need raise message explicitly.
Thanks, -
Custom error message in user exit is giving Short dump
Hi All,
We have a scenario where in if any user try to create/Change/Delete particular types of contract in SAP system we have to issue error message
saying ZIN/ZIR contract creation/Change/Deletion is blocked in SAP. This has to be done from the web application. So we are putting below code
in user exit MV45AFZZ in the form USEREXIT_SAVE_DOCUMENT_PREPARE.
CONSTANTS: lc_vbcpic01 TYPE sy-uname VALUE u2018VBCPIC01u2019, u201CWeb application user ID
lc_zin TYPE vbak-auart VALUE u2018ZINu2019,
lc_zir TYPE vbak-auart VALUE u2018ZIRu2019,
lc_text(32) TYPE c VALUE u2018Check long text for more detailsu2019.
DATA: l_uname TYPE sy-uname.
CLEAR: l_uname.
MOVE sy-uname TO l_uname.
*If user ID is not the Web application ID then block the creation/Change/Deletion
IF l_uname NE lc_vbcpic01
AND ( vbak-auart EQ lc_zin
OR vbak-auart EQ lc_zir ).
MESSAGE e830(zv) WITH lc_text.
ENDIF.
This code is working fine while creating/Changing the contract i.e. Giving us error message so that user wonu2019t be able to create/change the contract.
But when we delete the contract from VA42, Control is coming to this message statement and is giving Short dump. Below is the error analysis of the dump.
Error Analysis:
During "Exit Command" processing, the program tried to send a " " message.
This is not allowed at this point in processing.
The program had to be terminated.
Screen name.............. "SAPMV45A"
Screen number............ 4001
If any one has come across such scenario/any work around for this problem please let me know your inputs. Your inputs are highly appreciated.
I am working on 4.6C version of SAP.
Note: When i issue information/Warning message contract is getting deleted after displaying the message.
Thanks,
Vinod.I exactly replicated the same in DELETE_DOCUMENT also
I am getting the Dump. I tried with exit also , but it continued and deleted. To avoid deletion we have to use Leave program or LEAVE TO CURRENT TRANSACTION.
Delete Function is Defined as EXIT command. so it is not possible to give error message. To convice you i just copied demo program and raised the error message.
it is also giving the dump.
copy the demo program DEMO_DYNPRO_AT_EXIT_COMMAND and make this change , information to error .
MODULE cancel INPUT.
MESSAGE e888(sabapdocu) WITH text-001 ok_code input1 input2.
IF ok_code = 'CANCEL'.
CLEAR ok_code.
LEAVE PROGRAM.
ENDIF.
ENDMODULE.
and see... -
Error Message in user-exit EXIT_SAPLRRS0_001 in Query
Hi,
ABAP BW Guru's
I got an ABAP type problem with RANGE numeric variables in EXIT_SAPLRRS0_001.
With character or dates iuser-exits worke fine.
My characteristic is CONNID Type NUMC 4
My user-exit variable is named CONNID_EXIT_STEP_2.
My ABAP processing in the exit for the user-exit varibale is quite simple (testcase):
DATA: l_e_t_range TYPE rsr_s_rangesid.
l_e_t_range-low = '17'.
l_e_t_range-opt = 'EQ'.
l_e_t_range-sign = 'I'.
APPEND l_e_t_range TO e_t_range.
My Error message in the BEX Analyser is:
Value "17" for user-exit variable CONNID_EXIT_STEP_2 is inavlid.
What's wrong with the ABAP processing in the exit (testcase) ?
The debugger clearly shows l_e_t_range-low with value 17.
l_e_t_range-low seems is a character.
Anyone can give a tip ?
Thank You !
Martin
ThanXsDear Karthik,
You are right. First time my user exit execute, after that report automatically call message located Function Module LCOPDU13 504th row
IF NOT SY-MSGID IS INITIAL.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
Message number is 806 message id is RU.
Can you help me for fix this situation? I just want to add a data control in ZXCOFU05 user exit. For user fill data (werks based)
Thanks your helpful answer -
Error message from user exit - current screen becomes grayed(non-editable)
I am working on a Sales Order (VA01/VA02) user exit(USEREXIT_SAVE_DOCUMENT_PREPARE) in MV45AFZZ program. I am validating certain values entered by user in this exit. Based on a condition, I issue a error message e.g. "message e001(ZV) with .....". I expect the processing to interrupt and the system control returns to the current screen. When there is an error, error message shows up on the status bar, but the current screen is completely grayed out(non-editable), not able to modify the incorrect entries. I keep hitting ENTER but no change to the grayed screen. Is there anything wrong in the way I issue error message?
I am on ECC6.
Thanks.could you please help me if possible in my senario :-
I am validating a field(serial number while creating delivery) in standard exit ZXQSMU04 and written a code to display an error message. The functionality is working correctly on validation and displaying the error message. But once the error is getting trigger the serial number field is becoming in gray mode i.e non editable.
I tried a lot to overcome this issue but not getting success could anyone help me to make the field editable while triggering the error message.
Please note : Its an exit and not having any message field in export or return table. Also tried with warning and information message.
Thanks in advance.
Regards,
Gautam Kumar -
Display error message in user-exit EXIT_SAPMP56T_002
Hi,
I'm doing a validation in user-exit EXIT_SAPMP56T_002 (include ZXTRVU03), and I want to display a error message. So, I'm using the instructions:
continue_with_update = 'N'.
MESSAGE ID xxx TYPE 'E' NUMBER yyy.
What happens is that in SAP GUI it works fine, but in SAP Portal it gives a lot of java exceptions.
Is there other way to display the error message that it works fine in the portal?
Thanks.
SóniaHi,
I tried with that but it doesn't work.
With the instruction "Message ID..." the portal shows an RFC ERROR SYSTEM FAILURE with all that java exceptions.
With your suggestion it does not retrieve my message, and instead it retrieves a customized message "Trip cannot be saved in this status, check mileage start and end location", that refers to the expense report and does not make any sense when I'm only creating the trip.
Any idea for this?
Thanks.
Sónia -
Display error message in user-exits for ME21n
Hi,
I want to give error message in exit EXIT_SAPMM06E_013
but it is getting displayed as information and gets roll back .
Can anyone help to display error message and stop there itself so that to give corret data and save.
the code in this exit is as below.
IF I_EKKO-BUKRS = '0800'.
CLEAR:V_FLAG.
READ TABLE TEKPA WITH KEY PARVW = 'ZN'.
IF SY-SUBRC NE 0.
MESSAGE E000(ZD)."'XXX' TYPE 'E'.
ENDIF.
ENDIF.
Thanks,
Sureshcheck this
EXIT_SAPMM06E_012 to display error message
especially look at the last post , adding the log. -
Hi friends,
Iam working on sone userexit in tcode Ko01 . actually i have to through the error message ...break point comes to that point it is not throughting that message...the message format i have used is
MESSAGE msgtypemsgnumber(messageid) WITH 'text message'.
the FM in which the include is there does not contain exceptions then can u plz tell me how i should through the error message....
thanks in advace...hi praja,
i m also facing the same problem. have u got any solution for this problem? if u have any solution pls share with me.
regards,
vicky. -
E-Commerce create order runtime error because of user-exit
Hi all,
we face the following problem in our e-Commerce 5.0 R3 B2B application:
In our R3 system, we have implemented the userexit_save_document_prepare when creating sales order (VA01) because we do not want an order to be created (saving is cancelled) if some conditions are not met. If this happens, the systems throws an error message that users can see at the status bar and the order creation is cancelled (but the user still is on the VA01 transaction).
Now, we are implementing SAP e-Commerce solution and we can create orders when these messages are not thrown (the order is saved without any message because all conditions are met). If one of these error messages (in user-exit) are thrown (the user has exceeded some limit, for instance), then e-Commerce application does not show the message but shows a runtime error and crashes (user has to log in again and so on...). I include the error trace below.
Is it not possible to show these error messages (which have information for user) on our B2B application?
com.sap.isa.businessobject.BORuntimeException: order create not possible
at com.sap.isa.businessobject.BusinessObjectHelper.splitException(BusinessObjectHelper.java:78)
at com.sap.isa.businessobject.order.Order.saveAndCommit(Order.java:393)
at com.sap.isa.isacore.action.order.MaintainBasketSimulationSendAction.basketPerform(MaintainBasketSimulationSendAction.java:122)
at com.sap.isa.isacore.action.order.MaintainBasketBaseAction.isaPerform(MaintainBasketBaseAction.java:998)
at com.sap.isa.isacore.action.IsaCoreBaseAction.ecomPerform(IsaCoreBaseAction.java:343)
at com.sap.isa.isacore.action.EComBaseAction.doPerform(EComBaseAction.java:353)
at com.sap.isa.core.BaseAction.execute(BaseAction.java:211)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at com.sap.isa.core.RequestProcessor.processActionPerform(RequestProcessor.java:674)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at com.sap.isa.core.RequestProcessor.process(RequestProcessor.java:391)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at com.sap.isa.core.ActionServlet.process(ActionServlet.java:243)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.runServlet(FilterChainImpl.java:117)
at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.doFilter(FilterChainImpl.java:62)
at com.tealeaf.capture.LiteFilter.doFilter(Unknown Source)
at com.sap.isa.isacore.TealeafFilter.doFilter(TealeafFilter.java:61)
at com.sap.engine.services.servlets_jsp.server.runtime.FilterChainImpl.doFilter(FilterChainImpl.java:58)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:384)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
Thanks in advance.Hi Jolly,
thanks for your quick response. The user-exist is not java-based but ABAP-based. User-exit is included in program: MV45AFZZ. Routine: USEREXIT_SAVE_DOCUMENT_PREPARE.
If we do not want to let the user save the order we use:
MESSAGE eXXX....
Thanks. -
How can i display warning messages in user exit EXIT_SAPLMGMU_001 (MM02)
Hi all,
while modifying the material master using MM02, i have added new conditions to display messages in user exit EXIT_SPALMGMU_001.
But using this user exit i am not able to display warning messages.
Can you please help me with this?
Sample code which i have included in exit :
SELECT SINGLE mstav FROM mara
INTO w_mstav
WHERE matnr = wmara-matnr.
IF wmara-mstav NE w_mstav.
IF wmara-mstdv NE sy-datum.
wmara-mstdv = sy-datum.
MESSAGE w177(z03_mm) WITH text-s04 text-s21.
ENDIF.
ENDIF.
Thank you all in advance.As written in the SAP documentation of the Enhancement , you can only raise error message using a
MESSAGE .. RAISING APPLICATION_ERROR.
You could manage the "warning" yourself, sending an error first time and keeping a trace of the check in some STATICS variable, and not raising the error again if data input remains unchanged between two call of the include.
<i>----
EXIT_SAPLMGMU_001
Where Is the Customer Exit - EXIT_SAPLMGMU_001 called?
The customer exit is in function module MATERIAL_UPDATE_ALL. The
function module checks the data for errors (logical relationships,
foreign keys, fixed domain values, and so on) when the material master
is updated.
Use
o New fields
You can make checks possible for new fields of your own. These
checks must be identical to the checks that you carry out for your
new fields in online maintenance.
o Existing fields
For existing fields, you can extend and intensify the checks.
You can also change data for descriptions and general material data
(MARA). For example, the descriptions can be generated from attributes
of the material.
Limitations
You cannot bypass existing checks.
Interface to Application
The respective data of the current logical transaction is contained in
the structures, for example, in structure WMARA for MARA. Nonrelevant
structures are transferred with their initial values.
General material data that can be changed (CMARA) has the structure
MARU. This MARA view contains fewer internal fields than MARA itself. If
WMARA is filled, CMARA is also filled when accessed.
The customer exit contains the exception APPLICATION_ERROR for your
self-defined error situations.
Using the language element MESSAGE .. RAISING APPLICATION_ERROR, you can
terminate the current (logical) transaction and display your message in
the log. </i>
Regards -
How to raise error message from PAI of oops ALV report
Hi All,
I have a requirement to raise error message form editable oops alv . After entering the data and then press SAVE button .
Please help.
Thanks in AdvanceHI SK,
Write a Local class (Event Handeler) to handel the events. In Editable ALV once the user enter a value, CL_GUI_ALV_GRID will raise an event called DATA_CHANGED.
1. Define and Implement a local class to handle that event.
In the implementation of this class you need to get data from imported object to an internal table, then compare the same with the ALV output table.
* Local Class to handler the events raised from the ALV Grid
CLASS LCL_EVENT_HANDLER DEFINITION.
PUBLIC SECTION.
* Method to handel EDIT event, DATA_CHANGED of CL_GUI_ALV_GRID
METHODS : ON_DATA_CHANGE FOR EVENT DATA_CHANGED OF CL_GUI_ALV_GRID
IMPORTING ER_DATA_CHANGED.
ENDCLASS.
* Event handler class Implementation
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
METHOD ON_DATA_CHANGE.
DATA : LT_MODIFY TYPE LVC_T_MODI,
LS_MODIFY TYPE LVC_S_MODI.
* Copying changed data into intenal table from Object
LT_MODIFY = ER_DATA_CHANGED->MT_MOD_CELLS.
* Modifying the ouptut table with the changed values
IF LT_MODIFY[] IS NOT INITIAL.
*Compare the ALV Output table with LT_MODIFY
ENDIF.
ENDMETHOD.
ENDCLASS.
Then raise a message on required condition in the same method.
Note: To trigger the above method, you need to set event handler before displaying ALV (before calling method SET_TABLE_FOR_FIRST_DISPLAY)
* Creating object for the Local event handler class
CREATE OBJECT GR_HANDLER.
* Set handler (call method of Event_handler) to handler Edit event
SET HANDLER GR_HANDLER->ON_DATA_CHANGE FOR GR_GRID.
Regards,
Vijay -
How to raise Error Message in foreground through Dynamic Action?
Hi,
I have a requirement where I have to raise an error message in foreground so as to stop processing whenever HR_INFOTYPE_OPERATION fails to update a record in a dynamic program. I tried using MESSAGE statement but it did not work, as the error message was not displayed properly on the Infotype screen that calls the dynamic action.
For ex.: If infotype PA0000 is calling PA0014 through dynamic action, then I want the error message to be displayed on the Actions Screen of PA0000.
Is there any specific way to raise error messages through dynamic action programs?
Quick answers will be appreciated.HI Sanjana,
In the Substitution exits you can create the message in the configuration it self.
You dont't need raise message explicitly.
Thanks, -
Error message for user (PO Release Stratregy)
Dear friends,
I have created PO release strategy. I want to show an error message like "You couldn't create PO. You dont have release strategy) ", If user doesn't have any strategy for current PO data. For this message Which user exit or Bapi can help me?
ThanksHow to control if current PO doesn't have any Release Strategies I want to show an error message. Which user exit or badi???
Thanks -
Hi all,
We are using SAP ABAP Web Dynpro Component: RPLM_QIMT_NOTIF_COMP to create notification(IW21). After entering data to create notification screen and press save, we want to do some validations and trough error message to screen and stop saving notifications until errors are fixed. Could someone give us clue how we raise error messages. Rather sample code to raise error messages. Notification is created via portal.
Rgds,
HarishHello Harish,
When the user presses on the save button, an event would be triggered. You can catch this event and perform your validations. Once the validations are done, you can use the FPM message manager to report your error messages. (IF_FPM_MESSAGE_MANAGER). You can instantiate this API in your component and then use the methods from this API to report your messages on the UI.
Regards
Rohan -
Can we display custom error message in user decision step screen.
Hi,
My requirement is to display error message when approver selects reject button in user decision step.
based on some condition i need to display error message in user decision screen when approver tries to
reject .
Please help
Thanks,
PhaniHi ibrahim,
Thanks for your Replay.
steps
1. cretae global class with interface IF_SWF_IFS_WORKITEM_EXIT.
2. cretae Event with importing parameter.
where i need to call EVENT_RAISED method ,do inned to call that method in
IF_SWF_IFS_WORKITEM_EXIT ?
how SWRCO_EVENT_AFTER_EXECUTION value is passed to method EVENT_RAISED ?
Thanks,
phani
Maybe you are looking for
-
ORA-01152 error while creating db from custom template
I have a database based on the "general purpose/transaction processing" db, but with a custom tablespace/data added. I have attempted to clone this database by using dbca to create a custom template (including data) from this database. The template c
-
I'm trying to re-install itunes 10.7 on my PC. I'm getting an error code saying I need a 64 bitn not a 32 bit. I'm stuck. Need some help
-
Can't import flash.display3D in Flash Builder 4.5 AS project
Hi, I'm trying to experiment with Stage3D but I can't import the display3D package. Does anyone have any tips? cheers.
-
Hi, I am developing a Web Application using Struts. I have a JSP form which is a Dyna Form, the scope of this form is "session". The form has few input text fields. When i Submit the form, the associated action creates the record in database. Then th
-
Export Data for Prime Infrastructure
I started an Export for Prime Infrastructure on my LMS 4.2.3 box several days ago and it is still running. There are approximately 3600 devices being exported from LMS I am guessing it should not take this long. Would like to kill the process but I