<?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: Logs logic implementation in ABAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logs-logic-implementation-in-abap/m-p/2722497#M631621</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use application logs, which are the standard way of errors collection and logging SAP gives you. Check this links:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/d6/5d7f38f52f923ae10000009b38f8cf/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/d6/5d7f38f52f923ae10000009b38f8cf/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This link has an ABAP example code.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/application" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/application&lt;/A&gt;&lt;EM&gt;Logging&lt;/EM&gt;in&lt;EM&gt;SAP&lt;/EM&gt;Using+ABAP&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, run programs SBAL_DOCUMENTATION and SBAL_DEMO_01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There was another example around SDN of good and bad error logs (with an hypothetic space trip or something like that) but i can't find it now (if someone does, please post the link).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Please reward points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Alejandro Bindi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 02 Sep 2007 02:35:34 GMT</pubDate>
    <dc:creator>alejandro_bindi</dc:creator>
    <dc:date>2007-09-02T02:35:34Z</dc:date>
    <item>
      <title>Logs logic implementation in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logs-logic-implementation-in-abap/m-p/2722494#M631618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Forum Gurus&lt;/P&gt;&lt;P&gt;I work in SAP for 6 years but sincerly I have never implemented any logs logic in SAP for client application. Do you have any idea how to do it. Is there any class for it. I mean - I have the application some errors occured while running and then I want to send to user the information about this erros in some logs table or something like that. Are there any standards for that?&lt;/P&gt;&lt;P&gt;Thank you in advance Bogusia!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2007 08:52:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logs-logic-implementation-in-abap/m-p/2722494#M631618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-24T08:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Logs logic implementation in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logs-logic-implementation-in-abap/m-p/2722495#M631619</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;Steps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. create structure ZLOG  in data dictionary.&lt;/P&gt;&lt;P&gt;2. fields -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;  TYPE   data element BAPI_MTYPE &lt;/P&gt;&lt;P&gt;                  MESSAGE data element BAPI_MSG&lt;/P&gt;&lt;P&gt;     you can take other fields also which you want to show in log message.&lt;/P&gt;&lt;P&gt;3.  UPDATE TYPE WITH  'E'  &lt;/P&gt;&lt;P&gt;     UPDATE MESSAGE WITH your text    (Anything).&lt;/P&gt;&lt;P&gt;     AND UPDATE YOUR OTHER FIELDS LIKE THIS WAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. AT FINALY SHOW THIS LOG.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2007 09:26:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logs-logic-implementation-in-abap/m-p/2722495#M631619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-24T09:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Logs logic implementation in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logs-logic-implementation-in-abap/m-p/2722496#M631620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Thank You but are there any other methods? Tnx in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 13:28:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logs-logic-implementation-in-abap/m-p/2722496#M631620</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-27T13:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Logs logic implementation in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logs-logic-implementation-in-abap/m-p/2722497#M631621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use application logs, which are the standard way of errors collection and logging SAP gives you. Check this links:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/d6/5d7f38f52f923ae10000009b38f8cf/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/d6/5d7f38f52f923ae10000009b38f8cf/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This link has an ABAP example code.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/application" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/application&lt;/A&gt;&lt;EM&gt;Logging&lt;/EM&gt;in&lt;EM&gt;SAP&lt;/EM&gt;Using+ABAP&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, run programs SBAL_DOCUMENTATION and SBAL_DEMO_01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There was another example around SDN of good and bad error logs (with an hypothetic space trip or something like that) but i can't find it now (if someone does, please post the link).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Please reward points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Alejandro Bindi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Sep 2007 02:35:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logs-logic-implementation-in-abap/m-p/2722497#M631621</guid>
      <dc:creator>alejandro_bindi</dc:creator>
      <dc:date>2007-09-02T02:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Logs logic implementation in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logs-logic-implementation-in-abap/m-p/2722498#M631622</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;Check this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
**************************************************************
** Validate and create error message 
**************************************************************

    if not wa_yarsitem-kondm is initial.
      read table i_yarsbrands into wa_yarsbrands
                                  with key kondm = wa_yarsitem-kondm
                                  binary search.
      if sy-subrc ne c_0.
        perform f_update_error_records using 'YARS' c_e '378'
                                       wa_yarsitem-kondm
                                       wa_yarsitem-docno
                                       space space
                                       wa_yarsitem-docno.
      endif.
    endif.

*&amp;amp;---------------------------------------------------------------------*
* Form  f_update_error_records                                         *
*&amp;amp;---------------------------------------------------------------------*
* For updating the error messages                                      *
*----------------------------------------------------------------------*
form f_update_error_records using msgid msgtyp msgnr msgv1 msgv2 msgv3
                                  msgv4 docno.
  clear : wa_yerrlog.
  wa_yerrlog-msgid  = msgid.
  wa_yerrlog-msgtyp = msgtyp.
  wa_yerrlog-msgnr  = msgnr.
  wa_yerrlog-msgv1  = msgv1.
  wa_yerrlog-msgv2  = msgv2.
  wa_yerrlog-msgv3  = msgv3.
  wa_yerrlog-msgv4  = msgv4.
  wa_yerrlog-docno  = docno.
  append wa_yerrlog to i_yerrlog.
*
endform.                                 " F_update_error_records

*****************************************************************
** Generate Error Report
*****************************************************************


refresh i_output. clear wa_output.
loop at i_yerrlog into wa_yerrlog.
  v_msg_id = wa_yerrlog-msgid.
  v_msg_no = wa_yerrlog-msgnr.
  v_msg_var1 = wa_yerrlog-msgv1.
  v_msg_var2 = wa_yerrlog-msgv2.
  v_msg_var3 = wa_yerrlog-msgv3.
  v_msg_var4 = wa_yerrlog-msgv4.
* Creating message text
  call function 'MESSAGE_PREPARE'
    exporting
      msg_id   = v_msg_id
      msg_no   = v_msg_no
      msg_var1 = v_msg_var1
      msg_var2 = v_msg_var2
      msg_var3 = v_msg_var3
      msg_var4 = v_msg_var4
    importing
      msg_text = v_text1.
  move-corresponding wa_yerrlog to wa_output.
  move v_text1 to wa_output-v_text1.
  append wa_output to i_output.
endloop.

data : v_flg type c.
data : v_no(3) type n value 1.

sort i_output by docno.
if not i_output[] is initial.
  loop at i_output into wa_output.
    at new docno.
      move 'Y' to v_flg.
    endat.
    if v_flg eq 'Y'.
      v_no = 1.
      write: /00 'Document Number :', wa_output-docno
                                color col_heading.
      format color off.
      clear v_flg.
    endif.
    pack v_no to v_no.
    write : /00 v_no no-zero, '.'.
    write : 5 wa_output-v_text1.
    v_no = v_no + 1.
  endloop.
  uline.
  perform f_end_of_page.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Sep 2007 03:08:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logs-logic-implementation-in-abap/m-p/2722498#M631622</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-09-02T03:08:10Z</dc:date>
    </item>
  </channel>
</rss>

