<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error Capturing in BDC Call Transaction Method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-capturing-in-bdc-call-transaction-method/m-p/1764348#M330636</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Also, it is a usual procedure to create a session for all the error records. This enables the user to rectify the records online. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Dec 2006 19:54:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-05T19:54:11Z</dc:date>
    <item>
      <title>Error Capturing in BDC Call Transaction Method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-capturing-in-bdc-call-transaction-method/m-p/1764344#M330632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How does the Errors in BDC Call Transactin is captured ....can you please give same examples of using BDCMSGCOLL and FORMAT_MESSAGES..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please explain clearly when to used these in real time..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankyou&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 05:55:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-capturing-in-bdc-call-transaction-method/m-p/1764344#M330632</guid>
      <dc:creator>former_member577909</dc:creator>
      <dc:date>2006-12-04T05:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error Capturing in BDC Call Transaction Method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-capturing-in-bdc-call-transaction-method/m-p/1764345#M330633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The syntax is - &lt;/P&gt;&lt;P&gt;call transaction &amp;lt;t_code&amp;gt; using &amp;lt;bdc_table&amp;gt; mode &amp;lt;A/E/N&amp;gt; update &amp;lt;A/S&amp;gt; messages into &amp;lt;it_messages&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this it_messages has to be of type BDCMSGCOLL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see the structure of the BDCMSGCOLL and read the messages accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, the errors are logged automatically when we create a batch input session and execute the session, while in case of Call Transaction .. it is not so.. hence we use this method of storing the messages into the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the call transaction ... You can loop on this internal table and see the messages.&lt;/P&gt;&lt;P&gt;It will give you all the details like the message type - Error, warning , Info or abend. &lt;/P&gt;&lt;P&gt;the message is split into 4 parts... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps. &lt;/P&gt;&lt;P&gt;Plz reward points if this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fell free to come back is some doubts are still unsolved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 06:14:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-capturing-in-bdc-call-transaction-method/m-p/1764345#M330633</guid>
      <dc:creator>former_member69765</dc:creator>
      <dc:date>2006-12-04T06:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Error Capturing in BDC Call Transaction Method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-capturing-in-bdc-call-transaction-method/m-p/1764346#M330634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this example from the documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BDCDATA TYPE TABLE OF BDCDATA. 

DATA: ITAB TYPE TABLE OF BDCMSGCOLL. 

DATA: PROGRAM LIKE SY-REPID, 

      WA_BDCDATA TYPE BDCDATA. 
WA_BDCDATA-PROGRAM  = 'SAPMS38M'. 
WA_BDCDATA-DYNPRO   = '0100'. 
WA_BDCDATA-DYNBEGIN = 'X'. 
APPEND WA_BDCDATA TO BDCDATA. 
CLEAR WA_BDCDATA. 
WA_BDCDATA-FNAM     = 'RS38M-PROGRAMM'. 
WA_BDCDATA-FVAL     = PROGRAM. 
APPEND WA_BDCDATA TO BDCDATA. 
... 
CALL TRANSACTION 'SE38'  USING BDCDATA  MODE 'N' 
                         MESSAGES INTO ITAB. 


Now formatting messages:
loop at itab.
       perform format_message USING itab-msgid itab-msgnr itab-msgv1 itab-msgv2 itab-msgv3 itab-msgv4.
endloop.

FORM FORMAT_MESSAGE  USING    P_MSGID LIKE SY-MSGID
                              P_MSGNO LIKE SY-MSGNO
                              P_MSGV1 LIKE SY-MSGV1
                              P_MSGV2 LIKE SY-MSGV2
                              P_MSGV3 LIKE SY-MSGV3
                              P_MSGV4 LIKE SY-MSGV4.
DATA: P_TEXT(100) TYPE C.
   CLEAR: P_TEXT.
   CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
      ID              = P_MSGID
      LANG            = SY-LANGU
      NO              = P_MSGNO
      V1              = P_MSGV1
      V2              = P_MSGV2
      V3              = P_MSGV3
      V4              = P_MSGV4
    IMPORTING
      MSG             = P_TEXT
    EXCEPTIONS
      NOT_FOUND       = 1
      OTHERS          = 2.
   IF SY-SUBRC EQ 0.
      WRITE:/ P_TEXT.
    ENDIF.

ENDFORM.                    " FORMAT_MESSAGE&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Dec 2006 06:17:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-capturing-in-bdc-call-transaction-method/m-p/1764346#M330634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-04T06:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error Capturing in BDC Call Transaction Method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-capturing-in-bdc-call-transaction-method/m-p/1764347#M330635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is hte sample code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;        call transaction  'ME22' using  it_bdc
                options from x_ctu_params
                messages into lt_message.

       clear w_success.
       if sy-subrc &amp;lt;&amp;gt; 0.
       w_success = 'N'.
       endif.

        loop at lt_message where msgtyp = 'E' or
                                 msgtyp = 'A'.
        endloop.
        if sy-subrc = 0.
          perform format_messages tables lt_message
                                  using lv_msg lv_lines.
*         To append error messages
          perform append_message tables lt_message
                                        return
                                 using  lv_msg.
        else.
          if w_success = 'N'.
          perform format_messages tables lt_message
                                  using lv_msg lv_lines.

          perform append_message_err tables lt_message
                                        return
                                 using  lv_msg.

          else.
          perform format_messages tables lt_message
                                  using lv_msg lv_lines.
*         To append success messages
          perform append_message tables lt_message
                                        return
                                 using  lv_msg.
          endif.
        endif.
        refresh: it_bdc,
                 lt_message.

      endat.
    endloop.
  endif.
form format_messages tables  pt_messages structure bdcmsgcoll
                     using   pv_msg pv_lines.

  clear : pv_lines,pt_messages,pv_msg.

  describe table pt_messages lines pv_lines.

  read table pt_messages index pv_lines.
  check not pt_messages-msgid is initial.
*-- Function module to format the message given
  call function 'FORMAT_MESSAGE'
       exporting
            id        = pt_messages-msgid
            lang      = sy-langu
            no        = pt_messages-msgnr
            v1        = pt_messages-msgv1
            v2        = pt_messages-msgv2
            v3        = pt_messages-msgv3
            v4        = pt_messages-msgv4
       importing
            msg       = pv_msg
       exceptions
            not_found = 1
            others    = 2.
  if sy-subrc &amp;lt;&amp;gt; 0.
    message id sy-msgid type sy-msgty number sy-msgno
            with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4  into pv_msg.
  endif.
endform.                    " format_messages
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 16:09:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-capturing-in-bdc-call-transaction-method/m-p/1764347#M330635</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T16:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error Capturing in BDC Call Transaction Method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-capturing-in-bdc-call-transaction-method/m-p/1764348#M330636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Also, it is a usual procedure to create a session for all the error records. This enables the user to rectify the records online. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vara&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 19:54:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-capturing-in-bdc-call-transaction-method/m-p/1764348#M330636</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T19:54:11Z</dc:date>
    </item>
  </channel>
</rss>

