Writing in SM37 Job Log

Hi Abappers,
I have a requirement in which I am displaying all the error messages in an ALV when my program runs in Foreground. But this program runs in background, those error messages must be displayed in the Job Log of SM37.
I should not raise any error or information messages to come in log automatically as it affects the foreground processing of my program.
Is there any FM to write in the Job log?? Or can I use the Message statement in such a way that it is not diaplayed in forground?
Thanks in Advance,

Hi,
Try this.
If you are using ALV grid in the foreground, use the same without without creating the container (basically check the SY-BATCH, before creating a container).  Then the same ALV grid  will create a spool with all the messages during background execution.
Regards,
Sharin Varghese

Similar Messages

  • Message with IDOC number, created by LSMW, missing in job log in SM37

    Hi gurus,
    We have a temporary interface which uses LSMW to create IDOCs and update in SAP. It's used for materials, BOMs and document info records. In LSMW we have defined standard message types MATMAS_BAPI, BOMMAT and DOCUMENT_LOAD for the IDOCs. All these have the same problem.
    A background job runs and starts LSMW. In the job log in SM37 I want to see which IDOCs were created. For some reason this is different in my development system and my test system, and as far as I know all settings should be the same. In the test system LSMW creates more message lines in the job log, than it does in the dev system. Message number E0-097 is "IDOC XXXX added", and this is missing in the dev system.
    This is what it looks like in the dev system:
    Data transfer started for object 'MATMAS' (project 'X', subobject 'Y')             /SAPDMC/LSMW   501    I
    Import program executed successfully                                                             /SAPDMC/LSMW   509    I
    File 'XXX.lsmw.read' exists                                                                               /SAPDMC/LSMW   502    I
    Conversion program executed successfully                                                    /SAPDMC/LSMW   513    I
    Data transfer terminated for object 'MATMAS' (project 'X', subproject 'Y')       /SAPDMC/LSMW  516    I
    And this is what it looks like in the test system. More information, which is exactly what I want in dev system too:
    Data transfer started for object 'MATMAS' (project 'X', subobject 'Y')             /SAPDMC/LSMW   501    I
    Import program executed successfully                                                             /SAPDMC/LSMW  509    I
    File 'XXX.lsmw.read' exists                                                                               /SAPDMC/LSMW  502    I
    Conversion program executed successfully                                                    /SAPDMC/LSMW  513    I
    File 'XXX.lsmw.conv' exists                                                                              /SAPDMC/LSMW   502   I
    IDoc '0000000002489289' added                                                                      E0                         097   S
    File 'XXX.lsmw.conv' transferred for IDoc generation                                      /SAPDMC/LSMW   812   I
    Data transfer terminated for object 'MATMAS' (project 'X', subproject 'Y')      /SAPDMC/LSMW   516   I
    In both cases the IDOC is created and update works fine.
    My only issue is that I can't see the IDOC number in the dev system. I know I can get the IDOC number in WE02, but in this case we have program logic which reads the job log to be able to check IDOC status before sending OK message back to the other side of the interface.
    I hope any of you can have an idea how I can update somewhere to get message E0-097 with IDOC number into the log.
    Regards,
    Lisbeth

    Hi Arun,
    If you want to show your messages in the job log you have to use the MESSAGE statement. In case you use WRITE statements an output list be created which can be found in the spool (there is an icon to go to the spool directly).
    Regards,
    John.

  • How to write log information into SM37 batch job log

    Hi,
    I have a report running in batch mode, and I would like to log the start time and end time for some part of the code (different Function modules). I need to write this log information into the batch job log. Therefore I can check the time frame of my FMs.
    After search the SDN, I can only get some information on how to write log into the application log displayed in SLG1, but that's not I want. I want to write batch log information, and check it in SM37.
    If you have some solution or code to share, please. Thanks a lot.
    Best Regards,
    Ben

    Hi Nitin
    Thanks for the reply. Could you explain it with some code ?
    I tried to use the write statement , but it did not wrok. I could not see the result in SM37.
    write : "start of the FM1 processing".
    FM1 code
    write : "end of the FM1 processing".
    but those two statement did not show in SM37..
    1) how to use  a information message  ?
    2) how to use NEW PAGE PRINT ON and PRINT OFF command. ?
    I would appreciate if you can write some code ,that I can use directly.
    Thanks a lot.
    Best Regards,
    Ben

  • Need to e-mail job log after job completes (SM37)

    Greetings!
    I need to export the results of the Job Log (run SM37, double-click a finished job and then click "Job Log" button at top - this is the list I need).  Obviously, the program has already terminated so it won't be able to initiate it.  Is there another way?
    The need is to have this log be e-mailed automatically after it's ran or, at the very least, have a second "step" (job?) that reads the previous one and e-mails it's log. 
    We'd like to keep it automated and not have someone in operations have to remember to do this.

    Hi,
    Debugging can be done as follows:
    1. Put a breakpoint at the beginning report CRM_MKTTGGRP_EXPORT_BATCH
    2. Select your previously executed job in transaction SM37
    3. Type 'jdbg' into the tcode field in the upper left area
    To analyze the results and messages of the campaign execution, you can also have a look into the application log, either in the campaign application or in transation SLG1. There you should find details why the BPs have not been contacted.
    Hope this helps,
    Frank

  • To change the Job Log Detail in SM37

    Hi All,
    How can I change the standard JOB LOG detail in SM37 for partical program if it runs in Background.I have foumd the Function Module(BP_JOBLOG_READ) which is used to update this JOB LOG detail.How can I edit the standard .
    Kindly provide the ways .
    With Thanks,
    Dina.

    Hi ,
    Thank you for replying.
    I want to update some rows in JOB LOG detail .
    With Thanks,
    Dina.

  • Reading and writing a JOB LOG

    Hi
    How do we read the job log?
    How do we display it?
    Regards
    Nishant

    HI
    GOOD
    GO THROUGH THIS
    Use
    All message types issued by a program running in the background are stored in a job log, which you can display either to obtain information on a prematurely terminated program or to complete a detailed investigation of a particular background processing run. A separate log file is created for each job.
    Deleting Log Files
    You should never delete log files directly. If you want to clear the log directory, you must delete the jobs to which the logs belong. In the process, the logs are also deleted.
    Job logs are held in the TemSe temporary sequential objects storage facility. TemSe is configured to always store job logs as operating system files in the shared SAP directories. If you delete log files directly at the operating system level, you create inconsistencies in the TemSe database, which you'll then need to eliminate with the Consistency check function in Transaction SP12.
    Log Messages
    Log messages are generally output using ABAP keyword MESSAGE. With the exception of ABAP breakpoint statistics, no other data is normally output to the job log.
    ABAP Short Dumps
    If an ABAP program generated a dump when it terminated abnormally, you can display the dump by clicking on the Abend message.
    Batch Input Messages
    Messages output during batch input sessions are not recorded in the job log. These messages are output only to the batch input system.
    Procedure
           1.      Go to Select Background Jobs using Transaction SM37 or by choosing CCMS ® Jobs ® Maintenance.
           2.      Select the jobs you want to review in the job log by specifying conditions that identify the job or jobs, including job name, user name, job status, start condition, or contents of a job step. Execute this selection to see a list of jobs that match these criteria.
           3.      In the Job overview screen, select your desired job and choose Job log.
           4.      In the Job Log Entries for ).
           6.      For further information about a particular item in the job log, select the line and choose Long text. The resulting help screen can include further information about diagnosing the message, the system’s response to the message, and how the user should follow up.
    THANKS
    MRUTYUN

  • SM37 - JOBs was CANCELED

    Hello all,
    Can someone explain why Job was Canceled...
    tx = SM37 - JOBs were CANCELED
    Some JOBS were finished ans some were canceled:
    name: DELIVERY_APR / user: JHERNANS/ stts: COMPLETED/ date: 06.06.2007/start: 01:00:32/ finished: 07:26:17
    name: DELIVERY_JUN  / user: JHERNANS/ stts: CANCELED/ date: 06.06.2007/start: 01:00:36 /finished: 01:03:56/
    name: DELIVERY_MAR  / user: JHERNANS/ status: CANCELED/ date: 06.06.2007/ start: 01:00:32
    name: TS MAY NAT/ user: JHERNANS/ status: CANCELED/ date: 06.06.2007/ start: 01:00:36
    All JOBS above has just 1 STEP which is:
    ABAP program: AQIWGM==========TS============
    However each JOB has a different VARIANT(PARAMETER):
    job: DELIVERY_APR / parameter: &0000000004820
    job: DELIVERY_JUN / parameter: &0000000004885
    job: DELIVERY_MAR / parameter: &0000000004801
    job: TS MAY NAT / parameter: &0000000004856
    ALL CANCELEDS JOBS were canceled because :
    ABAP/4 processor: DBIF_RSQL_SQL_ERROR
    All CANCELED JOBS has the same at Job Log:
    - ABAP/4 processor: DBIF_RSQL_SQL_ERROR/ message class: 00/ message nº: 671/ message type: A
    - Job cancelled/ message class: 00/ message nº: 518/ message type: A
    Question: What has happened?
    Is a time overlapping problem
    Or
    Can it be a program problem?
    In Source Code Extract from the dump message there is:
    002400 START-OF-SELECTION.
    002410 perform init_texthandling(rsaqexce) using 'CL_TEXT_IDENTIFIER' ' ' 'ZSTE
    002420 data: %ret type i.
    002430 if sy-batch is initial and %excel is not initial.
    002440 perform check_wingui(rsaqsyst) using %ret.
    002450 if %ret <> 0.002460         message e842(aq).
    002470       endif.
    002480     endif.
    002490   perform authority_begin(rsaqexce).
    002500   perform authority(rsaqexce) using 'LIPS'.
    002510   perform authority(rsaqexce) using 'VBUP'.
    002520   perform authority(rsaqexce) using 'VBAP'.
    002530   perform authority(rsaqexce) using 'LIKP'.
    002540   perform authority(rsaqexce) using 'VBAK'.
    002550   perform authority(rsaqexce) using 'KNA1'.
    002560   perform authority_end(rsaqexce).
    +002570   perform %comp_ldesc.
      select LIPSLFIMG LIPSLGORT LIPSPOSNR LIPSVBELN LIPSVGBEL LIPSVGPOS
    002590          VBUP~WBSTA
    002600   into (LIPS-LFIMG , LIPS-LGORT , LIPS-POSNR , LIPS-VBELN , LIPS-VGBEL , L
    002610        , VBUP-POSNR , VBUP-VBELN , VBUP-WBSTA )
    002620   from ( LIPS
    002630          inner join VBUP
    002640          on VBUPPOSNR = LIPSPOSNR
    002650          and VBUPVBELN = LIPSVBELN )
    002660          where LIPS~LFIMG in SP$00020
    002670            and LIPS~LGORT in SP$00005
    002680            and LIPS~VBELN in SP$00018
    002690            and LIPS~VGBEL in SP$00022
    002700            and LIPS~WERKS in SP$00017
    002710            and VBUP~KOSTA in SP$00014.
    002720            and VBUP~WBSTA in SP$00012.
    002730     %dbacc = %dbacc – 1.+002740     if %dbacc = 0.
    002750       stop.
    002760     endif.
    002770     check SP$00020.                                                                               
    LOOKING MORE the DUMP SCREEN:
    Runtime errors DBIF_RSQL_SQL_ERROR
    Exception CX_SY_OPEN_SQL_DB
    Occurred on 06.06.2007 at 01:03:56
    An SQL error occurred when accessing a table.
    What happened?
    What can you do?
    Make a note of the actions and input which caused the error.
    To resolve the problem, contact your SAP system administrator.
    You can use transaction ST22 (ABAP Dump Analysis) to view and administer termination messages, especially those beyond their normal deletion date.
    Error analysis
    An exception occurred. This exception will be dealt with in more detail below. The exception, assigned to the class 'CX_SY_OPEN_SQL_DB', was not caught, which led to a runtime error. The reason for this exception is:
    How to correct the error
    Database error text........: "ORA-01114: IO error writing block to file %s (block # %s)"  Internal call code "[RSQL/FTCH/LIPS ]"
    Please check the entries in the system log (Transaction SM21).
    You may able to find an interim solution to the problem in the SAP note system. If you have access to the note system yourself, use the following search criteria:
    "DBIF_RSQL_SQL_ERROR" CX_SY_OPEN_SQL_DBC
    "AQIWGM==========TS============" or "AQIWGM==========TS============"
    "START-OF-SELECTION"
    Thanks a lot,
    Barbara

    From the dump:
    > select LIPSLFIMG LIPSLGORT LIPSPOSNR LIPSVBELN LIPSVGBEL LIPSVGPOS
    002590 VBUP~WBSTA
    002600 into (LIPS-LFIMG , LIPS-LGORT , LIPS-POSNR , LIPS-VBELN , LIPS-VGBEL , L
    002610 , VBUP-POSNR , VBUP-VBELN , VBUP-WBSTA )
    The listing seems to be cut off, so I don't know if this is the error or not, but it's something you can check.
    Rob

  • Suppress job log messages

    Folks, we have a custom program that calls the BAPI_SALESORDER_CHANGE and it writes a number of information messages (like "Date is in the past", "Not possible to determine a batch", "PO number already exists", so on and so forth) which gets written to the job log. To clarify, when you go to SM37 and select your job and click Job Log, a number of these messages are shown which is generating such a huge log that our job gets cancelled due to its sheer size.  Please note that this is not the SPOOL I am talking about.
    I have tried to call the BAPI in several ways like using "DESTINATION 'NONE'", calling in background task, and also SUBMIT but I still haven't gotten any luck. The huge log is causing problems with one of our jobs and we need it for UAT next week. I have opened a note with OSS and we are running into administrative issues. We do not want to go the Call transaction route.
    Is anybody familiar with this sort of issue? I searched everywhere and could not find anything similar or maybe I am not searching it right. Any help would be greatly appreciated.
    Sridhar

    Thanks Greetson. What you have provided are Sales Order create BAPI's. The RETURN parameters are different from the log messages. Look at my code below. I have no write statements but the BAPI is writing out these. This is an uncommon situation for some. I would appreciate if you can point me to some FM which changes sales order. Thanks a lot.
    report zzsritest2.
    tables vbak.
    parameters: p_vbeln like vbak-vbeln obligatory default '11658'.
    data: l_order like bapivbeln-vbeln,
          l_order_header_inx like bapisdh1x,
          l_bapischdl like bapischdl occurs 0 with header line,
          l_bapischdlx like bapischdlx occurs 0 with header line,
          l_return like bapiret2 occurs 0 with header line.
    start-of-selection.
      move p_vbeln to l_order.
      l_order_header_inx-updateflag = 'U'.
      l_bapischdl-itm_number = l_bapischdlx-itm_number = '00100'.
      l_bapischdl-sched_line = l_bapischdlx-sched_line = '0001'.
      l_bapischdl-req_dlv_bl =  '  '.  " CHANGE HERE
      l_bapischdlx-req_dlv_bl = 'X'.
      l_bapischdlx-updateflag = 'U'.
      append: l_bapischdl, l_bapischdlx.
      call function 'BAPI_SALESORDER_CHANGE'
        exporting
          salesdocument    = l_order
          order_header_inx = l_order_header_inx
        tables
          schedule_lines   = l_bapischdl
          schedule_linesx  = l_bapischdlx
          return           = l_return.
      read table l_return with key type = 'S'
                                   id = 'V1'
                                   number = '311'.
      if sy-subrc eq 0.
        call function 'BAPI_TRANSACTION_COMMIT'
          exporting
            wait = 'X'.
      endif.

  • How to display custom error message in Job log for batch processing

    Hi All,
    I am rexecuting one R/3 report in batch mode and i want to display all the custom error i have handled in job log when its executed from SM36,SM37. The custom error are like 'Delovery/Shipmet doe not exits' or others which we can display in online mode like message e100(ZFI) or any other way and accordingly we can handle the program control like come out of the program ro leave to transaction'Zxxx' or anything. But i want my program to be executed completely and accumulate all the error in job log of batch processing.
    Can anyone tell me how can i do so...
    Thanks,
    Amrita

    Hi,
    Thats what i have done from the begining. I have written message like this:
    Message i100(ZFI).
    I was hoping to see this message in the log. But i cant see. Can you help me pleae...

  • Regarding Messages to Job Log

    Hi,
    What is a Job Log.
    i have to write messages to job log.
    how to do this.
    how can i see that messages whether it is written or not.
    how it can be seen to the client/user.
    regards,
    kiran

    Hi Kiran
    Use 'write' to display the message in the job log.
    write : / log_message.
    Place this statement after the block of statements in your program where you want the message to be displayed in the log.
    You can see the job log in SM37 transaction.
    hope this helps you.
    regards
    Message was edited by:
            Sarah Bollavaram
    Message was edited by:
            Sarah Bollavaram

  • Write to AWS job log

    How can I write to the automation server job log file from my EDK AWS? This AWS does more then just return Groups and Users and I need to write to the log file the results of the additional operations.
    Please let me know how to implements this.

    Currently, the protocol between the portal and the remote web services only permits writing custom log messages from a crawler, but not from an authentication service or a profile service.
    We are considering this feature for future releases; in the meantime, you may want to follow the pattern we use for our own products, which use Log4N or Log4J to write a remote log file. In the case of a critical error that the administrator needs to know about, throw an exception with a message; in 5.0.1 this message did not get put in the job log, but in 5.0.2 it does.

  • Unable to delete job logs - Error : file is corrupted or unreadable

    Hi,
    We are running SolMan on Windows 2003 and there are some very old job logs (dated 2009) in "F:\usr\sap\sid\SYS\global\000JOBLG\" which we are unable to remove.
    The error is "The file or directory is corrupted or unreadable".  Because of this, Data Protector backup always has errors.
    I have run "RSBTCDEL2" but these logs were not removed.
    Is there a way to remove these stubborn old job logs?
    Thanks in advance

    >
    Sisab Nimda wrote:
    > Hi,
    >
    > We are running SolMan on Windows 2003 and there are some very old job logs (dated 2009) in "F:\usr\sap\sid\SYS\global\000JOBLG\" which we are unable to remove.
    >
    > The error is "The file or directory is corrupted or unreadable".  Because of this, Data Protector backup always has errors.
    >
    > I have run "RSBTCDEL2" but these logs were not removed.
    >
    > Is there a way to remove these stubborn old job logs?
    >
    > Thanks in advance
    Hi Sisab,
    Best is to determine whether you actually have the jobs from 2009 ( completed / Cancelled ones ) in your Solution manager system. If they donot exist in the job tables ( normally can be seen using transaction SM37 and a date range ), just go ahead and delete the joblogs from the OS level from 2009.
    Regards
    Amit

  • Regd  job log.

    hi,
    what is the transaction code for joblog?

    Hi,
      SM37 is the TCode for back ground jobs. here you have to give the job name, user id and select the job status tabs to get the status of the job. it will take you to the next screen by double clicking on the job it will take you to the job details screen on top  you will find a tab called Job Log by clicking on this you will get the job information like details of the particular job.
    Regards
    Sankar

  • MIssing Job logs for backgroup job

    HI All,
      I created the program and inside my program i use the submit to call the standard program RVV05IVB for update document, when i treid to run my program in backgroup job, the doc able to update but i cannt see the job logs in SM37.
    any one how it this happen ? or i need to use another way ?
    Thanks .

    Hi,
    I have tried for the given program For this it showing the error log check my prgrm once may be it is useful for  u
    Delivery creation Program though background job Tcode: VL10G
    Create Job with Tcode: SM36
    1.Jobname: u201Czvl10gtkru201D
    2.-step button
    3.Abap program name : RVV50R10C
    4.Varient : u201CWMTestu201D
    5.save
    6.back
    7.-start condition button
    8.Enter u201Cdate/time or immediate buttonu201D
    9.save
    10. job saved
    To See Job Results: Tcode : SM37
    To see the delivery creation job collective results at Tcode: V_SA
    How to Transport a Variant:
    Tcode: SE38:
    1.Enter program:
    2.Select variant and press change button
    3.Select the appropriate variant
    4. Then go to Utilities and select u201CTransport requestu201D
    Regards
    krishnakiran

  • SM37 - Job overview

    In this transaction, i can see Jobs status as
    - Scheduled
    - Released
    - Ready
    - Active
    - Finished
    - Canceled
    Is there a sequence which has to be followed ie, first will be active, released ...... finished.
    ALso what is scheduled Job do.

    Hello Rajesh,
    Any background job goes through the following states 'in that sequence':
    1. Scheduled (the job has been planned, it will execute at some point of time in future, but you may still edit the job steps at this stage)
    2. Released (the job steps cannot be edited, any job scheduled in 'immediate' mode will be in released state directly)
    3. Ready (the job is in execution queue and is about to be executed depending upon availability of background work process and the job priority)
    4. Active (the job is being executed by a background work process, you may monitor this in sm37 and sm50/51)
    5. Finished (all the job steps completed successfully) OR Cancelled (there was a error and job has been terminated, as mentioned in the job log)
    Coming to your second question, scheduled job will go through the states mentioned above before its finished or cancelled.
    This may clarify your doubts.
    Regards,
    Saurabh.

Maybe you are looking for

  • Download CS6 on new computer

    I bought a new computer with Windows 8 and I would like to download my CS6 on this computer.  How do I do this?

  • ZendCore install on AIX via telnet

    I'd like to install Apache and PHP 5 on our AIX 5.3 server. The servers are remote - I only have access to them through telnet. Is there any way I can run the ZendCore install utility - I tried through telnet and it tells me : Error while executing t

  • WPF Application Help

    I have been working on setting up a new published environment and have ran into a problem with an application causing a screen flicker.  I reached out to the company that wrote the application and they have seen the problem with previous server OS's

  • Problems transfering Files

    Hello :) im having a problem transfering a .mdb (access db) file to an ftp site. im not sure if i am going in the correct direction but the meathod i used worked with sending html files. the code im using goes as such... //^^set ftp location, usernam

  • Old timer can't load old FCE.

    After a long absence, I can't load my old FCE 2.0.1  Went through the FMS Remover process and still can't engage the application. Tried to dump "Preferences" without knowing why and had no success.  Is the program out of date?  Do I need another upgr