<?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: BDC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/1695869#M305294</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai thanks&lt;/P&gt;&lt;P&gt; What r the parameters we hav to fill in format_message FM?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Nov 2006 06:00:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-07T06:00:24Z</dc:date>
    <item>
      <title>BDC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/1695865#M305290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After handling the errors how we will upload the error data into the db in call transaction?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 05:45:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/1695865#M305290</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T05:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: BDC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/1695866#M305291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;call FM  format_message&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 05:55:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/1695866#M305291</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T05:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: BDC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/1695867#M305292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The BDCMSGCOLL does not have the messages text. It has only the message type, number and message parameters. &lt;/P&gt;&lt;P&gt;You have to read the message text. (recall that the database table T100 stores all the messages.) &lt;/P&gt;&lt;P&gt;There are more than one method of doing this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following is the psuedocode for one of the methods. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP for the internal table IT1 which has data value from flat file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call transcation using.... &lt;/P&gt;&lt;P&gt;if SY-SUBRC &amp;lt;&amp;gt; 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read the dictionary table T100 FOR ALL ENTRIES in BDCMSGCOLL. &lt;/P&gt;&lt;P&gt;(also use the condition T100-SPRAS = SY-LANGU (the log on language. This is because you need only the message texts in English if the user is logged in English language) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF message type is E , then, transfer the contents of this particular error record to file x. (TRANSFER......) &lt;/P&gt;&lt;P&gt;( Ignore all other messages. Only consider type 'E' messages. Ignore other types of messages.) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(You can also store the message text from T100 and the error record in another internal table IT2) &lt;/P&gt;&lt;P&gt;..... &lt;/P&gt;&lt;P&gt;.... &lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of &lt;/P&gt;&lt;P&gt;" Read the dictionary table T100 FOR ALL ENTRIES in BDCMSGCOLL." &lt;/P&gt;&lt;P&gt;you can use the function module &lt;/P&gt;&lt;P&gt;WRITE_MESSAGES to read the messages. &lt;/P&gt;&lt;P&gt;Please refer to the function module for the list of parameters. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also refer FORMAT_MESSAGES function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Vibha Deshmukh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Plz mark useful answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;One request for you, for the queries that you have, if they have got satisfactry answers, please mark the useful answers as many abapers are helping you out.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 05:57:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/1695867#M305292</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T05:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: BDC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/1695868#M305293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;this code transfeers all the error msgs to an internal table..ERROR_ITAB

*&amp;amp;---------------------------------------------------------------------*
&amp;amp; Include zINCLUDE
*&amp;amp;---------------------------------------------------------------------*



*----------------------------------------------------------------------*
* data definition
*----------------------------------------------------------------------*
* Batchinputdata of single transaction
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
* messages of call transaction
DATA: MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
* error session opened (' ' or 'X')
DATA: E_GROUP_OPENED.
* message texts
TABLES: T100 , crhd.

data : itab_crhd like table of crhd with header line.
DATA : NODATA VALUE '/',
CTUMODE LIKE CTU_PARAMS-DISMODE VALUE 'N',
CUPDATE LIKE CTU_PARAMS-UPDMODE VALUE 'L'.

DATA : ERR TYPE STRING.
DATA : RC TYPE I,
successcnt type i value 0,
failcount type i value 0.
data : cntr type i value 0.



AT SELECTION-SCREEN.




FORM OPEN_DATASET USING P_DATASET.
OPEN DATASET P_DATASET
FOR INPUT IN TEXT MODE
ENCODING DEFAULT.
IF SY-SUBRC &amp;lt;&amp;gt; 0.
WRITE: / TEXT-E00, SY-SUBRC.
STOP.
ENDIF.
ENDFORM.

FORM CLOSE_DATASET USING P_DATASET.
CLOSE DATASET P_DATASET.
ENDFORM.


FORM BDC_TRANSACTION USING TCODE .
DATA: L_MSTRING(480).
DATA : BEGIN OF ERROR_ITAB OCCURS 0,
ERROR(50),
MSGTYP,
END OF ERROR_ITAB.
DATA : WA LIKE LINE OF ERROR_ITAB.
DATA: L_SUBRC LIKE SY-SUBRC.
REFRESH MESSTAB.
CALL TRANSACTION TCODE USING BDCDATA
MODE 'N'
UPDATE 'L'
MESSAGES INTO MESSTAB.
L_SUBRC = SY-SUBRC.


LOOP AT MESSTAB.
if messtab-msgtyp eq 'E'.
SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA
AND ARBGB = MESSTAB-MSGID
AND MSGNR = MESSTAB-MSGNR.
IF SY-SUBRC = 0.
L_MSTRING = T100-TEXT.
IF L_MSTRING CS '&amp;amp;1'.
REPLACE '&amp;amp;1' WITH MESSTAB-MSGV1 INTO L_MSTRING.
REPLACE '&amp;amp;2' WITH MESSTAB-MSGV2 INTO L_MSTRING.
REPLACE '&amp;amp;3' WITH MESSTAB-MSGV3 INTO L_MSTRING.
REPLACE '&amp;amp;4' WITH MESSTAB-MSGV4 INTO L_MSTRING.
ELSE.
REPLACE '&amp;amp;' WITH MESSTAB-MSGV1 INTO L_MSTRING.
REPLACE '&amp;amp;' WITH MESSTAB-MSGV2 INTO L_MSTRING.
REPLACE '&amp;amp;' WITH MESSTAB-MSGV3 INTO L_MSTRING.
REPLACE '&amp;amp;' WITH MESSTAB-MSGV4 INTO L_MSTRING.
ENDIF.
CONDENSE L_MSTRING.
MOVE L_MSTRING TO ERROR_ITAB-ERROR.
MOVE MESSTAB-MSGTYP TO ERROR_ITAB-MSGTYP.

APPEND ERROR_ITAB.

* delete error_itab where msgtyp = 'S'.
ELSE.
MOVE MESSTAB TO ERROR_ITAB-ERROR.
APPEND ERROR_ITAB.
ENDIF.


clear itab_crhd.
refresh itab_crhd.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 06:00:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/1695868#M305293</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T06:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: BDC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/1695869#M305294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai thanks&lt;/P&gt;&lt;P&gt; What r the parameters we hav to fill in format_message FM?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 06:00:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/1695869#M305294</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T06:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: BDC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/1695870#M305295</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;declare original internal table, success record internal table and error record internal table where the records which r not uploaded into d/b will be stored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : itab2 LIKE itab OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;       it_success LIKE itab OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;       it_error LIKE itab OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare a internal table table of structure bdcmsgcoll&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;       t_bdcmsgcoll LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after the call transaction statement call the function format_message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'FORMAT_MESSAGE'&lt;/P&gt;&lt;P&gt;         EXPORTING&lt;/P&gt;&lt;P&gt;              id        = sy-msgid&lt;/P&gt;&lt;P&gt;              lang      = '-D'&lt;/P&gt;&lt;P&gt;              no        = sy-msgno&lt;/P&gt;&lt;P&gt;              v1        = sy-msgv1&lt;/P&gt;&lt;P&gt;              v2        = sy-msgv2&lt;/P&gt;&lt;P&gt;              v3        = sy-msgv3&lt;/P&gt;&lt;P&gt;              v4        = sy-msgv4&lt;/P&gt;&lt;P&gt;         IMPORTING&lt;/P&gt;&lt;P&gt;              msg       = t_bdcmsgcoll&lt;/P&gt;&lt;P&gt;         EXCEPTIONS&lt;/P&gt;&lt;P&gt;              not_found = 1&lt;/P&gt;&lt;P&gt;              OTHERS    = 2.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move the records which r not uploaded into it_error and the records which r uploaded to it_success.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 06:36:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/1695870#M305295</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T06:36:35Z</dc:date>
    </item>
  </channel>
</rss>

