Spool list is not getting created for background job

I am creating background job using JOB_OPEN and then submitting my z-report using submit statement and then closing job using JOB_CLOSE. for this job is getting creating in sm37 and also gets finished but it does not create spool list showing output.
Any idea how to do this?
Thanks in advance.

DATA: lv_jobname TYPE tbtcjob-jobname,
        lv_jobcount TYPE tbtcjob-jobcount,
        lv_variant TYPE variant,
        wa_var_desc TYPE varid,
        wa_var_text TYPE varit,
        it_var_text TYPE TABLE OF varit,
        it_var_contents TYPE TABLE OF rsparams.
  REFRESH: it_var_contents, it_var_text.
  CLEAR: wa_var_desc, wa_var_text.
  CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
    EXPORTING
      curr_report     = sy-cprog
    TABLES
      selection_table = it_var_contents
    EXCEPTIONS
      not_found       = 1
      no_report       = 2
      OTHERS          = 3.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  CONCATENATE sy-datum sy-timlo INTO lv_variant.
  wa_var_desc-mandt       = sy-mandt.
  wa_var_desc-report      = sy-cprog.
  wa_var_desc-variant     = lv_variant.
  wa_var_desc-transport   = 'F'.
  wa_var_desc-environmnt  = 'B'.
  wa_var_desc-version     = '1'.
  wa_var_desc-protected   = 'X'.
  wa_var_text-mandt = sy-mandt.
  wa_var_text-langu = sy-langu.
  wa_var_text-report = sy-cprog.
  wa_var_text-variant = lv_variant.
  lv_jobname = lv_variant.
  CONCATENATE 'Batch Job Variant -'(006)
              sy-uname INTO wa_var_text-vtext.
  APPEND wa_var_text TO it_var_text.
Create the varaint for the back ground job.
  CALL FUNCTION 'RS_CREATE_VARIANT'
    EXPORTING
      curr_report               = sy-cprog
      curr_variant              = lv_variant
      vari_desc                 = wa_var_desc
    TABLES
      vari_contents             = it_var_contents
      vari_text                 = it_var_text
    EXCEPTIONS
      illegal_report_or_variant = 1
      illegal_variantname       = 2
      not_authorized            = 3
      not_executed              = 4
      report_not_existent       = 5
      report_not_supplied       = 6
      variant_exists            = 7
      variant_locked            = 8
      OTHERS                    = 9.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
Open the job.
  CALL FUNCTION 'JOB_OPEN'
    EXPORTING
      jobname          = lv_jobname
    IMPORTING
      jobcount         = lv_jobcount
    EXCEPTIONS
      cant_create_job  = 1
      invalid_job_data = 2
      jobname_missing  = 3
      OTHERS           = 4.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
           WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
submitt the job in background mode.
  CALL FUNCTION 'JOB_SUBMIT'
    EXPORTING
      authcknam               = sy-uname
      jobcount                = lv_jobcount
      jobname                 = lv_jobname
      report                  = sy-repid
      variant                 = lv_variant
    EXCEPTIONS
      bad_priparams           = 1
      bad_xpgflags            = 2
      invalid_jobdata         = 3
      jobname_missing         = 4
      job_notex               = 5
      job_submit_failed       = 6
      lock_failed             = 7
      program_missing         = 8
      prog_abap_and_extpg_set = 9
      OTHERS                  = 10.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
           WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
close the job.
  CALL FUNCTION 'JOB_CLOSE'
    EXPORTING
      jobcount             = lv_jobcount
      jobname              = lv_jobname
      strtimmed            = 'X'
    EXCEPTIONS
      cant_start_immediate = 1
      invalid_startdate    = 2
      jobname_missing      = 3
      job_close_failed     = 4
      job_nosteps          = 5
      job_notex            = 6
      lock_failed          = 7
      invalid_target       = 8
      OTHERS               = 9.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
           WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
Hope this will be helpful..

Similar Messages

  • Automatic Mail not getting generated through background job

    Hi Experts,
    We have set up a job variant with spool recipients. We are getting the automatic mail if the job is getting finished successfully. But we are not getting the automatic mail if the job is in cancelled status. Earlier we used to get the mail even if the job is in cancelled status. We are not sure if there is any setting which would restrict the automatic mail based on the job status.
    Appreciate your help in this regard.
    Thanks and Regards,
    Ranjani.

    Hi,
    Just for a work around, try checking the SAP user inbox for the user who has scheduled the background job.
    I don't there  is any seperate configuration in Spool List Recipient for the canceled jobs. We need to confirm that the email ids provided in the Spool List recipient are correct and the background job creates a spool request even if it is canceled.
    Also if possible try deleting the existing background job and create a new background job with the same parameters and valid email id's maintained in the Spool List recipient.
    OR
    Without deleting the existing background job, parallely create a new background job with the same parameters and valid email id's maintained in the Spool List recipient. If it works then delete the old background job.
    Thanks
    Harish

  • Spool not getting created in batch job

    Hello experts,
    We have a requirement of printing BA00, BA01 and LD00 from different application.
    We have done same code for all BA00, BA01, and LD00.
    Normally the code is working fine except in few cases, when batch job is created but spool is not created.
    DATA: job_name TYPE tbtcjob-jobname,
                  number   TYPE tbtcjob-jobcount,
                  print_parameters TYPE pri_params,
                  wv_pripar    TYPE pri_params,
                  wv_arcpar    TYPE arc_params,
                  wv_val       TYPE c VALUE 'X',
                  wv_false     TYPE c VALUE 'X',
                  gv_mandt     TYPE tsp01-rqclient,
                  gv_user      TYPE tsp01-rqowner.
              CLEAR: gv_mandt, gv_user, number.
              gv_mandt = sy-mandt.
              gv_user  = sy-uname.
              job_name = 'DELIVERY_PRINTING'.
              CLEAR: range1.
              range1-sign = 'I'.
              range1-option = 'EQ'.
              range1-low = 'LD00'.
              CLEAR: range1-high.
              APPEND range1 TO range.
              CALL FUNCTION 'JOB_OPEN'
                EXPORTING
                  jobname          = job_name
                IMPORTING
                  jobcount         = number
                EXCEPTIONS
                  cant_create_job  = 1
                  invalid_job_data = 2
                  jobname_missing  = 3
                  OTHERS           = 4.
              IF sy-subrc = 0.
                SUBMIT sd70av2a WITH  rg_kschl IN range
                                WITH  rg_vbeln IN deli_tab
                                TO SAP-SPOOL
                              SPOOL PARAMETERS print_parameters
                              WITHOUT SPOOL DYNPRO
                              VIA JOB job_name NUMBER number
                              AND RETURN.
                IF sy-subrc = 0.
                  CALL FUNCTION 'JOB_CLOSE'
                    EXPORTING
                      jobcount             = number
                      jobname              = job_name
                      strtimmed            = 'X'
                    EXCEPTIONS
                      cant_start_immediate = 1
                      invalid_startdate    = 2
                      jobname_missing      = 3
                      job_close_failed     = 4
                      job_nosteps          = 5
                      job_notex            = 6
                      lock_failed          = 7
                      OTHERS               = 8.
                  IF sy-subrc <> 0.
                  ENDIF.
                ENDIF.
                WAIT UP TO 10 SECONDS.
    ** to give the data to the printer***
    *            CLEAR gv_rqident.
                SELECT SINGLE listident INTO gv_listident FROM tbtcp
                              WHERE jobname = job_name
                               AND  jobcount = number.
              IF sy-subrc = 0.
                MOVE gv_listident to gv_rqident.
                CALL FUNCTION 'RSPO_OUTPUT_SPOOL_REQUEST'
                  EXPORTING
                    spool_request_id = gv_rqident.
              ENDIF.
    The same code is for all the output BA00, BA01 and LD00.
    The issue is that for few batch jobs (which is created in the above code) , spool is not getting created.
    Thanks and Regards,
    Paritosh Pandey

    Hi,
    The code starting from WAIT UP TO 10 SECONDS. - not only does it look attrocious, is error prone (if no free process for executing batch job is available for 10 seconds, or if the job runs for more than 10 seconds, what will happen...?), but seems utterly unnecessary... Is there any reason immediate spool output can not be handled by simply setting PRINT_PARAMETERS-PRIMM = 'X'?
    cheers,
    Janis
    Edit in:
    Ok, i just read Document in spool but not printed... Do not use an output device relying on frontend access methods to do printing from background processing. Frontend is not available during background processing, period. To my knowledge there is no easy, clean solution to this problem other than defining and assigning, per user, output devices not relying on frontend printing. What if the dialog user has logged off by the time batch job finishes..? May the spool remain unprinted?
    Has the SAP Basis refused to define output devices (I have hard time believing this...)? Well, tell them one time to stop being silly and if they do not cooperate, tell the owner of the requirement that it can not be implemented due to uncooperative Basis then... and that the users will have to keep going to SP01 and manualy start the output!
    Message was edited by: Jānis B

  • Accounting doucment not get created for Credit Memo

    Hi
        When creating a cancellation doucment(vf11) for credit memo accounting document not get created.While I go for analysis then it is determining the G/L account.But not getting created the accounting doucment.
    When i select "Release to accounting" then it is giving a message like this:
    "Automatic clearing of billing document 951
    and canc. doc. 90000572 not poss."  as informatiion first
    and then later it is throwing an error message that "maintain correct number range"
    While for the same material or earlier cancellation happened and accounting doucment get created.
    Please help me out;How would i get this solved?
    Thanks in advance

    Hi,
    You may also check for Number Range - Maintainance & Assignment.
    T. Code: SNRO
    Table/ View: RV_BELEG
    Here, Mantain Number Range.
    To Assign,
    T. Code: SM30
    T.Code: Bill_Num (or select if different in your case)
    Assign No. range to your combination of Sales OrgDist.ChannelBill Type i.e. for Cancelled Billing Doc. Type
    To Maintain Number Range for Accounting Documents,
    T. Code: FBN1
    Best Regards,
    Amit

  • Extension folder is not getting created for firefox 4 in Mac OS

    in Mac OS 10.6, 10.5, extension folder is not getting created in the profile for the firefox 4.0. Where as in Firefox 3.6 when you launch the firefox first time, profile folder is created and extension folder is also part of that.

    That extensions folder will only be created if there are extensions found that need to be installed. If there are no extensions then Firefox doesn't create an empty extensions folder.<br />
    On Windows there is a lot of security software that installs extensions globally.
    * https://developer.mozilla.org/en/Installing_extensions
    * https://developer.mozilla.org/En/Developer_Guide/Customizing_Firefox
    * https://developer.mozilla.org/en/Adding_Extensions_using_the_Windows_Registry

  • Inspection lot not getting create for 01 Insp type after Intransit

    Hi Qm Gurus,
    I have a Material 'A' which is producing in the plant IN05 and transferring to IN06 plant. We have Scheduling agreement PO for this. After Scheduling Agreement we are doing Transferring the Goods thro 351 GI Movement type. So now the parts will be there in transit.
    So now when I receive this goods in IN06 thro 101 MT, Insp lot is not getting create, it goes to Unrestricted. If I create a std PO for the same when I receive the goods thro 101, it is posting into Insp lot. But after 351 & if I do 101 material is not going into Inspection. Pls advise.
    I checked the Insp type 01 Active for IN06, Quality info record is fine, Quality plan also fine. Pls let me know whether i am missing something?

    Hi ,
    Please activate inspection type 08 stock transfer ..
    If this inspection type is active then during stock transfer lot gets generated.
    Also check QM active for this perticular movement in custamizing setting.
    Regards
    SANIL

  • Mail not being sent for background job spool

    Hello All,
    I have created a back ground job by adding a mail id in the spool receipient list. The job has finished successfully and spool is created but the mail has not been sent I have checked SOST transaction and no mail has been sent to this mail id.
    This is only happening for some jobs other jobs are able to successfully send the spool as mails to the mail id's mentioned in spool receipient list.
    I would like to know why this is happening only for some jobs and how can I check the whether mail has been generated or not.
    Your replies will be greatly appreciated.
    Thankyou,
    Ranjan

    Hi
    To check whether mail is generated you can create dynamic break-point with SAAB transaction.
    Using this transaction you create a memory area for your jobs where you can load any data value of your report..
    Probably something goes wrong with COMMIT of Mail Function module system.
    Hope to help..

  • Sales order not getting created in background.

    I am using user exit to write my code to create sales order of basic type ORDERS05 with function module idoc_input_orders, and process code ORDE with my own message type.
    If I run the program in foreground message KUWEV-KUNNR is not an input field comes.
    IF I press enter the sales order is getting created with staus 53..
    But in background ERROR MESSAGE comes as:
    Function module not allowed: IDOC_INPUT_ORDERS.
    Please give suggestions.

    Dear Sir,
    Please check the FI Period is opened and FI account Number is opened.
    Thanks and Regards
    N.soma Sundaram

  • Profile class not getting created for new site for existing customer.

    Hi,
    I am creating a new site address for an existing customer using Customer Interface in oracle apps 11.5.10.2. The issue is the profile class is not getting assigned correctly at site level. It is getting defaulted with the profile class of the customer. Below is the data that I am inserting in RA_CUSTOMER_PROFILES_INT_ALL
    INSERT INTO ra_customer_profiles_int_all
    (orig_system_customer_ref
    ,orig_system_address_ref
    ,insert_update_flag
    ,customer_profile_class_name
    ,credit_hold
    ,org_id
    ,last_updated_by
    ,last_update_date
    ,created_by
    ,creation_date
    ,last_update_login
    )VALUES
    (x_orig_system_reference -- This is old customer reference as he already exists in the system
    ,x_address_ref -- This is a new address reference
    ,'I'
    ,rec_cust_det.customer_profile_class_name -- In the file I am giving it as 'ABC1' but it is getting defaulted with 'DEFAULT' which belongs to customer profile class at the header level
    ,'N'
    ,fnd_profile.value('org_id')
    ,fnd_global.user_id
    ,SYSDATE
    ,fnd_global.user_id
    ,SYSDATE
    ,fnd_global.login_id
    Can anyone please help me how to resolve this issue. Hope you understood. Otherwise please let me know.
    Regards
    Dev

    Please apply patch 4649221 to get this work.
    Regards
    Dev

  • One Step GI - GR is not getting created for an STO

    Good Morning All,
    Actually we have made a setup that whenever we create a Goods Issue for STO type (UB - PO ) in the supplying plant we are creating the GR in the background . WE have made the configuration in SAP R/3 version 4.6c with One STEP Movment, that is when we create the GI (351 ) movment then GR (101) should be created automatically. Actually its not working properly. And sometimes it creates the GR with the USer as WF-BATCH.
    Let me know where exactly I need to check for the failure.
    In such cases if there is error in the background process, means, is there any transaction where it shwos the authorization or other failures happened to the system.
    Advance thanks....
    regards,
    Sabari Prabhu.

    Dear Venkadesh,
       Which Batch job should i need to check for this.Because I am not seeing any batch job relatred to that.
    Regards,
    Sabari Prabhu.

  • Transport not getting created for certain SPRO settings in Golden client

    Hi,
    Currently we are in the realization phase of the project ,we are in the process of configuring system in golden client.
    For some SPRO configurations ,the system is not prompting for the Transport request.
    Kindly let me know if anybody had gone through similar kind of issue.
    Regards,
    mmuser
    Edited by: mm Keyuser on Dec 30, 2009 5:34 AM

    Hi,
    Please check for the configurational table for which you are facing problem, its delivery class should be "C" under delivery & maintenance.
    You can get it checked by your ABAP team.
    hope this will help.
    Regards,
    AK

  • Delivery not getting created for Stock Transfer Purchase order

    Hi,
    My user having one issue with stock transfer order. User is not able to generate the delivery for the particular material against stock transfer PO. Here checking rule is not maintained.Kindly advice.

    Hi
    Please, see SAP Note 498143 - FAQ: Stock transfer with delivery in purchasing.
    I hope this helps you
    Regards
    Eduardo

  • Required attribute not getting created

    Ok, here is a wierd one.
    I have some custom ID management code (an SSO plug-in cert mapper and a WAR file I deploy to OC4J_SECURITY). The application provides a registration process that creates user entries and RADs for Oracle Forms app users. Everything works fine, except that I have found that my RAD creation does not get the orclresourceviewers attribute created automatically.
    This has worked in my IM development farm. The attribute would be created automatically. It was difficult to figure out this was the reason my Forms App Server would fail with the following exception.
    oracle.ldap.util.AccessDeniedException: General Error when performing search: getExtendedProperties [LDAP: error code 50 - Insufficient Access Rights]
    I have gone through the motions of now preparing to query the OID Forms ID so that I can fill in this attribute in my RAD creation class. I still would like to know why this attribute is not getting created for me anymore.
    Any ideas?
    Oh and BTW, it did not help that orclresourceviewers is not documented anywhere I could find (not OID Admin and not Forms Deployment Guide)
    regards,
    tt

    Hi Sandeep.
    Yes, my application entities that I set up to manage a specific realm are used to create all RADs in a particular realm. As part of the setup for this I add these application entitites to the following three realms:
    cn=OracleDASAdminGroup,cn=Groups,cn=OracleContext,dc=<realm_name>,dc=<abc>,dc=<com>
    cn=RealmAdministrators,cn=Groups,cn=OracleContext,dc=<realm_name>,dc=<abc>,dc=<com>
    cn=UserProxyPrivilege,cn=Groups,cn=OracleContext,dc=<realm_name>,dc=<abc>,dc=<com>
    I add to these so that the app entity could create, modify, delete and proxy to any realm user. I had to create an ACI to allow my entities to search and see the Forms Server application entity entry in order to populate orclresourceviewers.
    I just wish I new why orclresourceviewers does not get created automatically. Of course, if I create the RAD in DAS or using the Oracle DynamicResourceCreate option, it is added. It has added it in my own RAD creation code at one point and it stopped for some reason.
    I had to add an LDAP search to my RAD creation code with the possibility of multiple Forms Server entries (Logical Application Group) just in case. Much ado for something that maybe should not have been necessary.
    regards,
    tt

  • ERMS : Email work items not getting created

    Hi Forum
    In my test system (CRM 2007), inbound mails were properly coming in and getting distributed to agent's inbox. But after the server restart, I realised that the work items for inbound mails stopped getting created due to which mails are not reaching agent's inbox.
    Mails are visible in SOIN but their associated Work items are not there in SWI1.
    I have checked almost all the settings like Email Distribution (SO28), CRM_ERMS_WF_CUST (Event lining is in place and is active), swu0 (Event simulation is working).... but still not sure why work items are not getting created for inbound mails.
    Any thoughts ? Help will be deeply appreciated.
    Regards
    Vishal Mani

    Thanks Bruno for your time to reply !
    I checked this transaction and in overview there are 19 events with errors. But apart from that everything is green.
    I checked the Linkages with Error tab and realised that the events with errors belong to object type BUS1006.
    In Activation tab --> Linkages --> Object type (ERMSSUPRT2) --> Linkage is activated.
    Infact that is the first thing, I checked when work items were not getting created.
    So no clue from here too.
    Regards
    Vishal Mani

  • How to identify what are all the events are created in background jobs?

    Hi all,
    how to identify what are all the events are created for  background jobs. And what events gets triggered for a particular job.
    thanxs
    haritha

    Hi Haritha,
    JOB is a program which starts to a determined point of time and executes some standard programs in the system. JOBs can be planed to a determined point of time on the regular basis (every night, for example) or to some discret time moments. So, the JOB can be planed and then will be started automatically without the manual start.
    Realtime programs are understood in the most cases as actual program execution which is started by somebody to the actual moment of time.
    Typically per JOBs some special processes will be started that should be executed automatically and regularly: for example, IDOC application, some correction reports, statistic updates etc.
    Standard jobs are those background jobs that should be run regularly in a production SAP System These jobs are usually jobs that clean up parts of the system, such as by deleting old spool requests.
    Use
    As of Release 4.6C, the Job Definition transaction ( sm36 ) provides a list of important standard jobs, which you can schedule, monitor, and edit.
    Standard jobs are those background jobs that should be run regularly in a production SAP System. These jobs are usually jobs that clean up parts of the system, such as by deleting old spool requests.
    for more information you can go thru the following thread:
    http://help.sap.com/saphelp_nw70/helpdata/en/24/b884388b81ea55e10000009b38f842/frameset.htm
    About Events:
    Events have meaning only in the background processing system. You can use events only to start background jobs.
    Triggering an event notifies the background processing system that a named condition has been reached. The background processing system reacts by starting any jobs that were waiting for the event.
    Types of Events:
    There are two types of events:
    1.)System events are defined by SAP. These events are triggered automatically when such system changes as the activation of a new operation mode take place.
    2.)User events are events that you define yourself. You must trigger these events yourself from ABAP or from external programs. You could, for example, signal the arrival of external data to be read into the SAP system by using an external program to trigger a background processing event.The event scheduler processes an event if the event is defined in the system.
    For example, if a system (System 1) receives an event from another system (System 2), the event scheduler of System 1 processes the event only if it is defined in System 1. That event does not need to be defined in System 2 (the sending system).
    You define an event by assigning a name (EVENTID) to it. When defining an event, you do not define the event arguments.
    for more information you can go thru the following thread:
    http://help.sap.com/saphelp_nw04s/helpdata/en/fa/096e2a543b11d1898e0000e8322d00/frameset.htm
    When you schedule the process chain or infopackages the jobs associated with it run in the background mode. In case you want to create a job for a specific activity you can do so in SM36. You would be creating jobs that would get executed in any one of the options:
    1. Immediate
    2. Date & Time
    3. After event.
    4. After job.
    5. At Operation mode.
    In case you want to view the job logs go to sm37.
    Also Pls check DB02 for database performance and ST03 for workload .
    Analyse u will have an idea ,
    *pls assign points,if info is useful**
    Regards
    CSM reddy
    null

Maybe you are looking for

  • Office 2013 and the KB3001652 update

    I am using a click-to-run version of Office 2013 on my 64-bit Windows 7 SP1 system. I do not allow Windows to update my system automatically.  Unless there is a good reason to do it more frequently, I use Windows Update every month to update my syste

  • Black Screen? Windows Installation

         I have installed windows 7 32-bit on my computer about 4-5 times so i know how to do it. Now i am installing 64-bit Windows 7 onto my school computer for Broadcasting/Video production. The new Imac 2.7GHz I5, I use bootcamp assistant to partitio

  • Error when maintaining output condition records

    Hello experts I m getting an error while maintaining output condition records using VV11. The error reads as "862     System error: system cannot read the structure for table B567". Can you pls help in identifying the root cause. I checked that the c

  • Help installing CS upgrade to new machine, old PS 5.0 cd not recognised as proof of ownership

    Trying to rebuild a win XP system for my wife. Her machine with PS CS has crashed. When I install PS CS upgrade the install routine wants a PS 5.0 disc to verify the license. Then it give an error that "A qualifying version of Photoshop was not detec

  • Won't Launch?

    Ok so it opens but as it's loading all the filters and whatnot, it gets stuck on RP500. The RP500 is my guitar pedal so I don't know why that's getting involved with Final Cut. But I don't know what to do to make it open.