How to write messages into system log(sm21) using c_write_syslog_entry

Hi,
May i know how to write my application messages into system log(sm21)
using "c_write_syslog_entry". Any explanation regarding the Type. ID, Data
will be useful with examples. Incase of any other FM's or C functions does
the same Please let me know.
Thanks
Prasath

Hello Prasanth
I agree with Kareem that you should prefer the application log. If interface IF_RECA_MESSAGE_LIST is available on your SAP system this is the first choice for collecting messages AND storing them as application log.
For an example you may have a look at my Wiki posting [Message Handling - Finding the Needle in the Haystack|https://wiki.sdn.sap.com/wiki/display/profile/2007/07/09/MessageHandling-FindingtheNeedleintheHaystack]
Not shown in this example is the storage of the application log. However, if you look at method CF_RECA_MESSAGE_LIST=>CREATE you see that you can add the application log references here.
Regards
  Uwe

Similar Messages

  • ICal writing tons of log messages into system.log

    Hi all,
    I've got an issue with iCal under Leopard 10.5.1.
    Sometimes my syslogd process grabs ~100% CPU time and so I took a look into system.log.
    I saw MANY lines like this:
    Jan 27 19:23:34 Tigger com.apple.syncservices.SyncServer[4225]: 2008-01-27 19:23:34.363 iCalExternalSync[4230:10b] ISyncSession deleteRecordWithIdentifier: ignoring delete for unknown record Event/p774
    Jan 27 19:23:34 Tigger com.apple.syncservices.SyncServer[4225]: 2008-01-27 19:23:34.364 iCalExternalSync[4230:10b] ISyncSession deleteRecordWithIdentifier: ignoring delete for unknown record Event/p2754
    Jan 27 19:23:34 Tigger com.apple.syncservices.SyncServer[4225]: 2008-01-27 19:23:34.364 iCalExternalSync[4230:10b] ISyncSession deleteRecordWithIdentifier: ignoring delete for unknown record Event/p288
    Jan 27 19:23:34 Tigger com.apple.syncservices.SyncServer[4225]: 2008-01-27 19:23:34.365 iCalExternalSync[4230:10b] ISyncSession deleteRecordWithIdentifier: ignoring delete for unknown record Event/p2056
    Jan 27 19:23:34 Tigger com.apple.syncservices.SyncServer[4225]: 2008-01-27 19:23:34.366 iCalExternalSync[4230:10b] ISyncSession deleteRecordWithIdentifier: ignoring delete for unknown record Event/p148
    Jan 27 19:23:34 Tigger com.apple.syncservices.SyncServer[4225]: 2008-01-27 19:23:34.367 iCalExternalSync[4230:10b] ISyncSession deleteRecordWithIdentifier: ignoring delete for unknown record Event/p73
    Jan 27 19:23:42 Tigger com.apple.syncservices.SyncServer[4225]: 2008-01-27 19:23:42.497 iCalExternalSync[4230:10b] SyncServices precondition failure in [ISyncConcreteSession clientAcceptedChangesForRecordWithIdentifier:formattedRecord:newRecordIdentifie r:]: you can't change the record identifier from 4183D93C-A813-4AB4-BA0F-C246414B2DA1 to node_BirthdayCalendar/p7: it is already associated with a different record.
    Jan 27 19:23:42 Tigger com.apple.syncservices.SyncServer[4225]: 2008-01-27 19:23:42.521 iCalExternalSync[4230:10b] [ICalExternalSync ]Encountered [ISyncConcreteSession clientAcceptedChangesForRecordWithIdentifier:formattedRecord:newRecordIdentifie r:]: you can't change the record identifier from 4183D93C-A813-4AB4-BA0F-C246414B2DA1 to node_BirthdayCalendar/p7: it is already associated with a different record.
    Jan 27 19:23:42 Tigger com.apple.syncservices.SyncServer[4225]: 2008-01-27 19:23:42.526 iCalExternalSync[4230:10b] [ICalExternalSync ]NSException name:NSInvalidArgumentException reason:[ISyncConcreteSession clientAcceptedChangesForRecordWithIdentifier:formattedRecord:newRecordIdentifie r:]: you can't change the record identifier from 4183D93C-A813-4AB4-BA0F-C246414B2DA1 to node_BirthdayCalendar/p7: it is already associated with a different record.
    Any idea how to fix this?
    Here's another problem that might be related to this: my "Private" calendar was published in 10.4 but now the webdav server that was used for this is no longer existent (and can't be setup again).
    So I wanted to unpublish my Private calendar but this wasn't possible. When trying to unpublish it I get the error message "This calendar could not be unpublished. Authentication information may be incorrect."
    If I select the "Cange location..." menu entry in the context menu of the Private calendar I still see the webdav server address and the Login and Password fields are filled. But because this server no longer exists publishing is no longer possible. Which is fine with me.
    So, how can I get rid of the publishing? Because I get tons of error messages in system.log, too, for this behaviour. Everytime the system tries to publish this calendar...
    Thanks,
    Stefan.

    I am not much of a help, but I just wanted to say that my iCal just experienced the same problems for the first time today...

  • How to write file into multiple directories by using file adapter?

    i need to write my file into multiple directories,i able to do in single directory.But i need to write to muliple directories.Please help me out.Thanks in advance.

    If you are passing the values at runtime then you can loop it and and invoke the file adapter in loop by dynamically passing the value in invoke properties for "File Directory and File name" etc.

  • Writing to system log(sm21)

    Hi All,
    I have a requirement to write custom generated log to system log(sm21), Is there any FM for the same or how to do the same.
    thanks
    bobby

    You cannot use the system log for your own purpose.
    Actually, you can, using the kernel functions available, shown in the SLOG package programs.  The system log is nothing more than a local file that gets written to and then synchronized across app servers.  But you are correct that the poster needs to use the application logs, as I also stated.

  • Job that must be programmed to collect information for system log (sm21)

    Please, Who is the job that must be programmed to collect information for system log (sm21) ?
    Thank you very much.
    Hugo.

    Before you reinitialize your log shipping configuration, check to see if you can take a differential backup and restore that on top of your standby database. This is relatively easier than to take a full database backup just to reinitialize
    Edwin Sarmiento SQL Server MVP | Microsoft Certified Master
    Blog |
    Twitter | LinkedIn
    SQL Server High Availability and Disaster Recover Deep Dive Course
    I can take a diff backup.. But in my secondary, when i right click standby >tasks-->restore-->i can see only option to restore transaction log file. Other options are greyed out. How can i restore a diff backup now. If i bring the DB online with
    restore with recovery, i have to restore a full backup before i can apply a diff backup. 
    Somebody provide me insight on below error
    This secondary database is not functional because
    the required copy or restore job cannot be found. You must remove this secondary database by clicking Remove. To resume log shipping to this secondary database, add it as a secondary again using the same settings.If
    you resume log shipping and you specify the same restore path that you used before, any backup files that are uncopied or unrestored to this database will be copied and restored when it is added as a secondary again.  Reinitializing the secondary database
    is unnecessary."
    I can see the LS_restore job and the job is running as per the schedule, we dont run copy job because
    the backup directly falls in secondary server. wats the reason for the above error.

  • Which background process writes date into alert log file in oralce

    which background process writes date into alert log file in oralce

    Hi,
    AFAIK, all the background process are eligible for writing information to alert log file. As the file name indicates to show the alerts, so background process have the access rights in terms of packages (dbms), to write to alert log.
    I might be wrong also..
    - Pavan Kumar N

  • Unable to read system log details using SXMI_XMB_SYSLOG_READ

    Hi All,
    I want to access system log contents of SAP system in my java application by calling RFC SXMI_XMB_SYSLOG_READ. I am able to execute this RFC successfully but it is returning only one line as
    'System Log: Local Analysis of <Machine name>                    1'
    Please guide me on how to retrieve system log contents using this RFC or is their any alternative way to accomplish this?

    Hi All,
    Below is java code i am using for calling SXMI_XMB_SYSLOG_READ function module.
    Date stDate = new Date(02, 9, 2009);
    JCO.Function Function_SXMI_XMB_SYSLOG_READ;
                   IFunctionTemplate ft =
                        mRepository.getFunctionTemplate("SXMI_XMB_SYSLOG_READ");
                   if (ft != null) {
                        Function_SXMI_XMB_SYSLOG_READ = ft.getFunction();
                        Function_SXMI_XMB_SYSLOG_READ
                             .getImportParameterList()
                             .setValue(
                             "vijay",
                             "EXTERNAL_USER_NAME");
                        //                    Function_SXMI_XMB_SYSLOG_READ
                        //                         .getImportParameterList()
                        //                         .setValue(
                        //                         "ps4909",
                        //                         "SERVER_NAME");
                        Function_SXMI_XMB_SYSLOG_READ
                             .getImportParameterList()
                             .setValue(
                             stDate,
                             "FROM_DATE");
                        Function_SXMI_XMB_SYSLOG_READ
                             .getImportParameterList()
                             .setValue(
                             "11:03:19",
                             "FROM_TIME");
                        Function_SXMI_XMB_SYSLOG_READ
                             .getImportParameterList()
                             .setValue(
                             stDate,
                             "TO_DATE");
                        Function_SXMI_XMB_SYSLOG_READ
                             .getImportParameterList()
                             .setValue(
                             "12:58:00",
                             "TO_TIME");
                        Function_SXMI_XMB_SYSLOG_READ
                             .getImportParameterList()
                             .setValue(
                             "X",
                             "PARA_RECS");
                        mConnection.execute(Function_SXMI_XMB_SYSLOG_READ);
                        JCO.Table tableSYSLOG_TBL =
                             Function_SXMI_XMB_SYSLOG_READ
                                  .getTableParameterList()
                                  .getTable(
                                  "SYSLOG_TBL");
                                  System.out.println(tableSYSLOG_TBL.getNumRows());
                        for (int i = 0; i < tableSYSLOG_TBL.getNumRows(); i++) {
                             for (int j = 0; j < tableSYSLOG_TBL.getNumColumns(); j++) {
                                  System.out.println(
                                       tableSYSLOG_TBL.getName(j)
                                            + "\t\t"
                                            + tableSYSLOG_TBL.getValue(j));
    and i am getting same line stated below repeatedly as output
    LINE                                System Log: Local Analysis of ps4909                    1

  • How to import metadata into EPMA application by using ODI

    Hi All,
    1.Can you tell anyone, how to import metadata into EPMA application by using ODI. Detailed steps with screen shots will be appreciated.
    2. What was the interface tables. How the interface tables will be useful while importing metadata into EPMA application (Detailed steps with screen shots will be appreciated.). And tell me the interface tables structure and work process. give me the clear idea bout interface tables. I don't know anything about interface tables.
    3.Which method(either using ODI or Interface tables) is optimized/bestcase for importing metadata into EPMA application.
    My database is Oracle 10g and I am using Planning 9.3.1.
    Thanks in advance.
    Thanks And Regards,
    Bhagya Lakshmi.

    Hi,
    Answer to your questions
    1. You can't import metadata directly into EPMA using ODI, the only option is use the EPMA interface tables which is your question 2.
    2. Interface tables are just a structure of database tables which you populate with metadata and then this is pushed into EPMA, the structure of the tables takes a while to get an understanding of. The best place to start would be the documentation :- http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/bpma_admin.pdf
    3. As explained in question 1 you can't use ODI directly to import metadata into EPMA but with a lot of hard work and effort you could probably populate interface tables from EPMA, though I must admit I am not a fan of the interface tables because I don't think they were designed with simplicity and ease of use in mind.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Some wrong with C_WRITE_SYSLOG_ENTRY to write some logs into System Log

    We have many SAP System, in one SAP System (SAP R/3 Kernel   46D_EX2), we call the following code.
    BEGIN OF syslog_msg,
            area(2)         TYPE c VALUE 'YI',
            subid(1)        TYPE c VALUE 'T',
          END OF syslog_msg,
    call 'C_WRITE_SYSLOG_ENTRY'
        id 'TYP'  field  'I'
        id 'KEY'  field syslog_msg
        id 'DATA' field 'Hello World'.
    The orignial Data is ITM-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    On this SAP System, the System log will be dumped out with ITM-$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    But on other SAP System (6.20, 6.40, 7.00, 7.01), the System log will be dumped with
    ITM-Hello World
    What's wrong with 4.6D EX2?  and tips for this, who can help me?

    Hello Prasanth
    I agree with Kareem that you should prefer the application log. If interface IF_RECA_MESSAGE_LIST is available on your SAP system this is the first choice for collecting messages AND storing them as application log.
    For an example you may have a look at my Wiki posting [Message Handling - Finding the Needle in the Haystack|https://wiki.sdn.sap.com/wiki/display/profile/2007/07/09/MessageHandling-FindingtheNeedleintheHaystack]
    Not shown in this example is the storage of the application log. However, if you look at method CF_RECA_MESSAGE_LIST=>CREATE you see that you can add the application log references here.
    Regards
      Uwe

  • System Log(SM21), how I can achieve this?

    How I can display the fields that were changed during the debug mode through System Log. What are the Function Modules to read the system log.

    Look at these Function Groups :
    SLO2 System log: Read and analyze
    SLO3 System log: Table caches
    SLO4 System log: Parameter buffer
    SLO5 System log: Errno analysis
    Regards

  • How to write to windows event logs from determinations-server under IIS

    This is just an FYI technical bit of information I wish someone had shared with me before I started trying to write OPA errors to the windows event log... Most problems writing to the windows event log from log4net occur because of permissions. Some problems are because determinations-server does not have permissions to create some registry entries. Some problems cannot be resolved unless specific registry entry permissions are actually changed. We had very little consistency with the needed changes across our servers, but some combination of the following would always get the logging to the windows event log working.
    To see log4net errors as log4net attempts to utilize the windows event log, temporarily add the following to the web.config:
    <appSettings>
    <!-- uncomment the following line to send diagnostic messages about the log configuration file to the debug trace.
    Debug trace can be seen when attached to IIS in a debugger, or it can be redirected to a file, see
    http://logging.apache.org/log4net/release/faq.html in the section "How do I enable log4net internal debugging?" -->
    <add key="log4net.Internal.Debug" value="true"/>
    </appSettings>
    <system.diagnostics>
    <trace autoflush="true">
    <listeners>
    <add
    name="textWriterTraceListener"
    type="System.Diagnostics.TextWriterTraceListener"
    initializeData="logs/InfoDSLog.txt" />
    </listeners>
    </trace>
    </system.diagnostics>
    To add an appender for the windows event viewer, try the following in the log4net.xml:
    <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" >
    <param name="ApplicationName" value="OPA" />
    <param name="LogName" value="OPA" />
    <param name="Threshold" value="all" />
    <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
    </layout>
    <filter type="log4net.Filter.LevelRangeFilter">
    <levelMin value="WARN" />
    <levelMax value="FATAL" />
    </filter>
    </appender>
    <root>
    <level value="warn"/>
    <appender-ref ref="EventLogAppender"/>
    </root>
    To put the OPA logs under the Application Event Log group, try this:
    Create an event source under the Application event log in Registry Editor. To do this, follow these steps:
    1.     Click Start, and then click Run.
    2.     In the Open text box, type regedit.
    3.     Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application
    4.     Right-click the Application subkey, point to New, and then click Key.
    5.     Type OPA for the key name.
    6.     Close Registry Editor.
    To put the OPA logs under a custom OPA Event Log group (as in the demo appender above), try this:
    Create an event log in Registry Editor. To do this, follow these steps:
    1.     Click Start, and then click Run.
    2.     In the Open text box, type regedit.
    3.     Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
    4.     Right-click the eventlog subkey, point to New, and then click Key.
    5.     Type OPA for the key name.
    6.     Right-click the new OPA key and add a new DWORD called "MaxSize" and set it to "1400000" which is about 20 Meg in order to keep the log file from getting too large.
    7.     The next steps either help or sometimes cause an error, but you can try these next few steps... If you get an error about a source already existing, then you can delete the key.
    8.     Right-click the OPA subkey, point to New, and then click Key.
    9.     Type OPA for the key name.
    10.     Close Registry Editor.
    You might need to change permissions so OPA can write to the event log in Registry Editor.  If you get permission errors, try following these steps:
    1.     Click Start, and then click Run.
    2.     In the Open text box, type regedit.
    3.     Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
    4.     Right-click the EventLog key, select Permissions.
    5.     In the dialog that pops up, click Add...
    6.     Click Advanced...
    7.     Click Locations... and select the current machine by name.
    8.     Click Find Now
    9.     Select both the Network user and IIS_IUSERS user and click OK and OK again. (We never did figure out which of those two users was the one that fixed our permission problem.)
    10.     Change the Network user to have Full Control
    11.     Click Apply and OK
    To verify OPA Logging to the windows event logs from Determinations-Server:
    Go to the IIS determinations-server application within Server Manager.
    Under Manage Application -> Browse Application click the http link to pull up the local "Available Services" web page that show the wsdl endpoints.
    Select the /determinations-server/server/soap.asmx?wsdl link
    Go to the URL and remove the "?wsdl" from the end of the url and refresh. This will throw the following error into the logs:
    ERROR Oracle.Determinations.Server.DSServlet [(null)] - Invalid get request: /determinations-server/server/soap.asmx
    That error should show up in the windows event log, OR you can get a message explaining why security stopped you in "logs/InfoDSLog.txt" if you used the web.config settings from above.
    http://msdn.microsoft.com/en-us/library/windows/desktop/aa363648(v=vs.85).aspx
    Edited by: Paul Fowler on Feb 21, 2013 9:45 AM

    Thanks for sharing this information Paul.

  • How to save message into internal table?

    Hi,everyone!
    I have a problem when I'm coding.I want to store messages into a internal table.Can you help me?
    Thanks!

    Hello Feng
    If you are already working on SAP basis release >= 6.20 I would recommend the most versatile message handler of all: interface <b>IF_RECA_MESSAGE_LIST</b>
    Perhaps you will find the following sample report ZUS_SDN_APOLLO_13
    (see also: <a href="https://wiki.sdn.sap.com/wiki/display/profile/2007/07/09/MessageHandling-FindingtheNeedleintheHaystack">Message Handling - Finding the Needle in the Haystack</a>) useful.
    *& Report  ZUS_SDN_APOLLO_13
    REPORT  zus_sdn_apollo_13
      LINE-SIZE 200.
    TYPE-POOLS: abap.
    TYPES: BEGIN OF ty_s_outtab.
    TYPES:   status     TYPE exception.
    INCLUDE TYPE bapiret2  AS msg.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab  TYPE STANDARD TABLE OF ty_s_outtab
                        WITH DEFAULT KEY.
    DATA:
      gs_layout         TYPE lvc_s_layo,
      gt_outtab         TYPE ty_t_outtab.
    DATA:
      gd_title          TYPE lvc_title,
      gd_msgv           TYPE symsgv,
      gd_msg            TYPE bapi_msg,
      gs_msg            TYPE recamsg,
      gs_return         TYPE bapiret2,
      gt_return         TYPE bapirettab,
      go_msglist        TYPE REF TO if_reca_message_list,
      go_random         TYPE REF TO cl_random_number,
      gif_random        TYPE REF TO if_random_number.
    PARAMETERS:
      p_opt1  RADIOBUTTON GROUP radi  DEFAULT 'X',
      p_opt2  RADIOBUTTON GROUP radi,
      p_opt3  RADIOBUTTON GROUP radi.
    SELECTION-SCREEN ULINE.
    PARAMETERS:
      p_opt4  RADIOBUTTON GROUP radi,
      p_opt5  RADIOBUTTON GROUP radi,
      p_opt6  RADIOBUTTON GROUP radi.
    SELECTION-SCREEN ULINE.
    PARAMETERS:
      p_count    TYPE numc3     DEFAULT '4',
      p_level    TYPE ballevel  DEFAULT '7'.
    DEFINE mac_build_msg.
      clear: gs_msg.
      gs_msg-msgty = &5.
      gs_msg-msgid = '00'.
      gs_msg-msgno = '398'.
      gs_msg-msgv1 = &1.
      gs_msg-msgv2 = &2.
      gs_msg-msgv3 = &3.
      gs_msg-msgv4 = &4.
      gs_msg-detlevel = &6.
    END-OF-DEFINITION.
    *  msgty
    *  msgid
    *  msgno
    *  msgv1
    *  msgv2
    *  msgv3
    *  msgv4
    *  msgv1_src
    *  msgv2_src
    *  msgv3_src
    *  msgv4_src
    *  detlevel
    *  probclass
    *  alsort
    *  time_stmp
    *  msg_count
    *  context
    *  params
    START-OF-SELECTION.
      " Create message handler
      go_msglist = cf_reca_message_list=>create( ).
      " Create random number instance
      CREATE OBJECT go_random TYPE cl_random_number.
      gif_random ?= go_random.
      gif_random->init( ).
      PERFORM message_handling_1.
      PERFORM message_handling_2.
      PERFORM message_handling_3.
      PERFORM message_handling_4.
    END-OF-SELECTION.
    *&      Form  MESSAGE_HANDLING_1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM message_handling_1 .
      CHECK ( p_opt1 = abap_true ).
      gd_title = 'Information System 1 (IS1)'.
      SET TITLEBAR 'TITLE' WITH gd_title.
      WRITE: / 'Apollo 13 Mission'.
      WRITE: / syst-uline.
      WRITE: / 'Take-Off             -> ok'.
      WRITE: / 'Leaving Orbit        -> ok'.
      WRITE: / 'Trajectory           -> ok'.
      WRITE: /.
      FORMAT COLOR COL_NEGATIVE.
      WRITE: / 'Explosion happened   -> not ok'.
      WRITE: / 'Command and Service module (CSM) -> damaged'.
      FORMAT RESET.
      WRITE: / 'Lunar module (LM)    -> not affected, ok'.
      MESSAGE text-hou TYPE 'S'.
    ENDFORM.                    " MESSAGE_HANDLING_1
    *&      Form  message_handling_2
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM message_handling_2 .
    * define local data
      DATA:
        ld_success(6)  TYPE n,
        ld_warning(6)  TYPE n,
        ld_failure(6)  TYPE n,
        ld_total(6)    TYPE n.
      CHECK ( p_opt2 = abap_true ).
      gd_title = 'Information System 2 (IS2)'.
      SET TITLEBAR 'TITLE' WITH gd_title.
      PERFORM generate_messages.  " simulation of messages
      CALL METHOD go_msglist->get_list_as_bapiret
        IMPORTING
          et_list = gt_return.
      " Calculate message types and total
      ld_total   = 0.
      ld_success = 0.
      ld_warning = 0.
      ld_failure = 0.
    " Print messages as WRITE list
      LOOP AT gt_return INTO gs_return.
        IF ( gs_return-type = 'E' ).
          ADD 1 TO ld_failure.
        ELSEIF ( gs_return-type = 'W' ).
          ADD 1 TO ld_warning.
        ELSE.
          ADD 1 TO ld_success.
        ENDIF.
      ENDLOOP.
      ld_total = ld_success + ld_warning + ld_failure.
      WRITE: / 'Total Message =', ld_total.
      WRITE: / 'Failures      =', ld_failure.
      WRITE: / 'Warnings      =', ld_warning.
      WRITE: / 'Successes     =', ld_success.
      WRITE: / syst-uline.
      SKIP.
    " Colouring depending on message type
      LOOP AT gt_return INTO gs_return.
        IF ( gs_return-type = 'E' ).
          FORMAT COLOR COL_NEGATIVE.
        ELSEIF ( gs_return-type = 'W' ).
          FORMAT COLOR COL_TOTAL.
        ELSE.
          FORMAT RESET.
        ENDIF.
        WRITE: / gs_return-type, gs_return-message+0(100).
      ENDLOOP.
    ENDFORM.                    " message_handling_2
    *&      Form  message_handling_3
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM message_handling_3 .
    * define local data
      DATA:
        ls_outtab    TYPE ty_s_outtab.
      DATA:
        ld_success(6)  TYPE n,
        ld_warning(6)  TYPE n,
        ld_failure(6)  TYPE n,
        ld_total(6)    TYPE n.
      CHECK ( p_opt3 = abap_true ).
      gd_title = 'Information System 3 (IS3)'.
      SET TITLEBAR 'TITLE' WITH gd_title.
      PERFORM generate_messages.  " simulation of messages
      CALL METHOD go_msglist->get_list_as_bapiret
        IMPORTING
          et_list = gt_return.
      REFRESH: gt_outtab.
      " Calculate message types and total
      ld_total   = 0.
      ld_success = 0.
      ld_warning = 0.
      ld_failure = 0.
    " Define the logic for setting exception status (LED)
      LOOP AT gt_return INTO gs_return.
        CLEAR: ls_outtab.
        ls_outtab-msg = gs_return.
        IF ( gs_return-type = 'E' ).
          ls_outtab-status = '1'.  " red
          ADD 1 TO ld_failure.
        ELSEIF ( gs_return-type = 'W' ).
          ls_outtab-status = '2'.  " yellow
          ADD 1 TO ld_warning.
        ELSE.
          ls_outtab-status = '3'.  " green
          ADD 1 TO ld_success.
        ENDIF.
        APPEND ls_outtab TO gt_outtab.
      ENDLOOP.
      ld_total = ld_failure + ld_warning + ld_success.
      CLEAR: gs_layout.
      gs_layout-cwidth_opt = abap_true.
      gs_layout-zebra      = abap_true.
      gs_layout-excp_fname = 'STATUS'.
      gs_layout-excp_led   = abap_true.
      gs_layout-smalltitle = abap_true.
      CONCATENATE 'T(' ld_total   ')  '
                  'E(' ld_failure ')  '
                  'W(' ld_warning ')  '
                  'S(' ld_success ')  '
        INTO gd_title SEPARATED BY space.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_structure_name = 'BAPIRET2'
          i_grid_title     = gd_title
          is_layout_lvc    = gs_layout
        TABLES
          t_outtab         = gt_outtab
        EXCEPTIONS
          OTHERS           = 1.
    ENDFORM.                    " message_handling_3
    *&      Form  message_handling_4
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM message_handling_4 .
    * define local data
      CHECK ( p_opt4 = abap_true   OR
              p_opt5 = abap_true   OR
              p_opt6 = abap_true ).
      IF ( p_opt4 = abap_true ).
        gd_title = 'Information System 4 (IS4)'.
        SET TITLEBAR 'TITLE' WITH gd_title.
      ELSEIF ( p_opt5 = abap_true ).
        gd_title = 'Information System 5 (IS5)'.
        SET TITLEBAR 'TITLE' WITH gd_title.
      ELSE.
        gd_title = 'Information System 6 (IS6)'.
        SET TITLEBAR 'TITLE' WITH gd_title.
      ENDIF.
      PERFORM generate_messages.  " simulation of messages
      PERFORM display_log.
    ENDFORM.                    " message_handling_4
    *&      Form  GENERATE_MESSAGES
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM generate_messages .
    * define local data
      mac_build_msg 'Apollo 13 Mission: Spacecraft'
                     space space space 'I' '1'.
    **  DEFINE mac_build_msg.
    **    clear: gs_msg.
    **    gs_msg-msgty = &5.
    **    gs_msg-msgid = '00'.
    **    gs_msg-msgno = '398'.
    **    gs_msg-msgv1 = &1.
    **    gs_msg-msgv2 = &2.
    **    gs_msg-msgv3 = &3.
    **    gs_msg-msgv4 = &4.
    **    gs_msg-detlevel = &6.
    **  END-OF-DEFINITION.
      go_msglist->add( is_message = gs_msg ).
      DO 6 TIMES.
        CASE syst-index.
          WHEN '1'.
            mac_build_msg 'Command and Service Module (CSM)'
               space space space 'I' '2'.
          WHEN '2'.
            mac_build_msg 'Lunar Module (LM)' space space space 'I' '2'.
          WHEN '3'.
            mac_build_msg 'Additional Module (M-1)'
              space space space 'I' '2'.
          WHEN '4'.
            mac_build_msg 'Additional Module (M-2)'
              space space space 'I' '2'.
          WHEN '5'.
            mac_build_msg 'Additional Module (M-3)'
              space space space 'I' '2'.
          WHEN '6'.
            mac_build_msg 'Additional Module (M-4)'
              space space space 'I' '2'.
          WHEN OTHERS.
            EXIT.
        ENDCASE.
        go_msglist->add( is_message = gs_msg ).
    "   recursive call of routine
        PERFORM generate_messages_1 USING syst-index 'Modul' '3'.
      ENDDO.
    ENDFORM.                    " GENERATE_MESSAGES
    *&      Form  GENERATE_MESSAGES_1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM generate_messages_1
                         USING
                            value(ud_index)     TYPE i
                            value(ud_msgv)      TYPE symsgv
                            value(ud_detlevel)  TYPE ballevel.
    * define local data
      DATA:
        ld_integer         TYPE i,
        ld_msgty           TYPE symsgty,
        ld_msgv            TYPE symsgv,
        ld_detlevel        TYPE ballevel.
      DO p_count TIMES.
        WRITE syst-index TO ld_msgv NO-ZERO LEFT-JUSTIFIED.
        IF ( ud_detlevel = '3' ).
          CONCATENATE ud_msgv ld_msgv INTO ld_msgv
            SEPARATED BY space.
        ELSE.
          CONCATENATE ud_msgv ld_msgv INTO ld_msgv
            SEPARATED BY '.'.
        ENDIF.
        CONDENSE ld_msgv.
        gd_msgv = ld_msgv.
        IF ( ud_index = 1 ).
          ld_integer = gif_random->get_random_int( 300 ).
          IF ( ld_integer = 1 ).
            ld_msgty = 'E'.
            CONCATENATE gd_msgv 'failed' INTO gd_msgv SEPARATED BY ' -> '.
          ELSEIF ( ld_integer BETWEEN 1 AND 10 ).
            ld_msgty = 'W'.
            CONCATENATE gd_msgv 'check(?)' INTO gd_msgv SEPARATED BY ' -> '.
          ELSE.
            ld_msgty = 'S'.
            CONCATENATE gd_msgv 'OK' INTO gd_msgv SEPARATED BY ' -> '.
          ENDIF.
        ELSE.
          ld_msgty = 'S'.
          CONCATENATE gd_msgv 'OK' INTO gd_msgv SEPARATED BY ' -> '.
        ENDIF.
        mac_build_msg gd_msgv space space space ld_msgty ud_detlevel.
        go_msglist->add( is_message = gs_msg ).
        IF ( ud_detlevel < p_level ).
          ld_detlevel = ud_detlevel + 1.
          PERFORM generate_messages_1 USING ud_index ld_msgv ld_detlevel.
        ENDIF.
      ENDDO.
    ENDFORM.                    " GENERATE_MESSAGES_1
    *&      Form  DISPLAY_LOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM display_log .
    * define local data
      DATA:
        ld_handle           TYPE balloghndl,
        lt_log_handles      TYPE bal_t_logh,
        ls_profile          TYPE bal_s_prof.
    " Get log handle of collected message list
      ld_handle = go_msglist->get_handle( ).
      APPEND ld_handle TO lt_log_handles.
      IF ( p_opt4 = 'X' ).
    *   get a display profile which describes how to display messages
        CALL FUNCTION 'BAL_DSP_PROFILE_DETLEVEL_GET'
          IMPORTING
            e_s_display_profile = ls_profile.  " tree & ALV list
      ELSEIF ( p_opt5 = 'X' ).
    *   get standard profile to display one log
        CALL FUNCTION 'BAL_DSP_PROFILE_SINGLE_LOG_GET'
          IMPORTING
            e_s_display_profile = ls_profile.
      ELSE.
        CALL FUNCTION 'BAL_DSP_PROFILE_NO_TREE_GET'
          IMPORTING
            e_s_display_profile = ls_profile.
      ENDIF.
    * set report to allow saving of variants
      ls_profile-disvariant-report = sy-repid.
    *   when you use also other ALV lists in your report,
    *   please specify a handle to distinguish between the display
    *   variants of these different lists, e.g:
      ls_profile-disvariant-handle = 'LOG'.
      CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
        EXPORTING
          i_s_display_profile          = ls_profile
          i_t_log_handle               = lt_log_handles
        EXCEPTIONS
          profile_inconsistent         = 1
          internal_error               = 2
          no_data_available            = 3
          no_authority                 = 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.
    ENDFORM.                    " DISPLAY_LOG
    Regards
      Uwe

  • How to write settings into xml

    I?ve got a small class that returns the names of each JInternalFrame. The code is below; I have an xml file where I am saving various settings. In the xml file I have created a tag and in that tag I want to write all the name of the JInternalFrames. Can someone help me with writing a method which will write the frames names into the xml tag.
    package persisted_display_settings;
    import javax.swing.*;
    import mdi_internal_frame.FrameManager;
    import mdi_internal_frame.TSFrame;
    import state_manager.StateManager.Prerequisite;
    * The PersistDisplaySettings looks after the persisted screen settings for each frame.
    * It allows the user to save the layout settings of each screen so that the user doesn't
    * have to reconfigure layout every time they restart
    public class PersistDisplaySettings {
         * Gets the name of all TS frames and the last modified layout information and saves
         * this in a xml file
         * @param projectDir is the project directory
         public void SaveCurrentTsProfile(String projectDir) {
              System.out.println("Start Here");
              System.out.println(projectDir);
              JInternalFrame[] frames = FrameManager.getJDesktopTS().getAllFrames();
              System.out.println(frames.length);
    // Iterate through each frame that is open and get the names
              // Only get the names of the frames that are saved
              for (int noOfFrames = 0; noOfFrames < frames.length; noOfFrames++) {
                   String tsName = "";
                   boolean unsaved = true;
                   //Check to make sure the frames are TS frames
                   if (frames[noOfFrames] instanceof TSFrame) {        
                        JInternalFrame tsFrames = frames[noOfFrames];
                        if(tsFrames.getTitle().contains(":-")){
                             tsName = tsFrames.getTitle();
                             tsName = tsName.substring(17);
                             unsaved = getSavedTSNames(tsFrames);
                        else if(tsFrames.getTitle().contains("-")){
                             tsName = tsFrames.getTitle();
                             tsName = tsName.substring(16);
                             unsaved = getSavedTSNames(tsFrames);
                        if(!unsaved){
                             System.out.println(tsName);
              System.out.println("point 2");
              FrameManager.getSelectedTSFrame().isMaximum();
              System.out.println(FrameManager.getSelectedTSFrame());
              System.out.println(FrameManager.getSelectedTSFrame().isMaximum());
         * Returns all the saved TS frame names. This method is Called
         * by the SaveCurrentTsProfile method
         * @param save boolean flgg indicating if GUI should save modified test sequences
         public boolean getSavedTSNames(JInternalFrame frame) {
                        boolean[] modified = ((TSFrame)frame).stateManager
                        .getPrereqState(Prerequisite.TS_MODIFIED);
                        return modified[0];     
    }

    I have a GUI project which has frames consisting of data in table view. What i'm trying to do is save the layout of the frames into an xml file so that the user doesn't have to reconfigure layout every time they restart the application. The code which i have attached gets the names of each frame.
    I also have another class which is currently generating various other settings and writing it into the xml file. The xml file looks like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <PTMViewProfile>
    - <viewProfile>
    <testSequences />
    - <tsName>
    <tsName tag="arefa" />
    </tsName>
    <tsStatus />
    - <columns>
    - <tcc>
    <column tag="usim" visible="false" width="75" index="-1" />
    <column tag="dev" visible="false" width="75" index="-1" />
    <column tag="tp" visible="false" width="75" index="-1" />
    <column tag="iwd" visible="false" width="75" index="-1" />
    <column tag="tdma" visible="false" width="75" index="-1" />
    <column tag="selref" visible="true" width="75" index="2" />
    <column tag="md" visible="false" width="75" index="-1" />
    <column tag="timer" visible="false" width="75" index="-1" />
    <column tag="description" visible="false" width="75" index="-1" />
    <column tag="name" visible="true" width="120" index="0" />
    <column tag="domain" visible="true" width="75" index="5" />
    <column tag="note" visible="false" width="75" index="-1" />
    <column tag="hsdpa" visible="false" width="75" index="-1" />
    <column tag="wi" visible="true" width="75" index="4" />
    <column tag="ttcn" visible="false" width="75" index="-1" />
    <column tag="approval" visible="false" width="75" index="-1" />
    <column tag="inter" visible="false" width="75" index="-1" />
    <column tag="duration" visible="false" width="75" index="-1" />
    <column tag="etsi" visible="true" width="75" index="1" />
    <column tag="hsupa" visible="false" width="75" index="-1" />
    <column tag="auto" visible="true" width="75" index="3" />
    <column tag="cipher" visible="false" width="75" index="-1" />
    <column tag="suite" visible="false" width="75" index="-1" />
    <column tag="shield" visible="false" width="75" index="-1" />
    <column tag="hop" visible="false" width="75" index="-1" />
    </tcc>
    In the - <tsName> i want to print out all the names of the frames.
    This is the method thats creating the tags in the xml file. This method is stored in a different class;
    public Element writeViewProfile(String name) {
              Message.logInfo("Saving View Profile XML Document:" + name);
              Element root = XMLManager.createNamedElement("PTMViewProfile");
              Element viewProfile = XMLManager.createNamedChildElement(root, xmlViewTag);
              Element tsNameTag = XMLManager.createNamedChildElement(viewProfile, xmlTSFrameTag);
              Element tsFrameName = XMLManager.createNamedChildElement(viewProfile, xmlFrameTag);
              writeTsFrame(tsFrameName, "Arefa");
              Element tsFrameStatus = XMLManager.createNamedChildElement(viewProfile, xmlFrameStatusTag);
              Element columns = XMLManager.createNamedChildElement(viewProfile, xmlColumnsTag);
              writeColumnSet(columns, xmlTCCColumnTag);
              writeColumnSet(columns, xmlTSColumnTag);
              writeColumnSet(columns, xmlResTCCColumnTag);
              writeColumnSet(columns, xmlResTSColumnTag);
              Element sashes = XMLManager.createNamedChildElement(viewProfile, xmlSashesTag);
              for (int i = 0; i < sashList.size(); i++) {
                   writeSash(sashes, sashList.get(i));
              return root;
         };This is the method thats writing the xml file;
    private void saveProfile(String name) {
              if (!readyToSave)
                   return;
              ViewProfile viewProfile = viewProfiles.get(currentViewProfileName);
              if (viewProfile != null) {
                   // try {
                   Element root = viewProfile.writeViewProfile("ptmProfile");
                   // create an xml document with our data
                   Document doc = new Document(root);
                   // dump the document to file
                   XMLManager.dumpXMLDocToFile(doc, "ptmProfile", FileManager.baseDir());
                   // catch (Exception ignore) {
                   // System.out.println(ignore.getMessage() + ignore.getStackTrace());
         }In the xml file how can i print the names of the frames into that <tsName> tag using the SaveCurrentTsProfile() method .
    I hope this helps you understand whats hapenning.
    Thanks!

  • Org.samba.winbindd logs constant throttling respawn messages in system.log

    I am running Mac OS X 10.6.4 on a MacBookPro5,1 (Intel Core 2 Duo) system.
    My network connectivity is fine as far as I can tell. I recently discovered the following message being logged over and over in the system.log log file:
    7-17-10 11:49:09 o'clock com.apple.launchd[1] (org.samba.winbindd) Throttling respawn: Will start in 10 seconds
    7-17-10 11:49:19 o'clock com.apple.launchd[1] (org.samba.winbindd[157]) Exited with exit code: 1
    This is really annoying when trying to view the log output to diagnose a problem I with an application I'm trying to develop
    What can stop these message from appear in my log output?

    I checked the Console application and found a log file in it call log.winbindd. It has several entries like the following in it that might be relevant:
    [2010/07/17 14:44:14, 1] /SourceCache/samba/samba-235.4/samba/source/nsswitch/winbindd.c:main(1024)
    winbindd version 3.0.28a-apple started.
    Copyright Andrew Tridgell and the Samba Team 1992-2008
    [2010/07/17 14:44:14, 0, pid=1964] /SourceCache/samba/samba-235.4/samba/source/nsswitch/winbinddcache.c:initialize_winbinddcache(2222)
    initializewinbinddcache: clearing cache and re-creating with version number 1
    [2010/07/17 14:44:14, 0, pid=1964] /SourceCache/samba/samba-235.4/samba/source/lib/opendirectory.c:opendirectoryfill_domain_sidcache(1985)
    opendirectorysamsearchname[/Config/CIFSServer] gave -14136 [eDSRecordNotFound]
    [2010/07/17 14:44:14, 0, pid=1964] /SourceCache/samba/samba-235.4/samba/source/passdb/secrets.c:secretsfetch_domainsid(150)
    secretsfetch_domain_sid:opendirectory_query_domainsid gave -14136 [eDSRecordNotFound]
    [2010/07/17 14:44:14, 0, pid=1964] /SourceCache/samba/samba-235.4/samba/source/nsswitch/winbinddutil.c:init_domainlist(505)
    Could not fetch our SID - did we join?
    [2010/07/17 14:44:14, 0, pid=1964] /SourceCache/samba/samba-235.4/samba/source/nsswitch/winbindd.c:main(1130)
    unable to initalize domain list
    What insight does this offer into the cause of the messages and how to stop them?

  • Directing Log4J messages into OC4J log file

    Hi,
    We currently have a web application that is running on Tomcat. We want to migrate that application over to OC4J. The application currently uses Log4J for messages. What do I have to do to have the application still write to the log4j logs.
    Thanks,
    J

    Try this:
    http://buttso.blogspot.com/2007/09/directing-log4j-logs-into-oc4j-logging.html
    The application still issues log messages via log4j, but you as an administrator can configure OC4J so that the log4j messages get captured in the OC4J log system so they can be viewed using the log viewer mechanism of OC4J.
    -steve-

Maybe you are looking for