Handling error messages in BAPI

Hello,
   I am doing a replica of an SAP R3 std report in portal. I've converted the report pgm to a BAPI. My question is how to populate the BAPIRETURN table with the error messages raised from a std report? I mean how to capture these error messages? I am doing a SUBMIT to call this report from within the BAPI.
Thanks in advance.
Rgds,
Nathan.

Hi,
  Collect all the errors in an internal table..Lets say ITAB.
  At the end of the program export it to the memory.
  EXPORT T_ERRORS TO MEMORY ID 'BAPI_CALL'.
In the Bapi after the program is completed..use the import statement to get it from the memory...
  SUBMIT 'ZREPORT' AND RETURN.
  IMPORT T_ERRORS FROM MEMORY ID 'BAPI_CALL'.
  Then pass the errors to the return parameter of the BAPI..
Thanks,
Naren

Similar Messages

  • Passing Error message to BAPI Structure in RFC

    Hi Experts,
    I would like to know how we pass error message to BAPI structurre in RFC?
    Plz some one give the details about how we handle the errors.
    Thanks in advance.

    Like already mentioned before, every Standard SAP BAPI, has an export or tables parameter which is called something like RETURN with structure BAPIRET2. In here, you can store all the messages that are generated during the BAPI Call.
    However, if you also want to catch errors like system exceptions and communication errors, you will have to add these exceptions manually:
    EXCEPTIONS
         SYSTEM_FAILURE        = 1 MESSAGE RFC_MESS
         COMMUNICATION_FAILURE = 2 MESSAGE RFC_MESS.
    However, not sure if this addition works when calling BAPI from NON-sap application.
    Declaration:
    DATA: RFC_MESS(128).

  • Error message in BAPI call

    I have imported RFC Interfaces from SAP system. Each interfaces doesn't  have fault message.
    How to get error message in BAPI call when error occurs?
    I can catch an exception in BPM but I need to get error message and send it to another system.

    Hi Denis,
    >>>I have imported RFC Interfaces from SAP system. Each interfaces doesn't have fault message.
    if you want to use fault messages
    consider using ABAP Proxies
    >>>>How to get error message in BAPI call when error occurs?
    most bapis have return table in which they
    return error messages (you can do it either
    in a sync way or in an async way if the call is too long - with corrlelation of course)
    Regards,
    michal

  • Can't open PDF's on my Mac coming in on MS Outlook 2010. Reinstalled Adobe software 4 x and still get "Adobe PDF Preview Handler" error message.

    Can't open PDF's on my Mac coming in on MS Outlook 2010. Reinstalled Adobe software 4 x and still get "Adobe PDF Preview Handler" error message.

    No. Reader will not damage files. It is only meant to read pdf files. PDF files are frequently damaged when sent as email due to encoding issues.

  • Handle error message

    hi
    How to handle error message for following FM?
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                        = lv_filename
        filetype                        = 'DBF'
        write_field_separator           = 'X'
    IMPORTING
      filelength                      = lv_file_len
       TABLES
        data_tab                        = it_final
        fieldnames                      = t_header
        EXCEPTIONS
       file_write_error                = 1
       no_batch                        = 2
       gui_refuse_filetransfer         = 3
       invalid_type                    = 4
       no_authority                    = 5
       unknown_error                   = 6
       header_not_allowed              = 7
       separator_not_allowed           = 8
       filesize_not_allowed            = 9
       header_too_long                 = 10
       dp_error_create                 = 11
       dp_error_send                   = 12
       dp_error_write                  = 13
       unknown_dp_error                = 14
       access_denied                   = 15
       dp_out_of_memory                = 16
       disk_full                       = 17
       dp_timeout                      = 18
       file_not_found                  = 19
       dataprovider_exception          = 20
       control_flush_error             = 21
       OTHERS                          = 22.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    Error Message:  GUI_DOWNLOAD
    GUI_DOWNLOAD - Access Denied!! Why its throwing error message?
    Control flush error in gui_download
    Error in GUI_DOWNLOAD in background processing
    Error In Gui_download
    Reward points..

  • Error messages for BAPI

    Hello,
    Is there any way to get list of all possible error messages in BAPI for BAPI_PO_CREATE1 and BAPI_SAG_CREATE?
    I need to prepare check list of all possible error messages BAPI can return while creating PO and Schedulling agreement using BAPI.
    Thanks in advance.
    Madhura

    Try checking the message class used inside BAPI_PO_Create and all the messages in ME21n .
    Then you will need to go to this message class and find out al the messages.
    But this can go for a long list from 'error for valid vendor numbers, materials , and all the fields etc
    Mathews

  • How To Handle Error Message In TCD Recording?

    Hi All,
      I tried recording a transaction (my own transaction) by not enterring value in an obligatory field. the error message came. but when i executed the script, it showed an error. but actualy, the error message was expected right? how to handle this situation? i tried with tcd and sapgui recording. both gave almot the same result.
      i am including the script which i have written.
    MESSAGE ( MSG_1 ).
    *TCD ( ZCUST , ZCUST_1 , ECC ).
    SAPGUI ( SAP_1 , ECC ).
    ENDMESSAGE ( E_MSG_1 ).
    v_mno = &tfill.
    v_msg = E_MSG_1[v_mno]-msgtext.
    v_mtp = E_MSG_1[v_mno]-msgtyp.
    If Msg Type is E *** **** It Has To Be E ****
    IF ( v_mtp = 'E' and v_msg = 'Account no AC02 does not exist EXIT = X').
    logtext(0,'Passed').
    ELSE.
    log(v_mtp).
    log(v_msg).
    logtext(1,'Failed').
    ENDIF.
    End Of The Condition For Message Type E ******

    I have recording messages using the TCD command.
    My script (very simple):
    MESSAGE ( MSG_2 ).
    TCD ( ME21 , ME21_1 , R3 ).
    ENDMESSAGE ( E_MSG_2 ).
    In the MESSAGE command interface, I defined rules to allow several kind of messages.
    Execution: 3 mesages found:
          * transform PR into PO
           MESSAGE     MSG_2 [1,009 sec]
             RULES  MSG_2 = XML-DATA-01
            Message  MODE  EXIT  TYPE  ID    NR
            [1]      'A'         'I'   06    456
            [2]      'A'         'W'   'ME'  080
            [3]      'A'         'E'   'ZE'  029
             TCD    ME21                 [0,545 sec N] Target sys R3 -> ZDA010A219
            S06017 Standard PO created under the number 8201075606
               Tgt System Z_A219->R3->ZDA010A219 (ZDA 010 ... HP-UX ORACLE)
               CALL TRANSACTION ME21 ME21_1 XML-DATA-01
               03 MESSAGES FROM ME21 ME21_1 XML-DATA-01
               I  06 456 Release effected with release code 00001
               W  ME  080 Delivery date: next workday is 02.05.2007
               S  06 017 Standard PO created under the number 8201075606
           ENDMESSAGE  E_MSG_2 (&TFILL = 0)
    As you can see, 3 messages are found but the &TFILL variable is still 0.
    I guess (but cannot test yet) I would manage to record those messages using SAPGUI command.
    Is there anything wrong with my script?
    My SAP_BASIS component is in version 620. I'm not using the ultimate version of eCATT (no WEBDYNPRO command, etc.). Could it be an explanation?
    Thank you in advance,
    Olivier

  • How to handle error message during PAI?

    Hi Experts,
    Need help here.
    In my dialog screen, I have a field which is typed 'QUAN'.
    In entering different format , e.g. with non numeric value or a negative value, an error message appear and it does not process the MODULES inside the chain or FIELD MODULE ON REQUEST.
    Does anyone knows how to handle this kind of error. I need to display into a separate screen the errors I encountered coz I'm creating a new RF transaction.
    Points will be rewarded.
    Thanks in advance.

    Hai
    in your case(RF case) it is other way...
    yes you can use
    field x_currency module check_currency.
    in module check_currency.
    you have to display errors in another screen say 200.
    in that there will be 4 fields, all are display only fields.
    X_MESSAGE-MSGV1  of type sy-msgv1
    X_MESSAGE-MSGV2  of type sy-msgv2
    X_MESSAGE-MSGV3 of type sy-msgv3
    X_MESSAGE-MSGV4 of type sy-msgv4
    you populate the messages with these fields and then display it in the screen.
      method check_currency.
    *--do all your checks here....
           if error
             clear x_message.
            x_message-msgv1 = 'Enter Valid Employee Number'(004).
            leave to screen 0200.
          endif.
        endif.
    ENDMODULE.                 " VALIDATE_Currency
    in screen 200 PBO you need to format the message
    using the below logic.
           Method for formatting the message
      method message_format.
        data : lt_text type table of tline,         "text table
               lx_text type tline.                  "work area
        refresh lt_text.
        clear lx_text.
        concatenate x_message-msgv1 x_message-msgv2 into lx_text-tdline
          separated by space.
        append lx_text to lt_text.
        clear lx_text.
        concatenate x_message-msgv3 x_message-msgv4 into lx_text-tdline
          separated by space.
        append lx_text to lt_text.
    *- formatting the message
        call function 'FORMAT_TEXTLINES'
          exporting
            formatwidth = 20
          tables
            lines       = lt_text
          exceptions
            bound_error = 1
            others      = 2.
        clear: x_message.
    *- transfer the message data to screen fields
        loop at lt_text into lx_text.
          if sy-tabix = 1.
            x_message-msgv1 = lx_text-tdline.
          elseif sy-tabix = 2.
            x_message-msgv2 = lx_text-tdline.
          elseif sy-tabix = 3.
            x_message-msgv3 = lx_text-tdline.
          elseif sy-tabix = 4.
            x_message-msgv4 = lx_text-tdline.
          else.
            exit.
          endif.
        endloop.
      endmethod.                    "message_format
    Regards
    Vijay

  • Error Message in BAPI ... 'BAPI_ACC_INVOICE_RECEIPT_POST'

    Hello,
    I recently used a BAPI called 'BAPI_ACC_INVOICE_RECEIPT_POST'. However an error message appeared in my return table stating "No currency line exists for line item ....".
    Is there a way to resolve this?
    Thank you all and good day.

    hi Chad,
    the BAPI has four important tables parameters:
    ACCOUNTPAYABLE
    ACCOUNTGL
    ACCOUNTTAX
    CURRENCYAMOUNT
    In CURRENCYAMOUNT there should be a corresponding line for each lines in the first three tables.
    hope this helps
    ec

  • How to handle error messages in BDC background mode

    Hi experts,
      I got one problem in BDC, We are uploading data throgh BDC program,that program is calling Standard Batch Input programs,
    Now we got one requirement, i.e., In some special cases we have to send one message as a error message.I handled this in foreground but, how to handle this in background.

    Hi,
    if session is being used
    automatically the log will begenereated in the sm35 transaction
    but if call transaction is used
    put all the error messages in the applicationserver using
    open data set
    and after the exectionof the program in the background
    you have to run another progam which reads the data stroed inthe application server
    that also with open data set only...
    thanks & regards,
    Venkatesh

  • Handling error messages in OOPs ALV

    The question below is foolish.But I am a beginner so please excuse.
    I have successfully displayed an OOPs ALV which displays the material, batch and plant.
    A custom toolbar button(delete batches) has been appended to the standard toolbar.
    Now when I do not select any rows from the ALV  and click the button(delete batches) I have ensured that an error message flahes at the bottom of the screen.
    If I repeat the same procedure without coming out of the program it exits from the program itself. i want to avoid this.
    I want to flash the error message continually without coming out of the program till the user commits the mistake. Please note that I have not used any leave screen commands etc.
    Can someone please help me..
    Thanks in advance

    I assume you have the ON TOOLBAR event regiistered and the ENTER event for example.
    method constructor .
    create object grid_container1
            exporting
    *           container_name = 'CCONTAINER1'.
        container_name = cfname.
        create object  grid1
           exporting
              i_parent = grid_container1.
        set handler z_object->on_user_command for grid1.
        set handler z_object->on_toolbar for grid1.
        set handler z_object->handle_data_changed for grid1.
        set handler z_object->handle_data_changed_finished for grid1.
        set handler z_object->on_dubbelklik for grid1.
        set handler z_object->on_hotspot for grid1.
        call method grid1->register_edit_event
            exporting
               i_event_id = cl_gui_alv_grid=>mc_evt_enter.
      endmethod.
    So the easy way to do this is in your ON USER COMMAND routine when you can check to see if you selected any rows and the issue a popup warnimg message with the standard SAP MESSAGE statement.
    For example in my TEST function here I call a method to get the selected cell.
    If none are selected you can then issue your message and you will then be returned back to your GRID display after the user presses the OK button on the message popup.
    the grid1 object refers to the class cl_gui_alv_grid.
    in your case call a method that gets selected cells rather than selected cell. Use the standard method in cl_gui_alv_grid.
    If nothing selected then issue your message.
    (Note that your method ON DATA CHANGE / ON DATA CHANGED FINISHED might also be entered as well  so insure that you haven't got any coding in these methods that will interfere with processing flow).
    method on_user_command .
    *        FOR EVENT before_user_command OF cl_gui_alv_grid
    *        IMPORTING
    *          e_ucomm
    *          sender
    case e_ucomm.
          when 'EXIT'.
            leave program.
          when 'EXCEL'.
           call method me->download_to_excel.
          when 'SAVE'.
          when 'PROC'.
            call method me->process.
          when 'REFR'.
            call method me->refresh.
            when 'SWITCH'.
            call method me->switch.
           when 'TEST'.
            call method me->get_cell.
           endcase.
    method get_cell .
    break-point 1.
    call method grid1->get_current_cell
    importing
    e_row     = ls_row
    e_value   = ls_value
    e_col     = ls_col
    es_row_id = ls_row_id
    es_col_id = ls_col_id
    es_row_no = ls_row_no.
    endmethod.
    cheers
    jimbo

  • Handling error & messages in standard forms

    Hi all,
    I'm customizing Oracle HR through CUSTOM.pll and I need to handle some messages in standard forms.
    I have tried using ON-MESSAGE and ON-ERROR trigger, but I can't substitute the "not user-friendly" "FRM-40150: Cannot update record" with anything else!
    Is it possible to do this??
    In that case....should someone show me some examples??
    Thx a lot.
    If needed I can attach my code to help you..
    Thx
    Jacopo

    Whatever you do, never change the message level, it's just like hiding behind your finger, you'll be in denial of the error, but the error will be there...
    the best way is to handle them in on-error triggers, trap the error number and use your own message, you can create a user defined error and associate it with the error number of a choice.
    search the online help of the forms builder for user defined errors. there is a very clear example there.
    Tony

  • Handling Error message in Module Pool screen

    Hi Folks,
    I have developed a ALV report for table maintenace and I am calling the Dialog screen (small one) and Create and update the records of the Ztable through that screen.
    Presently I am handling the error message in the main ALV screen .
    My requirement is that I have to handle those error messages in small module screen.
    How to do the same ?
    Thanks.
    Hemum.

    crate message se91.
    insert failure
    if sy-subrc  <>0.
    message e001 with 'all readt exist'.
    endif.

  • Getting error message Thru BAPI: BAPI_INCOMINGINVOICE_CREATE

    Hi All,
    Could anyone please investigate into this error and give me the possible answer.
    We're using ECC 6.0
    Getting error while doing Invoice Posting thru BAPI/Function Module: BAPI_INCOMINGINVOICE_CREATE
    Error Messages
    1. M8 376: Enter goods receipt data only when working with GR-based IV
    2. M8 375: Fill in mandatory field REF_DOC, REF_DOC_YEAR, REF_DOC_IT (table parameter ITEMDATA, row 000001)
    These above 1 & 2 been rectified by putting the GR/GI Slip No. of GR
    But still the 3rd error is facing it now
    3. M8 429: Enter a reference to a valid goods receipt (line 000001)
    FYI
    My PO: 4500017248 is having a Status/Control of GR, IR, GR-Based IV
    PO 1 Line- Qty: 10, Net Order Price: 10
    GR: 5000012041 for 1 Line- Qty: 10, Net Order Price: 10, Total: 100
    Regards
    Dinakar
    Edited by: Dinakar Nallavelli on Jan 19, 2009 1:17 PM
    Edited by: Dinakar Nallavelli on Jan 19, 2009 1:23 PM
    Self solved this issue by putting the REF_DOC as GR related- MIGO Doc number and the Year of the document and the line item in it
    No Reply required further for this issue
    Edited by: Dinakar Nallavelli on Jan 19, 2009 2:27 PM

    How did you resolve it?

  • Error message for BAPI BAPI_POEC_CREATE

    Hi All,
    I am using this function module BAPI_POEC_CREATE to create purchase order in srm system.
    I have executed this bapi i am getting below error messages...
    I   BBP_PD               184 Purchase order 0000000068-  has been created
    E  BBP_UI_PO            045 Output: No details for medium Printer in supplier master record
    E  BS                   013 System status INCM is active (Purchase Order 68)
    I am not able to see the PO 68 which is created above in SRM system.Neighter it is shown in BBP_PD.
    also it is asking for output details for supplier. I have maintained in Maintain bussiness partner the output medium for the vendor in contact Tab.where else i need to maintain these values.
    also the error message mentioning INCM is active, i am not getting what it means
    Any body worked on this BAPI befor pls. help me.
    Abdul Raheem

    Hi,
    System Status INCM is active implies that your document is "Incomplete". There is an error and hence you cannot validate it, only park it.
    System status prevents you from ordering/submitting/validating the document until you correct the error.
    So could you please check the error message in RZ20?
    Regards,
    Nikhil

Maybe you are looking for

  • What the heck is going on BT

    Firstly huge apologies if i have posted this thread in the wrong place. I placed an order on thursday 9th April via telephone and was told that once i had provided my MAC code the process would start. I provided the MAC the following day (via telepho

  • How do I convert my iphone videos (.mov) to .flv files?

    How do I convert my iphone video (.mov) to .flv files?

  • Available software for old iBook & G4tower?

    I inherited a 14 inch iBook from my mother running 10.4.11 & I also have an old G4 tower running 10.4.11 & OS 9. Is there any newer OS system I can install that would be compatible with either of these, and where would I get such a thing? What are th

  • Blackberry Z10 failure to connect to webservice provider

    Dear Sir I would like to ask if some person could assist me in getting my mobile phone to connect to the web service provider. see below a copy of the connection details which I am sure you understand. the problem is that the moible will not connect

  • Apps 11i disaster recovery with hot standby db

    Hello, We are trying to formulate a disaster recovery plan for Apps 11i (single node install) utilizing a hot standby database for the db layer and file synchronization (rsync, rcp, whatever) of the application stack. We're comfortable with the hot s