<?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: batch-input in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400807#M193748</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data: message(50) type c.
data: messtab like bdcmsgcoll occurs 0 with header line.


....
* Call the transaction get message into messtab
  call transaction 'CS02' using bdcdata mode 'N'
                               update 'S'
                  &amp;lt;b&amp;gt;             messages into messtab.&amp;lt;/b&amp;gt;

* IF the transaction was not succesful then read the 
* messtab for the first Error message.
  if sy-subrc &amp;lt;&amp;gt; 0.
    read table messtab with key msgtyp = 'E'.
    if sy-subrc = 0.
* Once you get an error message, prepare the message,
* Meaning, convert it to something meaningful.
  call function 'MESSAGE_PREPARE'
       exporting
            language = sy-langu
            msg_id   = messtab-msgid
            msg_no   = messtab-msgnr
            msg_var1 = messtab-msgv1(50)
            msg_var2 = messtab-msgv2(50)
            msg_var3 = messtab-msgv3(50)
            msg_var4 = messtab-msgv4(50)
       importing
            msg_text = message.

* Write to list display
write:/ imat-matnr, imat-werks, imat-idnrk, message.

      endif.
  endif.


  clear: bdcdata, messtab.
  refresh: bdcdata, messtab.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to write all of the messages for a particular transaction, then all you need to do is LOOP at the MESSTAB instead of READ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Jul 2006 13:49:41 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-07-05T13:49:41Z</dc:date>
    <item>
      <title>batch-input</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400800#M193741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;i create a program that do batach-input.&lt;/P&gt;&lt;P&gt;i create an insternal table that hold the error that happend in the batch,but when i run the program in background i dont see the log.&lt;/P&gt;&lt;P&gt;how can i fix it that i can see the log in background&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;have a nice day&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 13:41:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400800#M193741</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-05T13:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: batch-input</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400801#M193742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are using CALL TRANSACTION and have the extension MESSAGES INTO ITAB?   IF so, you can use write out the message from ITAB to a list.  Then when ran in the background you can see the messages in the spool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 13:42:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400801#M193742</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-05T13:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: batch-input</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400802#M193743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just write the data of the internal table using WRITE statements. Then when the program is executed in background, you should be able to see the log in the spool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 13:43:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400802#M193743</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-05T13:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: batch-input</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400803#M193744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi yossi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goto transaction &amp;lt;b&amp;gt;SM35&amp;lt;/b&amp;gt; and select your session and click  the button &amp;lt;b&amp;gt;Logs&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 13:44:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400803#M193744</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-05T13:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: batch-input</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400804#M193745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using Batch input then the log will be visible in SM35 and if you are using CALL TRANSACTION you need to write extra logic in your application to capture the messages during the CALL TRANSACTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to use the addition MESSAGES INTO (msg_tab) in the CALL TRANSACTION statement and then use the entries in msg_tab to build the messages using MESSAGE_TEXT_BUILD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Kiran&lt;/P&gt;&lt;P&gt;*Please reward useful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 13:45:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400804#M193745</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-05T13:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: batch-input</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400805#M193746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;can u send me example&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 13:46:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400805#M193746</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-05T13:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: batch-input</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400806#M193747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi yossi,&lt;/P&gt;&lt;P&gt;if u r using CALL TRANSACTION.&lt;/P&gt;&lt;P&gt;EXAMPLE:&lt;/P&gt;&lt;P&gt;call transaction 'FK02' using it_bdcdata mode 'A'&lt;/P&gt;&lt;P&gt;                        update 'S'&lt;/P&gt;&lt;P&gt;                        messages into it_messages.&lt;/P&gt;&lt;P&gt;write:/ sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform format_messages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear it_bdcdata.&lt;/P&gt;&lt;P&gt;refresh it_bdcdata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form format_messages .&lt;/P&gt;&lt;P&gt;data: l_msg(100).&lt;/P&gt;&lt;P&gt;loop at it_messages.&lt;/P&gt;&lt;P&gt;call function 'FORMAT_MESSAGE'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;   id              = it_messages-msgid&lt;/P&gt;&lt;P&gt;   lang            = sy-langu&lt;/P&gt;&lt;P&gt;   no              = it_messages-msgnr&lt;/P&gt;&lt;P&gt;   v1              = it_messages-msgv1&lt;/P&gt;&lt;P&gt;   v2              = it_messages-msgv2&lt;/P&gt;&lt;P&gt;   v3              = it_messages-msgv3&lt;/P&gt;&lt;P&gt;   v4              = it_messages-msgv4&lt;/P&gt;&lt;P&gt; importing&lt;/P&gt;&lt;P&gt;   msg             = l_msg&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;          .&lt;/P&gt;&lt;P&gt;write:/ l_msg.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 13:49:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400806#M193747</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-05T13:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: batch-input</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400807#M193748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data: message(50) type c.
data: messtab like bdcmsgcoll occurs 0 with header line.


....
* Call the transaction get message into messtab
  call transaction 'CS02' using bdcdata mode 'N'
                               update 'S'
                  &amp;lt;b&amp;gt;             messages into messtab.&amp;lt;/b&amp;gt;

* IF the transaction was not succesful then read the 
* messtab for the first Error message.
  if sy-subrc &amp;lt;&amp;gt; 0.
    read table messtab with key msgtyp = 'E'.
    if sy-subrc = 0.
* Once you get an error message, prepare the message,
* Meaning, convert it to something meaningful.
  call function 'MESSAGE_PREPARE'
       exporting
            language = sy-langu
            msg_id   = messtab-msgid
            msg_no   = messtab-msgnr
            msg_var1 = messtab-msgv1(50)
            msg_var2 = messtab-msgv2(50)
            msg_var3 = messtab-msgv3(50)
            msg_var4 = messtab-msgv4(50)
       importing
            msg_text = message.

* Write to list display
write:/ imat-matnr, imat-werks, imat-idnrk, message.

      endif.
  endif.


  clear: bdcdata, messtab.
  refresh: bdcdata, messtab.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to write all of the messages for a particular transaction, then all you need to do is LOOP at the MESSTAB instead of READ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jul 2006 13:49:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/batch-input/m-p/1400807#M193748</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-05T13:49:41Z</dc:date>
    </item>
  </channel>
</rss>

