Is it possible to circumvent error message within a function module?

Hello friends,
Is it possible to circumvent error message generation from within a function module? My program calls a FM (namely FKK_S_CADOCUMENT_WRITEOFF) to do some updates. However, in certain cases this FM throws error messages and terminates the whole process. I cannot control the aftermath because it never gets back to the calling program.It stops at the FM level and not at my program level.
In essence, what I would like to do is to let the FM do its thing, generate some kind of exception (but no error message), come back to the calling program, and then I can capture the status in my program and do what is necessary from then on.
Your help is greatly appreciated

Hi,
Do not use Excerption Tab.
Instead declare a variable or Structure at export parameter.
Which will return you error Description or Status of the FM.
For Example.
Goto Se37 ---> key in FM name of yours.
Go to Table tab
At Parameter Name Column key in RETURN, Type as LIKE and Associate type as BAPIRET2.
ThankS & regards,
ShreeMohan
Edited by: ShreeMohan Pugalia on Aug 10, 2009 12:31 PM

Similar Messages

  • Error message when using function module HRIQ_TESTRESULTS_CREATE

    Hi,
    I need your help, I'm trying to use function module HRIQ_TESTRESULTS_CREATE to create external test results, I've used this function before without subscores, now I need to create subscores, but I get the message: "Grading scale UBID applies".
    The test type EXAM_UB_ING has assigned the UBID academic scale, which has a range from 1 to 677. Test type EXAM_UB_ING has 3 subtests (grammar, listening and reading) which also have the UBID academic scale assigned.
    I think this isn't a customizing problem because I can create test results with subscores using the PIQST00 transaction, the error message happens just when using the function module.
    I'm using this import parameters:
    STUDENT:
    PL:           01
    OT:          ST
    OBJID:     Student ID
    TESTRESULTS_HEADER:
    ISSUEDATE                      08.02.2010
    VALIDDATE                      30.04.2010
    TEST_GUID
    TESTEO                         50000269
    TRANSEO                        00000000
    TESTTYPE                       EXAM_UB_ING
    SESSIONID                      T1
    SESSIONYEAR                    2010
    ENTRYDATE                      08.02.2010
    TESTPASSFAIL
    TESTTOTRES                     458
    TESTSCALE_ID
    TOTALPERCENT1                   0,00
    TOTALPERCENT2                   0,00
    ENTRYMODE
    SUBTY
    Table TESTRESULTS_SUBSCORES:
    SUBTESTID            GRAMMAR
    SUBTESTTRES      GRAMMAR
    SUBT                     203
    SUBTESTID            READING
    SUBTESTTRES      READING
    SUBT                     120
    Does anybody know which could be the error? Or any other function module which I can use? (with HRIQ_TESTRESULTS_PROCESS_DATA I get the same error message).
    Thanks in advance!
    Araceli

    Araceli,
      I just noticed. You are populating SUBTESTSCALE_ID in subtest result structure.That's the reason it's throwing this error. it is trying to match Scale ID from test with value in sub test result scale ID.
    Prabhat Singh

  • Catching error message from standard function module to internal table.

    Hi,
    i am calling a FM in my custom prog.
    After execution of the FM some auto generated errors is getting displayed.
    I want to pass this error to an internal table.
    Please tell me how to do this?
        CALL FUNCTION 'FORMAT_CHECK'
          EXPORTING
            i_checkrule   = t005-prbkn
            i_checkfield  = it_ven-bankn
            i_checklength = t005-lnbkn
            i_checkmask   = space
            i_fname       = fname
          EXCEPTIONS
            not_valid     = 1
            OTHERS        = 2.
      IF sy-subrc <> 0.
           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    I want to catch this particular error message in the itab.
    Thanks,
    SAM.

    Even we can create an internal table  nad move the messages to it.
    DATA : BEGIN OF L_ERR OCCURS 0,
            SNO LIKE SY-tabix,                                  "serial no
            MSGTY LIKE SY-MSGTY,                         "message type
            MSGNO LIKE SY-MSGNO,                        "message no
            ERR_TEXT LIKE T100-TEXT,                     "message text
           END OF L_ERR. 
       IF SY-SUBRC <> 0.
              L_ERR-SNO      = SY-TABIX.
              L_ERR-MSGTY    = SY-MSGTY.
              L_ERR-MSGNO    = SY-MSGNO.
              L_ERR-ERR_TEXT = TEXT-015.                        "Problem encounterd in uploading data.
              APPEND L_ERR.
              clear L_ERR.
         ENDIF.

  • How to capture error message from standard function module

    Dear friends
    when i  execute standard function module in finance , i am getting error message , pls check the below screen shot,
    how to capture the below error message so that i have display in my webdynpro component
    Thanks
    Vijaya

    Hello Vijaya,
    Incase of BAPI's they have a return table parameter T_RETURN. Just read that return table to get the error message.
    Incase of normal function modules, there will be exceptions raised for the message used inside the function module. Just read the sy-subrc after the FM and based on the sy-subrc value find the respective exception raised.
    May be you can try like this, whenever the message is raised it will be stored in the system variable.
    CALL FM.
    check for the system variables.
    sy-msgid = Message ID of the latest message raised.
    sy-msgno = message number of the latest message raised.
    sy-msgty = message type of the latest message raised.
    sy-msgv1 = variable1 of the latest message raised.
    sy-msgv2 = variable2 of the latest message raised.
    sy-msgv3 = variable3 of the latest message raised.
    sy-msgv4 = variable4 of the latest message raised.
    Regards,
    TP

  • I've tried to update my ipad 2 with IOs 6 but it was not possible. An error message always appear after some time during e download. Is there an solution?

    I've tried to update my ipad 2 with IOs 6 but it was not possible. An error message always appear after some time during e download. Is there an solution?

    Are you trying to update via wifi or connected to your computer?
     Cheers, Tom

  • Is it possible to send error message from Adapter Module to CCMS?

    Hi
    Is it possible to send error message from Adapter Module  to CCMS...?I have written on adatper module from there i have to send error message to CCMS or SXMB_MONI. Is it possible if yes please send me the related documents
    Best Regards
    Ravi Shankar B

    Hi
    I have written following User Defined Exeption in my Module program
    class DuplicateFileException extends ModuleException{
              DuplicateFileException(String message){
                   super(message);
    I am throwing my Exception like this
    try{
         throw new DuplicateFileException("Duplicate File");
    }catch(DuplicateFileException e){
         throw e;
    But i am not getting this exception in SXMB_MONI. In adpater monitoring i am getting the following exceptions
    <b>
    2007-05-16 15:51:30 GMT+05:30: Retry interval started. Length: 5.000 s
    - 2007-05-16 15:51:30 GMT+05:30: Error: java.lang.NullPointerException
    - 2007-05-16 15:51:30 GMT+05:30: An unknown error occured.
    - 2007-05-16 15:51:30 GMT+05:30: Processing started
    - 2007-05-16 15:51:25 GMT+05:30: Error: java.lang.NullPointerException</b>
    can any one give me the idea how to send error from module program to SXMB_MONI
    Thanks & Regards
    Ravi Shankar B

  • Error message: 1021: Duplicate function definition.

    Hi All,
    First let me start by saying that I know next to nothing about Flash.  I have inherited a website maintenance project that has a Flash rotating image banner.  I have managed to get the images to fade-in and fade-out correctly, but now I need to make these images clickable - linking images to pages in the website.  I have read many posts here and have reviewed the video tutorials.  I have been able to get the first image clickable using this AS3 action:
    mars_btn.addEventListener(MouseEvent.CLICK, buttonClickHandler);
    function buttonClickHandler(event:MouseEvent) :void {
            navigateToURL(new URLRequest("http://somewebsite/mars.php"));
            trace("I'm clicked");
    However, when I attempt to make another image clickable by using a different instance of a button I get the error message:
    1021: Duplicate function definition.
    I have a separate instance of a button with this AS3 action:
    jupiter_btn.addEventListener(MouseEvent.CLICK, buttonClickHandler);
    function buttonClickHandler(event:MouseEvent) :void {
            navigateToURL(new URLRequest("http://somewebsite/jupiter.php"));
            trace("I'm clicked");
    Obviously I'm not understanding how I'm supposed to do this so that I don't create a duplicate function definition.  Any help would be most appreciated.

    excuse me , I have a question i hope that you help .. ( im new in here )
    we were asked to create an interactive application on flash in two languages..
    so i created two different fla files same exact codings ... i was wondering how can i combine them so the viewer can be able to choose the language from a button ?
    when i try to combine them i get lots of errors of duplications in the actionscript
    PS : MY MAIN PAGE INCLUDES A CAROUSEL with images ..
    I was thinking of saving one of the fla  as a movie and then add it some how to the second fla and combine it with a button but i can't figure it how..
    i hope i was clear enough.. but is there any possibility to help me please ?!
    when i tend to change names or something it creates error.. ( IM NOT A PRO IN AS3 ) and when i dublicate the scenes it give duplication errors.. WHAT IS THE SOLUTION ??
    this is the code of the actionscript in the main page.. ( the carousel's code i took from someone ) and i used it on my project
    import com.ccanvas.carousel.*;
    var centerX:Number = stage.stageWidth/4;
    var centerY:Number = stage.stageHeight/4;
    var carc:Carousel = new Carousel(centerX, centerY, 256, 75, "icons.xml");
    carc.addTooltip(new tooltip); // use 'tooltip' movieclip for item tooltip
    addChild(carc); // add carousel to stage
    function down(event:MouseEvent):void {
    trace(event.currentTarget.toolText); // simple click interaction
    function destroyCarousel(event:MouseEvent):void {
    carc.destroy(); // remove all item in carousel as well as tooltip
    function removeNextItem(event:MouseEvent):void {
    if(carc.numOfItems > 2) {
      carc.removeItem(2); // remove the item next to the remove item icon
    create.addEventListener("mouseDown", createCarousel);
    function createCarousel(event:MouseEvent):void {
    if(carc.CREATED == false) {
      // recreate the carousel
      carc = new Carousel(centerX, centerY, 256, 75, "icons.xml");
      carc.addTooltip(new tooltip);
      addChild(carc);
    }/* Click to Go to Scene and Play
    Clicking on the specified symbol instance plays the movie from the specified scene and frame.
    Instructions:
    1. Replace "Scene 3" with the name of the scene you would like play.
    2. Replace 1 with the frame number you would like the movie to play from in the specified scene.
    Tools_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);
    function fl_ClickToGoToScene(event:MouseEvent):void
    MovieClip(this.root).gotoAndPlay(1, "Toolse");
    }/* Click to Go to Scene and Play
    Clicking on the specified symbol instance plays the movie from the specified scene and frame.
    Instructions:
    1. Replace "Scene 3" with the name of the scene you would like play.
    2. Replace 1 with the frame number you would like the movie to play from in the specified scene.
    games_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToGames);
    function fl_ClickToGoToGames(event:MouseEvent):void
    MovieClip(this.root).gotoAndPlay(1, "Gamese");
    }/* Click to Go to Scene and Play
    Clicking on the specified symbol instance plays the movie from the specified scene and frame.
    Instructions:
    1. Replace "Scene 3" with the name of the scene you would like play.
    2. Replace 1 with the frame number you would like the movie to play from in the specified scene.
    Identity_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToIdentity);
    function fl_ClickToGoToIdentity(event:MouseEvent):void
    MovieClip(this.root).gotoAndPlay(1, "Identitye");
    }/* Click to Go to Scene and Play
    Clicking on the specified symbol instance plays the movie from the specified scene and frame.
    Instructions:
    1. Replace "Scene 3" with the name of the scene you would like play.
    2. Replace 1 with the frame number you would like the movie to play from in the specified scene.
    Reviews_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_13);
    function fl_ClickToGoToScene_13(event:MouseEvent):void
    MovieClip(this.root).gotoAndPlay(1, "Reviewse");
    }/* Click to Go to Scene and Play
    Clicking on the specified symbol instance plays the movie from the specified scene and frame.
    Instructions:
    1. Replace "Scene 3" with the name of the scene you would like play.
    2. Replace 1 with the frame number you would like the movie to play from in the specified scene.
    Facts_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_20);
    function fl_ClickToGoToScene_20(event:MouseEvent):void
    MovieClip(this.root).gotoAndPlay(1, "Factse");

  • After shutting down Firefox 3.68, an error message reading "Incorrect Function" pops up.

    I upgraded to Firefox 3.68 about four days ago. After shutting down Firefox 3.68, an error message reading "Incorrect Function" pops up. I click "OK." Nothing seems to happen, either good or bad.
    I installed Comodo Internet Security a few days before I upgraded to Firefox 3.68.
    == This happened ==
    Every time Firefox opened
    == After I upgraded to Firefox 3.68.

    I am the original poster. The problem seems to have nothing to do with my upgrade to Firefox 3.6.8 but with a configuration change I made to System Mechanic after I switched to Comodo Internet Security.

  • Handling 2 messages in a function module

    Hi ,
    I have a requirement where I need to trigger 2 messages if sy-subrc fails in a Function Module.
         Function module                              GET_JOB_RUNTIME_INFO
         IMPORTING
         JOB名(JOBNAME)=          P_WK_JOBNM
         Error(SY-SUBRC <> 0)
         Result message output
         (EN) Total : &1, Success : &2, Error : &3
         Type: u2019Su2019
         &1:u20190u2019      &2:u20190u2019     &3:u20190u2019
         Perform error handling(->Error Handling:030)
    Error Handling 30:  Error Handling as ABEND
    Show message (message type u2018Eu2019)
    (EN)Error was found in function module. Function module: &1 Returned value: &2 &3
    &1:'GET_JOB_RUNTIME_INFO'
    &2: Exception No
    I have written the code in the following way.
    CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
    IMPORTING
      EVENTID                       =
      EVENTPARM                     =
      EXTERNAL_PROGRAM_ACTIVE       =
      JOBCOUNT                      =
       JOBNAME                       = l_job_name
      STEPCOUNT                     =
    EXCEPTIONS
       NO_RUNTIME_INFO               = 1
       OTHERS                        = 2
    IF sy-subrc <> 0.
    message s010(zmm)  with c_zero c_zero c_zero.
    message e001(zmm) display like 'A'.
    ENDIF.
    But the above code is not working fine.  Only the second message ie [message e001(zmm) display like 'A' ] is being displayed.
    In debugging mode the cursor is passing to the first message but still it is not being displayed.
    Can any one help me in solving this problem
    Thanks in advance,
    Indira

    check this sample code
    here gt_return is of type bapiret2_t
        MOVE <fs_bank_details>-bankkey TO gv_msg_par1.
        MOVE <fs_bank_details>-bankname TO gv_msg_par2.
        PERFORM fm_format_message USING gc_msgno083
                                        gc_e.
    FORM fm_format_message  USING    pv_msgno TYPE sy-msgno
                                     pv_type TYPE bapi_mtype.
      DATA:ls_return TYPE bapiret2.
      CLEAR: ls_return.
      CALL FUNCTION 'BALW_BAPIRETURN_GET2'
        EXPORTING
          type   = pv_type   "Message type
          cl     = gc_bp     "Message class
          number = pv_msgno  "Message No
          par1   = gv_msg_par1 "value for place holder1
          par2   = gv_msg_par2 "value for place holder2
        IMPORTING
          return = ls_return.
      IF ls_return IS NOT INITIAL.
        APPEND ls_return TO gt_return.
      ENDIF.
    ENDFORM.                    " FM_FORMAT_MESSAGE

  • Message handling in function module

    Dear All,
    I created a function module to create equipment master. but i want to know how to handle message for this function module.
    Like if i create an equipment which is already been created then the message should shoe that equipment already exist.
    <removed by moderator>
    this is my query. so pls kindly tell me how to handle message for this query
    Moderator message: please post only relevant code parts, your posts must contain less than 5000 characters to preserve formatting.
    Edited by: Thomas Zloch on Apr 14, 2011 10:00 AM

    Hi Prakrita,
    Try building below code within the RFC after you have added return structure in your RFC parameters.
      IF sy-subrc NE 0.
        CLEAR message.
        message-msgty = 'E'.
        message-msgid = 'ZMI'.
        message-msgno = '001'.
        message-msgv1 =  ID.
      PERFORM return_message USING message
                                   CHANGING return.
      Endif.
      form return_message USING    VALUE(P_MESSAGE)   LIKE MESSAGE
                                   CHANGING P_RETURN  LIKE BAPIRETURN.
      CHECK NOT MESSAGE IS INITIAL.
      CALL FUNCTION 'BALW_BAPIRETURN_GET'
           EXPORTING
                TYPE       = P_MESSAGE-MSGTY
                CL         = P_MESSAGE-MSGID
                NUMBER     = P_MESSAGE-MSGNO
                PAR1       = P_MESSAGE-MSGV1
                PAR2       = P_MESSAGE-MSGV2
                PAR3       = P_MESSAGE-MSGV3
                PAR4       = P_MESSAGE-MSGV4
           IMPORTING
                BAPIRETURN = P_RETURN
           EXCEPTIONS
                OTHERS     = 1.
    endform.

  • Suppressing Messages Generated by Function Modules

    Hello,
    Is there a way to suppress a message generated from within a function module even though the function module doesn't raise an exception to be handled?
    I am calling L_TO_CREATE_MULTIPLE and it calls another function module that doesn't raise an exception, it just generates a message. I'd like to be able to handle the message rather than have it displayed to the user.
    Thanks for any help anyone could provide.
    Best Regards,
    Brett

    Brett,
    When I tried it in a normal function module (not RFC), I am not able to suppress the "Information" messages. I have a BDC inside the fn module.
    Do you have any idea?
    Thanks for your help,
    Bala

  • Error while activating the function module

    hi,
    am getting error while activating the function module i.e. program or report statement is missing.
    thank you in advance
    karthik

    hii vinu,
    hi there....
    make sure that the Processing type in Attributes tab is 'Normal function module'. Also chk the general data, it must be having some name in the Program Name and include name column.try checking the program names in se38, if the program is of type include or not. you can also chk by writting  a program call the function module and test it
    I hope this will solve the query. in my case, SAPLZ123 is the program name and LZ123U28 is the include name.
    or
    Its common prob with Function module.
    Goto SE80->Give Function group name->Right click on it->Activate.
    regards,
    Shweta

  • Is it possible to ignore error messages in BAPI_SALESORDER_CHANGE  ?

    Dear all,
    I encountered another problem today which I hope you can help me with.
    During manual Sales Order Change, customizing triggers an error message which can be ignored for the special case I'm dealing with. It will pop up, but - like a warning message - the user can continue to enter data and afterwards save the changed SO.
    Now when I try to do the same thing via the BAPI, the BAPI fails due to this error message.
    Is there any way to make the BAPI ignore this error message, meaning to just continue processing the Sales Order when this message occured?
    Thank you very much,
            Johannes.

    <u>Suggestion #1</u>
    Take a look at the BAPI parameter BEHAVE_WHEN_ERROR.  Here is the long text for this parameter:
    <b>Short text</b>
    Error Handling
    <b>Description</b>
    This parameter controls how the program behaves when an error occurs. Up until now, the BAPI always terminated when an error occured. For example, if you created a sales order with several items and one item contained an error, the whole sales order was not created.
    This parameter make it possible to create an order even if some of the items cannot be created.
    <b>Value Range</b>
    Space = If an error occurs, processing stops and the sales document
    is not saved.
    P = If an error occurs, the sales document can be saved.
    Problematic items are not processed but they are logged.
    R = As for P but the document is not saved.
    <b>Default</b>
    Space
    <b>Notes</b>
    If several fields are changed within a structure and the field check finds an error, the system stops processing the structure and it is not changed.
    <b>For example:</b>
    You want to change the delivery block, billing block and item data in the header data of a sales order. If you specify a delivery block that is not permitted, the system does not change the header data but the items will be changed as long as they do not contain any errors themselves.
    <u>Suggestion #2</u>
    This can also depend on which message you are trying to ignore. 
    Some messages are set as customizable (in table T100C - see function module 'READ_CUSTOMIZED_MESSAGE').  FYI: SAP has been known to change certain messages to be "customizable" via an OSS Note upon request.
    Some messages might behave differently during a BAPI call.  See field CALL_BAPI in program SAPMV45A.
    If you haven't already done so, it might be worth an OSS Note search using your message class and number (include the BAPI name or "sales order" if too many notes are found).
    Best Regards,
    James Gaddis

  • Error Messages within a development

    All,
    Another problem i have is that i want to display an image of a red cross before any error message that is displayed to a customer using the development. At the moment, the default is just the word 'ERROR', followed by the particular error message.
    I know how to insert an image of a red cross, i have loaded that into the images folder and are asking the error to show the image, but the problem i am having is that the image is being inserted over the text 'ERROR'.
    Does anyone know how i can move the text of the error message slightly to the right so the image is not on top of it? It sounds like a simple padding or floating issue but i can't fix it. Which css file would i need to amend, what code shoild i look for, and what should i change it to?
    Thanks
    Rob

    Unfortunately this really boils down to HTML layout troubleshooting. Best advice is to try different things to see what gets you closer to a solution, and what doesn't.

  • Error message within EXIT_SAPLIE01_005

    Hello. Does anyone know how I can stop the process at UE EXIT_SAPLIE01_005 (Enhancement IQSM0005) at MIGO transaction? error message, stop and the like causes me a DUMP.
    Thanks in advance..

    did you have tried to put a break-point and test?
    if it is not wokring trying to make a endless loop in user exit and debug through SM50
    menu : program -> debugging for that particular process.
    Thanks.

Maybe you are looking for