Error handling in bdc Fb01along with erros in Idoc.

Hi,
Can any one send me the sample code for the error handling in bdc Fb01along with erros in Idoc. Actually, mail should be sent
Thanks
Avi.

Hi,
This may help you.
<b>FORM send_mail USING   receiver.
  CLEAR: w_lines,tbl_packing_list,tbl_object_header,
             tbl_contents_txt, tbl_receivers.
  REFRESH:tbl_packing_list, tbl_object_header,
           tbl_contents_txt,tbl_receivers.
  SORT tbl_err.
  DELETE ADJACENT DUPLICATES FROM tbl_err COMPARING ALL FIELDS.
  IF NOT tbl_err[] IS INITIAL.
Preparing the email.
    PERFORM prepare_email.
  ELSE.
   If sy-subrc NE 0.
      MOVE sy-subrc TO w_code.
   ENDIF.
    EXIT.
  ENDIF.
Get  the content of header e-mail document data
  PERFORM document_data.
Get details of the error file attached (like type of file and format)
  PERFORM packing_list.
Get receiver mail id's
  tbl_receivers-receiver = receiver.
  tbl_receivers-rec_type = 'C'.
  tbl_receivers-express  = c_flag.
  tbl_receivers-sap_body = c_flag.
  APPEND tbl_receivers.
Call FM to send E-mails to receivers
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
       EXPORTING
            document_data              = st_document_data
            put_in_outbox              = 'X'
       TABLES
            packing_list               = tbl_packing_list
            object_header              = tbl_object_header
            contents_txt               = tbl_contents_txt
            receivers                  = tbl_receivers[]
       EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
            operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
            OTHERS                     = 8.
ENDFORM.                    " send_mail
*&      Form  prepare_email
      text
-->  p1        text
<--  p2        text
FORM prepare_email.
E-Mail body content
  IF NOT w_lifnr IS INITIAL.
    CONCATENATE text-015 w_docnum text-016
           INTO tbl_contents_txt-line
      SEPARATED BY space.
  ENDIF.
  APPEND tbl_contents_txt.
  CLEAR tbl_contents_txt.
E-mail error file attachment header
  CONCATENATE text-063 text-064
               text-065 text-066 c_comma
         INTO tbl_contents_txt-line
    SEPARATED BY c_comma.
  APPEND tbl_contents_txt.
  CLEAR tbl_contents_txt.
E-mail error file attachment content
  LOOP AT tbl_err.
    CONCATENATE w_docnum tbl_err-v_segnum
                tbl_err-msg tbl_err-type
      INTO tbl_contents_txt-line
      SEPARATED BY c_comma.
    CONCATENATE c_linefeed tbl_contents_txt-line c_comma
           INTO tbl_contents_txt-line.
    APPEND tbl_contents_txt.
    CLEAR tbl_contents_txt.
  ENDLOOP.
ENDFORM.                    " prepare_email
*&      Form  document_data
      text
-->  p1        text
<--  p2        text
FORM document_data.
  CLEAR w_line.
  IF NOT w_lifnr IS INITIAL.
    CONCATENATE text-075 text-027 sy-datum sy-uzeit INTO w_line
    SEPARATED BY c_uscore.
  ENDIF.
  st_document_data-obj_name  = w_line.
  st_document_data-obj_descr = w_line.
  st_document_data-priority  = 1.
  st_document_data-obj_prio  = 1.
ENDFORM.                    " document_data
*&      Form  packing_list
      text
-->  p1        text
<--  p2        text
FORM packing_list.
  CLEAR w_lines.
  DESCRIBE TABLE tbl_err LINES w_lines.
  READ TABLE tbl_contents_txt INDEX w_lines.
  tbl_packing_list-head_start = 1.
  tbl_packing_list-head_num   = 1.
  tbl_packing_list-body_start = 1.
  tbl_packing_list-body_num   = 1.
  tbl_packing_list-doc_type   = 'RAW'.
  APPEND tbl_packing_list.
  tbl_packing_list-head_start = 1.
  tbl_packing_list-head_num   = 0.
  tbl_packing_list-body_start = 2.
  tbl_packing_list-body_num   = w_lines + 1.
  tbl_packing_list-doc_type   = 'CSV'.
  tbl_packing_list-obj_descr  = 'Error_Attachment'(060).
  IF NOT w_lifnr IS INITIAL.
    tbl_packing_list-obj_name   = 'Idoc Number is'(072).
  ENDIF.
  tbl_packing_list-doc_size   = 255 * ( w_lines + 1 ).
  APPEND tbl_packing_list.
ENDFORM.                    " packing_list
</b>
Thanks
Manju.

Similar Messages

  • Error Handling in BDC...Review code..

    Hi Gurus,
    I have made a BDC program to do call transaction for FV50...i AM NOT SURE ON HOW TO DO ERROR HANDLING IN THAT...TRIED TO DO SOMETHING BUT IT NEEDS LOT OF IMPROVEMENT...
    CAN ONE YOU EXPERTS HELP ME IN THAT...I AM ATTACHING THE ENTIRE CODE..
    REPORT  zbdc_park_fv50.
    DATA:
    t_document_line_item_main LIKE bapiacgl09 OCCURS 100,
    t_document_line_item_enhn LIKE bapiacextc OCCURS 100,
    t_document_line_item_amnt LIKE bapiaccr09 OCCURS 100,
    wa_document_header LIKE  bapiache09,
    wa_document_line_item_main LIKE bapiacgl09,
    wa_document_line_item_enhn LIKE bapiacextc,
    wa_document_line_item_amnt LIKE bapiaccr09.
    DATA: BEGIN OF s_bdc_document_item_main,
          v_HKONT LIKE ACGL_ITEM-HKONT,
          v_SHKZG LIKE ACGL_ITEM-SHKZG,
          v_SGTXT LIKE ACGL_ITEM-SGTXT,
          v_WRBTR LIKE ACGL_ITEM-WRBTR,
          v_WAERS LIKE ACGL_HEAD-WAERS,
          v_PRCTR LIKE ACGL_ITEM-PRCTR,
          v_YYLOB LIKE ACGL_ITEM-YYLOB,
          v_YYCSG LIKE ACGL_ITEM-YYCSG,
          END OF s_bdc_document_item_main.
    DATA: t_bdc_document_item_main LIKE s_bdc_document_item_main OCCURS 0,
          wa_bdc_document_item_main LIKE s_bdc_document_item_main.
    DATA: t_bdcdata LIKE bdcdata OCCURS 0 with header line,
          t_messages LIKE bdcmsgcoll OCCURS 0 with header line.
    DATA:  idx TYPE i,
           ch3(2) TYPE n,
           fname(40) TYPE c,
           options TYPE ctu_params.
    DATA: indate TYPE d,
          intdate TYPE d,
          var_SHKZG LIKE BSEG-SHKZG,
          amount(13) type c.
    DATA: w_textout LIKE t100-text.
    *DATA: gd_update TYPE i,
         gd_lines TYPE i.
    CLEAR wa_document_header.
    ***FILL DOCUMENT HEADER***********
    wa_document_header-obj_type = space.                        "
    wa_document_header-obj_key = space.
    wa_document_header-obj_sys = space.
    wa_document_header-bus_act = 'RFBU'.
    wa_document_header-username = 'samwil'.
    wa_document_header-header_txt = 'TEST_BDC_PARK123'.
    wa_document_header-comp_code = '1001'.
    wa_document_header-doc_date = '20070817'.
    wa_document_header-pstng_date = '20070817'.
    CLEAR wa_document_header-trans_date.
    CLEAR wa_document_header-fisc_year.
    CLEAR wa_document_header-fis_period.
    wa_document_header-doc_type = 'SY'.
    wa_document_header-ref_doc_no = 'AAR1213'.
    wa_document_header-ac_doc_no = space.
    wa_document_header-obj_key_r = space.
    wa_document_header-reason_rev = space.
    wa_document_header-compo_acc = space.
    wa_document_header-ref_doc_no_long = space.
    wa_document_header-acc_principle = 'LGAP'.
    wa_document_header-neg_postng = space.
    wa_document_header-obj_key_inv = space.
    wa_document_header-bill_category = space.
    FILL LINE ITEMS *******************
    CLEAR: wa_document_line_item_main, wa_document_line_item_enhn, wa_document_line_item_amnt.
    Fill Main Portion Of Accounting Line Item
    wa_document_line_item_main-itemno_acc = '1'.         "Accounting Document Line Item Number
    wa_document_line_item_main-gl_account = '2480001067'."HKONT - Account
    wa_document_line_item_main-item_text = 'ITEM 2'.     "SGTXT - Item Text
    wa_document_line_item_main-doc_type = space.         "BLART - Document Type
    wa_document_line_item_main-comp_code = space.        "BUKRS - Company Code
    wa_document_line_item_main-pstng_date = '20080817'.  "BUDAT - Posting Date
    wa_document_line_item_main-alloc_nmbr = space.       "ZUONR - Allocation Number
    wa_document_line_item_main-costcenter = space.       "KOSTL - Cost Center
    wa_document_line_item_main-profit_ctr = '1999999'.   "PRCTR - Profit Center
    wa_document_line_item_main-de_cre_ind = 'D'.         "NEWBS - Posting Key / Debit Credit Indicator
    wa_document_line_item_main-trade_id = space.         "RASSC - Company ID Of Trading Partner
    Fill Amount Portion Of Accounting Line Item
    wa_document_line_item_amnt-itemno_acc = '1'.          "Accounting Document Line Item Number
    wa_document_line_item_amnt-curr_type = '00'.          "Currency Type
    wa_document_line_item_amnt-currency = 'USD'.          "WAERS - Currency Key
    wa_document_line_item_amnt-amt_doccur = '100'.        "WRBTR - Amount In Document Currency Type
    Create Enhancement Portion Of Accounting Line Item
    wa_document_line_item_enhn-field1+0(3) = '001'.     "Line of Bus YYLOB
    wa_document_line_item_enhn-field1+3(3) = '008'.     "Customer Segm YYCSG
    wa_document_line_item_enhn-field1+6(5) = space.     "Product Group
    wa_document_line_item_enhn-field1+11(2) = space.    "Distribution Ch
    wa_document_line_item_enhn-field1+13(4) = space.    "Maturity Year
    wa_document_line_item_enhn-field1+17(3) = space.    "Insurance Type
    wa_document_line_item_enhn-field1+20(4) = space.    "Accident Year
    wa_document_line_item_enhn-field1+24(6) = space.    "Product
    wa_document_line_item_enhn-field1+30(3) = space.    "Source
    wa_document_line_item_enhn-field1+33(22) = space.   "DI Run Name
    wa_document_line_item_enhn-field1+55(1) = space.     "DI Run Type
    wa_document_line_item_enhn-field1+56(5) = space.    "DI Run Number
    wa_document_line_item_enhn-field1+61(16) = space.   "DI Journal ID
    wa_document_line_item_enhn-field1+77(5) = space.    "DI Journal Link
    wa_document_line_item_enhn-field1+82(22) = space.   "DI File Name
    APPEND: wa_document_line_item_main TO t_document_line_item_main,
            wa_document_line_item_enhn TO t_document_line_item_enhn,
            wa_document_line_item_amnt TO t_document_line_item_amnt.
    Fill Next Line Item #2
    CLEAR: wa_document_line_item_main, wa_document_line_item_enhn, wa_document_line_item_amnt.
    Fill Main Portion Of Accounting Line Item
    wa_document_line_item_main-itemno_acc = '2'.         "Accounting Document Line Item Number
    wa_document_line_item_main-gl_account = '2480001067'."HKONT - Account
    wa_document_line_item_main-item_text = 'ITEM 3'.     "SGTXT - Item Text
    wa_document_line_item_main-doc_type = space.         "BLART - Document Type
    wa_document_line_item_main-comp_code = space.        "BUKRS - Company Code
    wa_document_line_item_main-pstng_date = '20080817'.  "BUDAT - Posting Date
    wa_document_line_item_main-alloc_nmbr = space.       "ZUONR - Allocation Number
    wa_document_line_item_main-costcenter = space.       "KOSTL - Cost Center
    wa_document_line_item_main-profit_ctr = '1999999'.   "PRCTR - Profit Center
    wa_document_line_item_main-de_cre_ind = 'C'.        "NEWBS - Posting Key / Debit Credit Indicator
    wa_document_line_item_main-trade_id = space.         "RASSC - Company ID Of Trading Partner
    Fill Enhancement Portion Of Accounting Line Item
    Fill Amount Portion Of Accounting Line Item
    wa_document_line_item_amnt-itemno_acc = '2'.          "Accounting Document Line Item Number
    wa_document_line_item_amnt-curr_type = '00'.          "Currency Type
    wa_document_line_item_amnt-currency = 'USD'.          "WAERS - Currency Key
    wa_document_line_item_amnt-amt_doccur = '100'.        "WRBTR - Amount In Document Currency Type
    Create Enhancement Portion Of Accounting Line Item
    wa_document_line_item_enhn-field1+0(3) = '001'.     "Line of Bus YYLOB.
    wa_document_line_item_enhn-field1+3(3) = '008'.     "Customer Segm YYCSG
    wa_document_line_item_enhn-field1+6(5) = space.     "Product Group
    wa_document_line_item_enhn-field1+11(2) = space.    "Distribution Ch
    wa_document_line_item_enhn-field1+13(4) = space.    "Maturity Year
    wa_document_line_item_enhn-field1+17(3) = space.    "Insurance Type
    wa_document_line_item_enhn-field1+20(4) = space.    "Accident Year
    wa_document_line_item_enhn-field1+24(6) = space.    "Product
    wa_document_line_item_enhn-field1+30(3) = space.    "Source
    wa_document_line_item_enhn-field1+33(22) = space.   "DI Run Name
    wa_document_line_item_enhn-field1+55(1) = space.    "DI Run Type
    wa_document_line_item_enhn-field1+56(5) = space.    "DI Run Number
    wa_document_line_item_enhn-field1+61(16) = space.   "DI Journal ID
    wa_document_line_item_enhn-field1+77(5) = space.    "DI Journal Link
    wa_document_line_item_enhn-field1+82(22) = space.   "DI File Name
    APPEND: wa_document_line_item_main TO t_document_line_item_main,
            wa_document_line_item_enhn TO t_document_line_item_enhn,
            wa_document_line_item_amnt TO t_document_line_item_amnt.
    ****FILL THE BDC TABLE*******************************************************
    LOOP AT t_document_line_item_main INTO wa_document_line_item_main.
      Move: wa_document_line_item_main-gl_account TO wa_bdc_document_item_main-v_HKONT,
            wa_document_line_item_main-item_text TO wa_bdc_document_item_main-v_SGTXT,
            wa_document_line_item_main-profit_ctr TO wa_bdc_document_item_main-v_PRCTR,
            wa_document_line_item_main-de_cre_ind TO wa_bdc_document_item_main-v_SHKZG.
      Read table t_document_line_item_amnt index sy-tabix into wa_document_line_item_amnt.
      IF sy-subrc = 0.
        Move : wa_document_line_item_amnt-currency TO wa_bdc_document_item_main-v_WAERS,
               wa_document_line_item_amnt-amt_doccur TO wa_bdc_document_item_main-v_WRBTR.
      ENDIF.
      Read table t_document_line_item_enhn index sy-tabix into wa_document_line_item_enhn.
      IF sy-subrc = 0.
        Move : wa_document_line_item_enhn-field1+0(3) TO wa_bdc_document_item_main-v_YYLOB,
               wa_document_line_item_enhn-field1+3(3) TO wa_bdc_document_item_main-v_YYCSG.
      ENDIF.
      APPEND wa_bdc_document_item_main TO t_bdc_document_item_main.
      CLEAR: wa_bdc_document_item_main.
    ENDLOOP.          " BDC Table.
    ************************BDC PROGRAM**************************************************************
    perform bdc_dynpro  TABLES t_bdcdata    using 'SAPLACHD' '1000'.
    perform bdc_field TABLES t_bdcdata       using 'BDC_CURSOR'
                                  'BKPF-BUKRS'.
    perform bdc_field  TABLES t_bdcdata      using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field TABLES t_bdcdata       using 'BKPF-BUKRS'
                                  wa_document_header-comp_code.
    perform bdc_dynpro  TABLES t_bdcdata     using 'SAPMF05A' '1001'.
    perform bdc_field  TABLES t_bdcdata      using 'BDC_OKCODE'
                                  '=PBBP'.
    perform bdc_field  TABLES t_bdcdata      using 'ACGL_HEAD-BLDAT'
                                  wa_document_header-doc_date.
    perform bdc_field   TABLES t_bdcdata     using 'ACGL_HEAD-WAERS'
                                  'USD'.
    perform bdc_field  TABLES t_bdcdata      using 'ACGL_HEAD-BUDAT'
                                  wa_document_header-pstng_date.
    perform bdc_field  TABLES t_bdcdata      using 'ACGL_HEAD-XBLNR'
                                  wa_document_header-ref_doc_no.
    perform bdc_field  TABLES t_bdcdata      using 'ACGL_HEAD-BKTXT'
                                  wa_document_header-header_txt.
    perform bdc_field  TABLES t_bdcdata      using 'ACGL_HEAD-BLART'
                                  wa_document_header-doc_type.
    perform bdc_field  TABLES t_bdcdata      using 'BDC_CURSOR'
                                  'ACGL_ITEM_GEN-GEN_CHAR2(02)'.
    LOOP AT t_bdc_document_item_main INTO wa_bdc_document_item_main.
      idx = idx + 1.
      ch3 = idx.
      CONCATENATE 'ACGL_ITEM-HKONT('ch3')' INTO FNAME.
      perform bdc_field  TABLES t_bdcdata      using fname
                               wa_bdc_document_item_main-v_HKONT.
      CONCATENATE 'ACGL_ITEM-SHKZG('ch3')' INTO FNAME.
      IF wa_bdc_document_item_main-v_SHKZG = 'C'.
        var_SHKZG = 'H'.
      ELSEIF wa_bdc_document_item_main-v_SHKZG = 'D'.
        var_SHKZG = 'S'.
      ENDIF.
      perform bdc_field  TABLES t_bdcdata      using fname
                                    var_SHKZG.
      CONCATENATE 'ACGL_ITEM-WRBTR('ch3')' INTO FNAME.
      WRITE: wa_bdc_document_item_main-v_WRBTR to amount.
      perform bdc_field  TABLES t_bdcdata      using FNAME
                       wa_bdc_document_item_main-v_WRBTR.
                                   amount.
      CONCATENATE 'ACGL_ITEM-SGTXT('ch3')' INTO FNAME.
      perform bdc_field  TABLES t_bdcdata      using FNAME
                                    wa_bdc_document_item_main-v_SGTXT.
      CONCATENATE 'ACGL_ITEM-PRCTR('ch3')' INTO FNAME.
      perform bdc_field   TABLES t_bdcdata     using FNAME
                                    wa_bdc_document_item_main-v_PRCTR.
      CONCATENATE 'ACGL_ITEM_GEN-GEN_CHAR1('ch3')' INTO FNAME.
      perform bdc_field  TABLES t_bdcdata      using FNAME
                                    wa_bdc_document_item_main-v_YYLOB.
      CONCATENATE 'ACGL_ITEM_GEN-GEN_CHAR2('ch3')' INTO FNAME.
      perform bdc_field  TABLES t_bdcdata      using FNAME
                                    wa_bdc_document_item_main-v_YYCSG.
      options-dismode = 'A'.
      options-nobinpt = 'X'.
    endloop.
    CALL TRANSACTION 'FV50' USING t_bdcdata MESSAGES INTO
    t_messages OPTIONS FROM options.
    *if sy-subrc = 0.
      Retrieve error messages
    LOOP AT t_messages WHERE msgtyp = 'E'.
        Builds actual message based on info returned from Call transaction
      CALL FUNCTION 'MESSAGE_TEXT_BUILD'
        EXPORTING
          msgid               = t_messages-msgid
          msgnr               = t_messages-msgnr
          msgv1               = t_messages-msgv1
          msgv2               = t_messages-msgv2
          msgv3               = t_messages-msgv3
          msgv4               = t_messages-msgv4
        IMPORTING
          message_text_output = w_textout.
    ENDLOOP.
    Start new screen
    FORM bdc_dynpro TABLES it_bdcdata STRUCTURE bdcdata USING program
    dynpro.
      DATA: wa_bdcdata TYPE bdcdata.
      wa_bdcdata-program = program.
      wa_bdcdata-dynpro = dynpro.
      wa_bdcdata-dynbegin = 'X'.
      APPEND wa_bdcdata TO it_bdcdata.
    ENDFORM. "BDC_DYNPRO
    Insert field
    FORM bdc_field TABLES it_bdcdata STRUCTURE bdcdata USING fnam fval.
      DATA: wa_bdcdata TYPE bdcdata.
      IF fval <> space.
        CLEAR wa_bdcdata.
        wa_bdcdata-fnam = fnam.
        wa_bdcdata-fval = fval.
        APPEND wa_bdcdata TO it_bdcdata.
      ENDIF.
    ENDFORM.                    "BDC_FIELD
    Title was edited by:
            Alvaro Tejada Galindo

    HI,
      The code looks ok...
    take a internal table for messages.
    data : begin of itab occurs 0,
             message(100) type c,
             end of itab.
    put this after
    Retrieve error messages
    LOOP AT t_messages WHERE msgtyp = 'E'.
    Builds actual message based on info returned from Call transaction
    CALL FUNCTION 'MESSAGE_TEXT_BUILD'
    EXPORTING
    msgid = t_messages-msgid
    msgnr = t_messages-msgnr
    msgv1 = t_messages-msgv1
    msgv2 = t_messages-msgv2
    msgv3 = t_messages-msgv3
    msgv4 = t_messages-msgv4
    IMPORTING
    message_text_output = w_textout.
    <b>itab-message = w_textout.
    append itab</b>.
    ENDLOOP.

  • Error handling for master data with direct update

    Hi guys,
    For master data with flexible update, error handling can be defined in InfoPackege, and if the load is performed via PSA there are several options - clear so far. But what about direct update...
    But my specific question is: If an erroneous record (e.g invalid characters) occur in a master data load using direct update, this will set the request to red. But what does this mean in terms of what happens to the other records of the request (which are correct) are they written to the master data tables, so that they can be present once the masterdata is activated, or are nothing written to masterdata tables if a single record is erroneous???
    Many thanks,
    / Christian

    Hi Christian -
    Difference between flexible upload & Direct upload is that direct upload does not have Update Rules, direct upload will have PSA as usual & you can do testing in PSA.
    second part when you load master data - if error occurs all the records for that request no will be status error so activation will not have any impact on it i.e. no new records from failed load will be available.
    hope it helps
    regards
    Vikash

  • Custom Error handling in DataSheet View with pop-up message or label controls or HTML

    I have a requirement in which DataSheet view is used to bulk edit or input list items and handle validations while in the process.
    We have validations done in event recievers before creating the list item. But could not provide a pop up or message with summary of all validation errors. these are buiness custom validations.
    Is there a way to custom error handle datasheet view? Is there a way to invoke a UI in context from event recievers?

    I have a requirement in which DataSheet view is used to bulk edit or input list items and handle validations while in the process.
    We have validations done in event recievers before creating the list item. But could not provide a pop up or message with summary of all validation errors. these are buiness custom validations.
    Is there a way to custom error handle datasheet view? Is there a way to invoke a UI in context from event recievers?

  • Error Handling On a Page with a Report

    Hi guys.
    I have a page with a report region on it. The report is based on an External Table.
    If i load a file that does not conform to the format the External Table definition is expecting, I Get an 'ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-30653: reject limit reached' error.
    I am happy that an error is generated but my question is this?
    How can I handle this exception and others when there is just a report region on a page.
    I basically wish to capture 'ORA-30653: reject limit reached' and display an friendly error message to the user in the report region.
    Any help would be most welcome.
    Duncan

    One way to handle this that I have seen is
    a. configure your external table with REJECT LIMIT UNLIMITED
    b. specify a BADFILE badfile.txt.
    c. Create another external table on that badfile.txt with the same access parameters as your original table but specify all the columns as VARCHAR2(4000), so nothing is rejected.
    d. Create another report region on the external table on badfile.txt, call it "Load errors"
    So, you would have 2 report regions on the page, one would read your datafile and the other would read the badfile.
    Hope this helps.

  • Error Handling in BDC....?

    Hi Gurus,
    I have scenario here where in I have written a BDC program for transaction FV50L to park an FI document and then later made it is a function module.In this function module one of the TABLES parameter is BAPIRET2 to return error messages to the calling program..
    Actually this FM is RFC enabled so that it can be called from non sap system...
    Now i am not sure how to transfer the error messages from the BDC program to this BAPIRET2 table...
    Can any of u gurus provide me detail insight into this how it can be done....code samples will be helpful as i am still in a learning phase of ABAP...
    Points will be awarded.
    Cheers: Jim

    hi Jimmy..
    You can do this in case of Call transaction method only..
    Sample code:
    Using BDCMSGCOLL Structure we have to declare an itab.
    DATA : IT_MSG LIKE TABLE OF BDCMSGCOLL .
    DATA : V_MSG TYPE STRING . 
    Then We can catch the messages using:
    CALL TRANSACTION 'MK01'
    USING IT_BDCDATA
    MODE 'N'
    MESSAGES INTO IT_MSG.  "stores the messages
    IF sy-subrc ne 0.
    LOOP AT IT_MSG INTO WA_MSG .
    **WHERE MSGTYP = 'E' OR MSGTYP = 'A'. "if you want only error messages
    CALL FUNCTION 'FORMAT_MESSAGE'  "To get the Message text into V_MSG.
    IT_BAPIRET2-MSGTYP = IT_MSG-MSGTYP.
    IT_BAPIRET2-MSGID = IT_MSG-MSGTYP.
    IT_BAPIRET2-MESSAGE = V_MSG.
    APPEND IT_BAPIRET2.
    CLEAR IT_BAPIRET2.
    ENDLOOP.
    REWARD IF HELPFUL.

  • Error after doing bdc recording  with MIRO

    hi everybody,
    iam using call transaction for MIRO. in that recording is not doing properly. problem is - after doing recording ,the process is not moving to another tabs(SUB SCREENS) like payments,details.
    it gives error.
    error is 'invfo-bktxt does not exists in the screen saplmr1m 6000.'
    Please help any body for this.

    Hi Kumar,
    Have you got solution for this problem?We've got the same problem over here and we getting solution, if you have the solution could you send it?
    Thanks,
    Mário

  • Receiver Feedback with no Error Handling (Input Design Requested)

    Hi Community,
    Today we have a pretty standard integration scenario that takes in flat files and converts them to Idocs for target SAP systems.  We are looking to redesign the current IDoc interface (posts a customized FIDCC1) under the principle that IDocs in errors on target are always corrected by a change in the source, so essentially we want to report errors back to the source and completely delete the IDoc.  I guess this looks like a synchronous call?, but I want to remain as loosely coupled for this.  Since we also process these files in batches (i.e. each file contains 1 to many invoices), we would like to return the results back to the source based on each file.  For example, the message back to the source (in email so a user can act on it, not a system) could be:
    a) file failed because structure is incorrect (like an XSD type check).
    or of the file makes it through XI,
    b) list of invoices failed because xxx is incorrect and list of invoices that processed.
    We are open to using proxies, any kind of IDoc error handling that could do this, workflows, status idocs, etc.  Every option is on the table. 
    Thanks!
    Peter

    peter
    if u are open to proxes then u might haveone interface that will send the data to proxy and thru proxy u update the idoc....if idoc goes fpor an error u can have another interface triggered that will update/delete the soruce data...for this u might need to pass the soruce files details to proxy and back

  • How to perform Error Handling in this Bdc Code

    Hi,
    I had created this BDC for the tcode MB1B and i want to know how to perform the ERROR HANDLING in it ..
    Plzz provide me guidelines for doing it . here's d code:-
    report ZBDC_MB1B
           no standard page heading line-size 255.
    include bdcrecx1.
    data: begin of record OCCURS 0,
          WERKS_001(004),     "Plant
          MATNR_002(018),     "ItemId
          ERFMG_003(013),     "Quantity in Unit of Entry
          ERFME_004(003),     "Unit of Entry
          LGORT_005(004),     "Storage Location
          CHARG_006(010),     "BatchId
          KDAUF_007(010),     "Sales Order Number
          KDPOS_008(006),     "Item Number in Sales Order
          end of record.
    PARAMETERS : P_FILNAM LIKE RLGRAP-FILENAME.
      initialization.
      CTUMODE = 'A'.
      CUPDATE = 'A'.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILNAM.
      CALL FUNCTION 'WS_FILENAME_GET'
       EXPORTING
         MASK                   = ',. '
         MODE                   = 'O'
         IMPORTING
         FILENAME                 = P_FILNAM
       EXCEPTIONS
         INV_WINSYS             = 1
         NO_BATCH               = 2
         SELECTION_CANCEL       = 3
         SELECTION_ERROR        = 4
         OTHERS                 = 5
      IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    start-of-selection.
    CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
         FILENAME                      = P_FILNAM
         FILETYPE                      = 'DAT'
        TABLES
          DATA_TAB                     = RECORD
       EXCEPTIONS
         CONVERSION_ERROR              = 1
         FILE_OPEN_ERROR               = 2
         FILE_READ_ERROR               = 3
         INVALID_TYPE                  = 4
         NO_BATCH                      = 5
         UNKNOWN_ERROR                 = 6
         INVALID_TABLE_WIDTH           = 7
         GUI_REFUSE_FILETRANSFER       = 8
         CUSTOMER_ERROR                = 9
         NO_AUTHORITY                  = 10
         OTHERS                        = 11
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT RECORD.
      BEGIN OF SCREEN 1
    perform bdc_dynpro      using 'SAPMM07M' '0400'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RM07M-SOBKZ'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *perform bdc_field       using 'MKPF-BLDAT'
                                 '22.12.2008'.
    *perform bdc_field       using 'MKPF-BUDAT'
                                 '22.12.2008'.
    perform bdc_field       using 'RM07M-BWARTWA'
                                  '411'.
    perform bdc_field       using 'RM07M-SOBKZ'
                                  'E'.
    perform bdc_field       using 'RM07M-WERKS'
                                  RECORD-WERKS_001.             "Plant
    perform bdc_field       using 'XFULL'
                                  'X'.
    perform bdc_field       using 'RM07M-WVERS2'
                                  'X'.
      BEGIN OF SCREEN 2
    perform bdc_dynpro      using 'SAPMM07M' '0421'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSEG-CHARG(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MSEG-MATNR(01)'
                                  RECORD-MATNR_002.             "ITEMID
    perform bdc_field       using 'MSEG-ERFMG(01)'
                                  RECORD-ERFMG_003.             "QTY.
    perform bdc_field       using 'MSEG-ERFME(01)'
                                  RECORD-ERFME_004.             "UOM
    perform bdc_field       using 'MSEG-LGORT(01)'
                                  RECORD-LGORT_005.             "ST.LOC
    perform bdc_field       using 'MSEG-CHARG(01)'
                                  RECORD-CHARG_006.             "BATCHID
    perform bdc_field       using 'MSEGK-MAT_KDAUF'
                                  RECORD-KDAUF_007.             "S.O.
    perform bdc_field       using 'MSEGK-MAT_KDPOS'
                                  RECORD-KDPOS_008.             "S.O.LINE ITEM
    perform bdc_field       using 'DKACB-FMORE'
                                  'X'.
      BEGIN OF SCREEN 3
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'DKACB-FMORE'
                                  'X'.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_dynpro      using 'SAPMM07M' '0421'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSEG-ERFMG(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'DKACB-FMORE'
                                  'X'.
      BEGIN OF SCREEN 4
    perform bdc_dynpro      using   'SAPLKACB' '0002'.
    perform bdc_field       using      'BDC_OKCODE'
                                                '=ENTE'.
    perform bdc_transaction using 'MB1B'.
    ENDLOOP.

    hi,
    check this code in bold letters.
    INCLUDE BDCRECX1.
    TABLES : MARC.
    TYPES : BEGIN OF TY_UPLOAD,
            MATNR TYPE MARA-MATNR,
            WERKS TYPE MARC-WERKS,
            STEUC TYPE MARC-STEUC,
            END OF TY_UPLOAD.
    TYPES : BEGIN OF TY_MARC,
            MATNR TYPE MARA-MATNR,
            WERKS TYPE MARC-WERKS,
            END OF TY_MARC.
    TYPES : BEGIN OF TY_MTART,
            MATNR TYPE MARA-MATNR,
            MTART TYPE MARA-MTART,
            END OF TY_MTART.
    DATA : T_MARC TYPE STANDARD TABLE OF TY_MARC,
         : T_UPLOAD TYPE STANDARD TABLE OF TY_UPLOAD,
         : T_BASIC TYPE STANDARD TABLE OF TY_UPLOAD,
         : T_SALES TYPE STANDARD TABLE OF TY_UPLOAD,
         : T_ERROR TYPE STANDARD TABLE OF TY_UPLOAD.
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
           IT_BDCDATA_VIEW LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
           IT_DATA(3200) OCCURS 0 WITH HEADER LINE,
           IT_FIELD(3200) OCCURS 0 WITH HEADER LINE,
           IT_BDCMSG TYPE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA GI_MSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA : CHAR1(500),
          CHAR2(500),
          CHAR3 TYPE STRING,
          V_SELECTION TYPE STRING.  " For View Selection
    DATA : W_MARC TYPE TY_MARC,
           WA_UPLOAD TYPE TY_UPLOAD,
           WA_BASIC TYPE TY_UPLOAD,
           WA_SALES TYPE TY_UPLOAD,
           WA_ERROR TYPE TY_UPLOAD,
           WA_MTART TYPE TY_MTART.
    DATA : VAR TYPE N,
           VAR1 TYPE STRING.
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.   "SELECTION SCREEN
    PARAMETERS: P_FNAM LIKE RLGRAP-FILENAME.
    PARAMETERS: P_BAS LIKE RLGRAP-FILENAME.
    PARAMETERS: P_SAL LIKE RLGRAP-FILENAME.
    PARAMETERS: P_ERR LIKE RLGRAP-FILENAME.
    SELECTION-SCREEN : END OF BLOCK B1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAM.
      PERFORM SEARCH USING P_FNAM.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BAS.
      PERFORM SEARCH USING P_BAS.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_SAL.
      PERFORM SEARCH USING P_SAL.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_ERR.
      PERFORM SEARCH USING P_ERR.
    *&      Form  SEARCH
          text
         -->PFNAME     text
    FORM SEARCH USING PFNAME.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          STATIC    = 'X'
        CHANGING
          FILE_NAME = PFNAME.
    ENDFORM.                    "SEARCH
    START-OF-SELECTION.
      PERFORM UPLOAD_PROCESS USING P_FNAM.
      PERFORM OPEN_GROUP.
      PERFORM PROCESS.
      PERFORM CLOSE_GROUP.
      IF NOT T_BASIC[] IS INITIAL.
        PERFORM DOWNLOAD TABLES T_BASIC[] USING P_BAS .
      ENDIF.
      IF NOT T_SALES[] IS INITIAL.
        PERFORM DOWNLOAD TABLES T_SALES[] USING P_SAL .
      ENDIF.
      IF NOT T_ERROR[] IS INITIAL.
        PERFORM DOWNLOAD TABLES T_ERROR[] USING P_ERR.
      ENDIF.
    *&      Form  PROCESS
          text
    FORM PROCESS.
      LOOP AT T_UPLOAD INTO WA_UPLOAD.
        PERFORM CONV_ROUTINE  USING WA_UPLOAD-MATNR
                            CHANGING WA_UPLOAD-MATNR.
        SELECT COUNT(*) FROM MARA WHERE MATNR = WA_UPLOAD-MATNR.
        IF SY-SUBRC NE 0.
          MOVE-CORRESPONDING  WA_UPLOAD TO WA_BASIC.
          APPEND WA_BASIC TO T_BASIC.
          CLEAR WA_BASIC.
          CONTINUE.
        ENDIF.
        SELECT COUNT(*) FROM MARC WHERE MATNR = WA_UPLOAD-MATNR
                                        AND WERKS = WA_UPLOAD-WERKS
                                        AND PSTAT LIKE '%V%'.
        IF SY-SUBRC NE 0.
          MOVE-CORRESPONDING  WA_UPLOAD TO WA_SALES.
          APPEND WA_SALES TO T_SALES.
          CLEAR WA_SALES.
          CONTINUE.
        ENDIF.
        CLEAR : WA_MTART.
        SELECT SINGLE MATNR MTART FROM MARA INTO WA_MTART WHERE MATNR = WA_UPLOAD-MATNR.
        PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0060'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RMMG1-MATNR'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=AUSW'.
        PERFORM BDC_FIELD       USING 'RMMG1-MATNR'
                                      WA_UPLOAD-MATNR.
        CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW'     " Function module
        EXPORTING
          MATERIAL                  = WA_UPLOAD-MATNR  " Material number
          MATERIALART               = WA_MTART-MTART          " Material Type
          SELECTION                 = 'V'              "
          TCODE                     = 'MM02'           " Tcode where view's are called.
        TABLES
          BTCI_D0070                = IT_BDCDATA_VIEW
        EXCEPTIONS
          MATERIAL_NOT_FOUND        = 1
          MATERIAL_NUMBER_MISSING   = 2
          MATERIAL_TYPE_MISSING     = 3
          MATERIAL_TYPE_NOT_FOUND   = 4
          NO_ACTIVE_DYNPRO_SELECTED = 5
          NO_AUTHORITY              = 6
          OTHERS                    = 7.
        READ TABLE IT_BDCDATA_VIEW WITH KEY FVAL  = 'X'.
        IF SY-SUBRC = 0.
          V_SELECTION = IT_BDCDATA_VIEW-FNAM.
        ELSE.
          CONTINUE.
        ENDIF.
        VAR = IT_BDCDATA_VIEW-FNAM+17(2).
        VAR = VAR + 3.
        CONCATENATE 'MSICHTAUSW-KZSEL(' '0' VAR ')' INTO VAR1.
        PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0070'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'MSICHTAUSW-DYTXT(06)'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM BDC_FIELD       USING VAR1
                                       'X'.
        CLEAR VAR.
        CLEAR VAR1.
       PERFORM BDC_FIELD       USING 'MSICHTAUSW-KZSEL(06)'
                                     'X'.
        PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0080'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RMMG1-VKORG'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM BDC_FIELD       USING 'RMMG1-WERKS'
                                      WA_UPLOAD-WERKS.
        PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '4004'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=BU'.
       PERFORM BDC_FIELD       USING 'MAKT-MAKTX'
                                     'MTI_ESE_HALB_01'.
        PERFORM BDC_FIELD       USING 'MARC-STEUC'
                                      WA_UPLOAD-STEUC.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'MARC-HERKR'.
        PERFORM BDC_FIELD       USING 'MARC-HERKL'
                                      'IN'.
        PERFORM BDC_FIELD       USING 'MARC-HERKR'
                                      'MAH'.
        PERFORM BDC_TRANSACTION USING 'MM02'.
    move the error record into seperate internal table nad down load it ****
        IF MESSTAB-MSGTYP = 'E'.
          MOVE-CORRESPONDING WA_UPLOAD TO WA_ERROR.
          APPEND WA_ERROR TO T_ERROR.
          CLEAR WA_ERROR.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "PROCESS
    *&      Form  UPLOAD_PROCESS
          text
         -->PFNAME     text
    FORM UPLOAD_PROCESS USING PFNAME.
      DATA : PFNAME1 TYPE STRING.
      PFNAME1 = PFNAME.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME            = PFNAME1
          FILETYPE            = 'ASC'
          HAS_FIELD_SEPARATOR = 'X'
        TABLES
          DATA_TAB            = T_UPLOAD[].
      IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    "UPLOAD_PROCESS
    *&      Form  CONV_ROUTINE
          text
         -->P_INPUT    text
         -->P_OUTPUT   text
    FORM CONV_ROUTINE   USING    P_INPUT
                     CHANGING P_OUTPUT.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = P_INPUT
        IMPORTING
          OUTPUT = P_OUTPUT.
    ENDFORM.                    "CONV_ROUTINE
    *&      Form  DOWNLOAD
          text
         -->GI_FINAL   text
         -->PFNAME     text
    FORM DOWNLOAD TABLES
                  GI_FINAL
                         USING  PFNAME .
      DATA : FNAME TYPE STRING.
      FNAME = PFNAME.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                        = FNAME
          FILETYPE                        = 'DAT'
         WRITE_FIELD_SEPARATOR           = 'x'
            HEADER                          = '00'
          IMPORTING
            FILELENGTH                      =
        TABLES
          DATA_TAB                        =  GI_FINAL[]
          FIELDNAMES                      = GI_FIELDNAMES[]
      IF SY-SUBRC = 0.
        MESSAGE 'FILE DOWNLOADED SUCCESSFULLY' TYPE 'I'.
      ENDIF.
    ENDFORM.                    " DOWNLOAD
    Regards
    Siva Prasad

  • How to Handle pop up error message in BDC

    Hi Friends,
    Right now I am working with CA12 transaction.
    In this transaction for each group I need to update the details of the operations( lablour and overhead value).
    after updating the details, When I click on save I get a error pop up message saying 'Task contains the Erros, do you still want to save', if I click on the group it will be saved.
    When I am doing the same thing through recoring( SHDB ). I do no get the same pop up Which I got through transaction(CA12).
    but still user wants to save the details. user do want to be displayed as error.
    How to get the pop up?, so that I can click save eventhough it contains errors.
    Is it possible in BDC?
    Regards,
    Xavier.P

    Hi!
    Yes, it's though, however you might try to create the BDC recording with an another way.
    For example, don't click on the save button, but press the leave button (green left arrow). The transaction will give you a popup with the options: save yes, no, cancel. Hopefully this popup can be recorded with SHDB.
    Regards
    Tamá

  • Report and Alert don't executed in the error handler with a JMS proxy service

    Hi,
    I'm working with OSB 11.1.1.4.0 and I'm facing a problem with the error handler of my JMS proxy service.
    My error handler contains two main elements :
    - a Report action
    - an Alert with a JMS destination defined
    When the business service failed the message remain in the queue. It's the expected behavior.
    The problem is :
    - the report is missing
    - the alert is raised but missing in the JMS destination defined in the Alert setting.
    I've noticed if I add a Reply with Failure or Success, Report and Alert are successfully executed.
    Unfortunately the message don't remain in the JMS queue.
    What can I do in order to have my report/alert done and the JMS transaction rollback in order to keep the message in the queue ?
    I've already met this problem in the past with alsb v3 and my solution was to add Service Callout in the error handler in order to externalize these actions.
    This solution is not convenient and I hope another solution is possible.

    Inventorying workgroups can be difficult, especially when it comes to remote access and network security. Because workgroups are not centrally managed, some of the items discussed in this
    wiki article on preparing your workgroup environment may require you to visit each machine individually.
    For non-domain credentials, you do not use the <systemname>\<user> format, you simply enter the user name. Regarding how to enter the credentials, if you have an account that uses the same username and password on all machines and is an administrator
    on all of those machines, then you can enter that in the All computers credentials page of the wizard. You can also do this if they are different user names. However, if some machines have an account with the same user name, such as Administrator,
    but different passwords on each machine, you will need to use the Manually enter computer names discovery method, and then enter the information for each group or each machine.
    As you can tell, workgroup environments can quickly negate any benefit that the agentless inventory nature of MAP provides.
    Please remember to click "Mark as Answer" on the post that helps you, and to click
    "Unmark as Answer" if a marked post does not actually answer your question. Please
    VOTE as HELPFUL if the post helps you. This can be beneficial to other community members reading the thread.

  • LV7.1 Strange behavior with Automatic Error Handling occuring when it shouldn't [LV 7.1 Pro on WinXP for Tablet PC's]

    [LV 7.1 Pro on WinXP for Tablet PC's]
    I recently let a rather large LV app of mine run in the development environment while I was out for a couple of days. Upon returning I found that the app had hung for ~22 hours waiting for an answer to an Automatic Error Handling (AEH) dialog proclaiming an Error 7 in New File without any indication of the VI hierarchy that called New File.  I set about ensuring that AEH dialogs would not pop up and have not been able to discover how I could have possibly received one in the first place.
    Subsequent investigation revealed:
    Neither AEH option in Options>Block Diagrams were checked.
    Network problems had occurred around the time that the app had hung.  All file paths are network paths when running in the development environment, so the cause of the error was most likely valid, even if the AEH dialog appearance wasn't.
    My app has only one instance where the New File primitive is used by me. That subVI and all others above it in the hierarchy DO NOT have the AEH property enabled.  The error out cluster of New File in my subvi is wired.
    My app has three instances where New File is called from a vi.lib vi (Open/Create/Replace File.vi, Open Config Data.vi, and Prompt Web Browser Path.vi), none of which have the AEH property enabled.  Nor does any of their calling VI's.  All three instances also have their error out cluster wired.
    A utility to examine the AEH property of all VI's (with all top level and dynamic VI's loaded) in memory reported that only 1 of 308 vi's ( RGT Does File Exists.vi from the Report Generation Toolkit) had that property true.  That vi has no subVI's other than the File/Directory Info primitive and no calling VI's in common with any of the vi's that call New File, except a top level VI.
    As long as 'Enable automatic error handling dialogs' remains unselected in options>block diagram, I am unable to get an AEH dialog for either the New File or File/Directory Info primitives in a test VI with AEH property enabled and their error out clusters unwired no matter what invalid path I pass to the functions.  As soon as the options>block diagram>Enable AEH dialogs' is selected, both primitives fire AEH dialogs with no error out wired and don't when wired. i.e. works as advertised.
    In other words I can find no reason why I should have gotten the problem AEH dialog...
    I cannot afford for this app to hang because of a network problem, other portions of the app that were running concurrently correctly handled the error and, had the AEH dialog not appeared, the app would have made corrections or shutdown in an orderly fashion.
    Any ideas?

    Very good.
    Write Characters to File.vi>Open/Create/Replace File.vi>New File
    New File throws the error.  Open/Create/Replace strips the hierarchy from the source of the error.  Write Characters passes it to the General Error Handler.  I never looked above O/C/R file in the hierarchy except for enable automatic error handling property.  The tip-off should have been to realize that O/C/R file was stripping the hierarchy from the error and look above that. 
    The real irony is that Write Characters was being used to log error cluster data to an error log file...
    Save as... Copy without updating... the OEM 'Write Characters to File' is gone from this app.
    Thanx (a bunch)

  • Issue with SRDemo error handling

    Hi All,
    Glad the forums are back up and running. In debugging some error-handling issues in our own application, I found an issue in the error handling code of SRDemo. I thought I'd post the issue here, as many of us (myself included) use some SRDemo code as the basis for our own applications.
    The issue can be found in the oracle.srdemo.view.frameworkExt.SRDemoPageLifecycle class, specifically in the translateExceptionToFacesErrors method. I'll show the code that has the issue first, and explain the issue afterwards:
            if (numAttr > 0) {
                Iterator i = attributeErrors.keySet().iterator();
                while (i.hasNext()) {
                    String attrNameKey = (String)i.next();
                     * Only add the error to show to the user if it was related
                     * to a field they can see on the screen. We accomplish this
                     * by checking whether there is a control binding in the current
                     * binding container by the same name as the attribute with
                     * the related exception that was reported.
                    ControlBinding cb =
                        ADFUtils.findControlBinding(bc, attrNameKey);
                    if (cb != null) {
                        String msg = (String)attributeErrors.get(attrNameKey);
                        if (cb instanceof JUCtrlAttrsBinding) {
                            attrNameKey = ((JUCtrlAttrsBinding)cb).getLabel();
                        JSFUtils.addFacesErrorMessage(attrNameKey, msg);
                }Now, this bit of code attempts to be "smart" and only show error messages relating to attributes if those attributes are in fact displayed on the screen. It does so by using a utility method to find a control binding for the attribute name. There are two issues with this code, one obvious, and one that is a bit more subtle.
    The obvious issue: if there is a binding in the page definition, it doesn't necessarily mean that the attribute is shown on the screen. It's a good approximation, but not exact.
    The other issue is more subtle, and led to errors being "eaten," or not shown, in our application. The issue comes if you are using an af:table to display and update your data. In that case, the findControlBinding will not find anything for that attribute, since the attribute is contained within a table binding.
    Just posting this as a word to the wary.
    Best,
    john

    somehow, this message got in the wrong thread....
    Hi Frank,
    Yes, I simply scripted it out this way to contrast the behaviour if the first attribute was read-only vs not read-only. I found the issue on a page in our app that was simply drag-and-drop the VO from the data control on the page.
    It's quite annoying, because our particular use case that hit this error is a "save" button on the page. If the commit operation doesn't return any errors (and it doesn't in this use case!), we add a JSF message saying "save successful" - then the attribute errors are further added later in the page lifecycle, so we get 3 messages: "Save successful" and "Fix this error" and "Tried to set read-only attribute" - quite confusing to the end-user when the only message they should see is "fix this error."
    At any rate, the fix is to simply re-order the attributes in the page definition - that doesn't affect the UI at all, other than to fix this issue.
    John
    it was supposed to be something like:
    Hi Frank,
    Thanks for the reply. I was simply posting this here so that people who use the SRDemo application techniques as a basis for developing the same functionality in their own apps (like me) can be aware of the issue, and avoid lots of head-scratching to figure out "what happened to the error message?"
    John

  • How to Setup Forward Error Handling in PI Scenarios. Can you help me with the same with screen shots if possible?

    Dear all
    How to Setup Forward Error Handling in PI Scenarios. Can you help me with the same with screen shots if possible?
    Thanks
    Regards
    karan

    Hello
    These are the following errors
    1. Trace level="1" type="T">no interface action for sender or receiver found</Trace>
    2. <Trace level="1" type="System_Error">Application-Error exception return from pipeline processing!
    3.
    <Trace level="1" type="T">Application Error at Receiver... => ROLLBACK WORK</Trace>  
    <Trace level="1" type="T">System Error at Receiver... => ROLLBACK WORK</Trace>  
    <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_LOG_TO_PERSIST" />  
    <Trace level="1" type="System_Error">Application-Error exception return from pipeline processing!</
    Trace level="3" type="T">No persisting of message after plsrv call, because of config</Trace>Trace level="3" type="T">Error of the prevous version:</TraceTrace level="3" type="T">Error ID APPLICATION_ERROR</Trace>
    tThere are repeating errors also.
    TThanks
    Regards
    kkaran

  • Step by Step documents for Process Chain Error Handling with Screen Shots

    Hi
    Is anybody having Step By Step Documents for Process Chain Error Handling with Screen Shots ?. Please forward it to me to my e-mail [email protected] .  I will reward points to u immediately.
    bye
    Aamira Khan

    Hi,
    You can find lots of topic related to process chain issues in SDN.Please make a search in SDN.
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_library&query=process+chain&adv=true&sdn_author_name=&sdn_updated_on_comparator=ge&sdn_updated_on=&sortby=cm_rnd_rankvalue
    Regards.

Maybe you are looking for