Error handling in user exit

Hello every one,
How to do error handling in user exit plz gimme some example for this..
Regards
Martin

Hi Jen,
the problem is that I want to use a transaction that needs data (TO number) that I created already but I don't called a COMMIT, see following structure (simplified):
* Creating TO
PERFORM create_new_transport_order CHANGING lv_generated_to_num.
CALL TRANSACTION LT31 WITH lv_generated_to_num.
<....>
COMMIT WORK.
Is it possible to call a transaction with data that is not really in the database yet? That's my question/problem.
Thanks

Similar Messages

  • 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.

  • Client Copy Error - ERROR: Type 'F' user exit with SYS_ERROR:

    Hello,
    We want to create a client copy from client 001 to clien 715.
    The client copy test runs successfully.
    The following error occurs in normal mode of client copy.
    1 ETA028XClient copy from "03.11.2010" "17:12:43"
    1 ETA029 System ID............................ "IS3"
    1 ETA043 Target client........................ "715"
    1 ETA030 R/3 Release.......................... "701"
    1 ETA354   Basis Support Package..............."SAPKB70107"
    1 ETA031 Host................................. "xxx"
    1 ETA000 Start in background............. ....." "
    1 ETA032 User................................. "SAP*"
    1 ETA033 Parameter
    1 ETA034 Source client........................ "001"
    1 ETA188 Source client user masters............"001"
    1 ETA185 Copier profile:......................."SAP_ALL"
    1 ETA036 Table selection
    1 ETA177 Customizing data ....................."X"
    1 ETA037 With application data................ "X"
    1 ETA155 Initialize and recreate......... "X"
    1 ETA294 Change documents are not copied
    2 ETA367XStart analysis of system "17:12:43"
    3 ETA108 "/GC1/CC_EXIT_CLIENT_DELETION" executed "        0"("        0") entries copied
    4 ETA114 Runtime "             0" seconds
    3 ETA072 Exit program "/GC1/CC_EXIT_CLIENT_DELETION" successfully executed "17:12:53"
    A2EE/SAPAPO/OM 012 "Mandant 715:" "Verbindung nicht oder fehlerhaft gepflegt:" "IS3CLNT001" " "
    2 ETA102 ERROR: Type 'F' user exit with SYS_ERROR: "/SAPAPO/OM_CLNT_COPY_DOWNLOAD"
    2 ETA534 "RCOD:" " 8" "SY-SUBRC:" " 0"
    2 ETA191 Program ended abnormally
    Can you help me?
    thx
    Torsten

    Torsten,
    Are you doing a local client copy in a SCM System. I can see it fails & is looking for SCM specific fn modules & user exits.
    If yes, has a look at this notes there are some steps that needs to be done for the transactional date:
    894490 - Client copy: Transactional data
    And re-post it in the SCM forum: SAP Advanced Planning & Optimization (SAP APO)
    - Regards, Dibya

  • 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
    ThanXs

    Dear 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ónia

    Hi,
    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

  • Throwing error in PR User Exit even after Error is corrected

    Hi all,
    I have created a User Exit in Purchase Requisition in which User Write a Dept Code in PR Header and against that Dept Code only those User ID can create a PR whose ID and Dept code are inserted in Z table.
    When I write a Dept code in PR Header which is not assigned in that Z table against that User ID it is throwing a error and a red error mark is showing in line item but when i correct that ID in header it is still showing the error, my error is not getting refresh. I have written below code, please help where i am getting wrong.
    CALL FUNCTION 'BALW_BAPIRETURN_GET2'
         EXPORTING
           type             = 'E'
           cl               = 'ZVWPRMSG'
           number           = 002
    *     PAR1             = ' '
    *     PAR2             = ' '
    *     PAR3             = ' '
    *     PAR4             = ' '
    *     LOG_NO           = ' '
    *     LOG_MSG_NO       = ' '
    *     PARAMETER        = ' '
    *     ROW              = 0
    *     FIELD            = ' '
        IMPORTING
          RETURN           = MESSAGES.
          append messages to ex_messages.
    exit.

    Hi,
    when you're joining your user exit with corrected Dept code, what is the the context of ex_messages and messages?
    Maybe you forgot to clear some data.
    Regards,
    Klaus

  • Error on reading user exit  EXIT_SAPMF02D_001

    Hello experts,
    Iu2019m working with user exit EXIT_SAPMF02D_001 and need to check certain values which are getting populate in tables I_KNA1 and I_KNVV. I realise these are available within import parameter. When I put a break point then during customer creation/modification before saving all the changes I can come and check all the values within I_KNA1 and I_KNVV but when I tried to write a select using I_KNA1 I get the error saying.
    u201CI_KNA1u201D is not defined in the ABAP Dictionary as a table, projection view or database view.
    Here is my select which gives the above error
      select kunnr ktokd into (v_kunnr, v_ktokd)
        from I_KNA1
           where kunnr = v_kunnr.
      endselect.
    If this is not the way Iu2019m doing in my select to fetch the values from I_KNA1 then how I can get all its values?
    Thanks a lot in advance.

    Hi,
    The importing structure I_KNA1 will contain all the fields available in KNA1. We can directly use I_KNA1-KUNNR and I_KNA1-KTOKD directly. We don't need to fire a select on KNA1 for reading KTOKD value. Just use I_KNA1-KTOKD where ever required.
    Regards,
    Ganga

  • 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

  • Internal error in SAP user exit

    Hi,
      i am working on the SAP user exits in SD module for Free goods enhancement, if customer buys 100 goods in 'X' material we have to provide 'Y' quantity of goods as free. i did coding part under the standard program "MV45AFZZ " in the form" user exit_save_document_prepare", its working fine in creation of sales order in VA01 transaction the free goods are getting added correctly.
    But, while changing the sales order in VA02 transaction the free goods are not getting updated after changing the order quantity. its just displaying the following error "An internal system error occurred. See note 442831."
    kindly help me to solve this issue.

    Dear vinod,
    No, this can't be done because with the help of configuration we can able to do only for 1:1 relationship.
    but this includes n :1 relationship free goods.so we need to develop code.in that only during execution only am getting this internal error.

  • Error on activating User Exit on EDI - SD

    Hello,
    In order to customized our EDI requirements for Incoming Sales Orders
    for one of our customers, we need to activate a User Exit
    (EXIT_SAPLEDI1_001 on enhacement ZSDIDOC). When doing this, all the
    standard Sales Order entry processes are blocked, as well as other
    transactions, such us VL12.
    Any solution??
    Thanks.

    ABAP/4 Open SQL array insert results in duplicate database records.".
    Error is due to inserting duplicate record in table which is already existing.Take help of abaper,debug,analyze
    code which may be cause of error using ST22.If it is application error,apply appropriate sap note.

  • 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,
    Suresh

    check this
    EXIT_SAPMM06E_012 to display error message
    especially look at the last post , adding the log.

  • Error message in user Exit

    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.

  • Error msg in user exit

    Hi all,
    how to set the particular field in customer tab to be open/available for input after error msg is being triggered

    > Hi all,
    > how to set the particular field in customer tab to be
    > open/available for input after error msg is being
    > triggered
    Hi,
    To avoid this problem, put all the related fields in the tab inside a chain..endchain statement At pAI event of your screen program.
    e.g.
    PROCESS AFTER INPUT.
      LOOP AT ITAB.
        CHAIN.
          FIELD MAKT-MATNR.
          FIELD MAKT-MAKTX.
          FIELD MAKT-MAKTG.
          MODULE MODIFY ON CHAIN-REQUEST.
        ENDCHAIN.
      ENDLOOP.
    Regards

Maybe you are looking for

  • HT201209 how can I buy an iTunes gift certificate for someone living in Colombia?

    How do I buy an iTunes gift certificate from US iTunes for someone who lives in Colombia?  The fine print on the gift certificate page says it can only be redeemed in a US iTunes store. Is this true? And if so is there a work around?

  • AS3 Unloading external SWF piling up problem

    I have two buttons on main SWF what loads and Unload two external SWFs back and forth. Also one timer function is calling external Screen saver SWF and unload the existing one when no interaction found. I am using unloadAndStop() function to unload t

  • Insert comment in Table cell/row

    Is it possible to enter a comment in a specific table cell? When I try it only enters a comment for the whole/entire table. Thanks.

  • Conversion of swf file to mp4

    I am having difficulty converting an swf audio visual file into mp4 format in order to include the film in my new app. Adobe media encoder does not work as it does not support the import of swf files and the free converters on the web all look bit do

  • Error parsing style

    I am a print designer and produced a website without scripting knowledge in GoLive and exported it to Dreamweaver. When I checked for compatability it said I had an error parsing style on lines 11, 18, 22, 23 and they are affecting IE6. Can anyone he