Wrapper program when run in background not generating SPOOL

I have created Program A which calls internally Program B or C based on the condition. When I run the program B or C independently in Background it generates the spool on completion. But When I run the program A in Background, Spool is not getting generated.
My requirement is that Spool should be generated when Program A is executed in Background.
Below is the code of program A:
PROGRAM A.
    IF p_cons = 'X'.
*-->Detailed Details of Interim or Final Settlement
      SUBMIT B               WITH  p_vtnr   EQ p_vtnr
                             WITH  p_setqty EQ p_setqty
                             WITH  p_test   EQ p_test
                             WITH  s_abrdat IN s_abrdat
                             WITH  r2       EQ r2
                             WITH  r1       EQ r1
                             AND RETURN.
    ELSE.
*-->Summary Details of Interim or Final Settlement
      SUBMIT C                   WITH  p_vtnr   EQ p_vtnr
                                 WITH  p_setqty EQ p_setqty
                                 WITH  p_test   EQ p_test
                                 WITH  s_abrdat IN s_abrdat
                                 WITH  r2       EQ r2
                                 WITH  r1       EQ r1
                                 AND RETURN.
    ENDIF.
Please guide me on this.
Regards,
Naveen

Hi Naveen,
Check this
Submit report to job
submit ztest via job l_jobname
                               number l_jobcount
                              to sap-spool without spool dynpro
                             spool parameters ls_params
                          and return.

Similar Messages

  • Report program when run in background job getting cancelled immediately

    Hi
    When i run a program in foreground i am able to see the output. But when run in background not able to run the job successfully. The job is getting cancelled immediately.
    I am using the below function module for output display. Should i need to pass any parameters in the below function module so that i can run the program in background  successfully.
      CALL METHOD DETAIL_GRID->SET_TABLE_FOR_FIRST_DISPLAY     
          EXPORTING                                            
            IS_LAYOUT         = IS_LAYOUT                    
            I_SAVE            = 'A'                        
            IS_VARIANT        = GS_VARIANT                   
          CHANGING                                           
            IT_FIELDCATALOG   = IT_FIELDCATALOG               
            IT_OUTTAB         = BLOCKED_STOCK_TAB_ALV[].     
    Please suggest.
    Thanks and regards
    Rajani Yeluri

    Hi Rajani.
      ALV require the DRYPOR(screen) for display but incase you run in back ground which have to write to spool but in spool we can only write in format of LIST REPORT not inter-active report like ALV. That why
    system cancelled your process immediately.
    Hope it helps.
    Sayan.

  • Difference in runtime of a program when run in background vs foreground

    Hi,
    Is running the program in background would result to better performance in terms of speed compared to foreground? If yes, what's the reason behind.
    Thanks!

    Hi Advait,
    >
    Advait Gode wrote:
    > Yes, program does run faster in background process than running in foreground.
    sorry... an ABAP program will NOT run faster in background.
    As could be seen from your link:
    - a program in background does not have a timout limit
    - a program in background can use a different memory allocation sequence (depends on configuration)
      and may be able to allocate more memory than a foreground program (depends on configuration as well)
    but it will not run faster... .
    Kind regards,
    Hermann

  • Getting the variant name when the report program is run in background

    Hi All,
    How to get the variant name for the report program when run in background? My requirement is to create an email attachement with the name 'variant.XLS', where variant = selection screen variant, when the report program is run in background. The system field SY-SLSET holds the variant name only when run online.
    Any pointers to this will be highly appreciated.
    Thanks and regards,
    Nilesh.

    Hello Nilesh,
    Please find the algo:
    1. Call the FM: GET_JOB_RUNTIME_INFO to get the background job details.
    2. Select data from TBTCP using these details:
    DATA:
    FP_EVENTID   TYPE BTCEVENTID
    FP_EVTPARM   TYPE BTCEVTPARM
    FP_ACTIVE    TYPE BTCXPGFLAG
    FP_JOBCNT    TYPE BTCJOBCNT
    FP_JOBNM     TYPE BTCJOB
    FP_STEPCNT   TYPE BTCSTEPCNT.
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
        IMPORTING
          EVENTID                 = FP_EVENTID
          EVENTPARM               = FP_EVTPARM
          EXTERNAL_PROGRAM_ACTIVE = FP_ACTIVE
          JOBCOUNT                = FP_JOBCNT
          JOBNAME                 = FP_JOBNM
          STEPCOUNT               = FP_STEPCNT
        EXCEPTIONS
          NO_RUNTIME_INFO         = 1
          OTHERS                  = 2.
      IF SY-SUBRC <> 0.
    *   Error calling FM: GET_JOB_RUNTIME_INFO
      ENDIF.
    DATA: FP_VARIANT TYPE BTCVARIANT.
      SELECT JOBNAME JOBCOUNT STEPCOUNT VARIANT
      FROM   TBTCP
      INTO TABLE L_IT_TBTCP
      WHERE  JOBNAME   = FP_JOBNM
      AND    JOBCOUNT  = FP_JOBCNT
      AND    STEPCOUNT = FP_STEPCNT.
      IF SY-SUBRC = 0.
        SORT L_IT_TBTCP BY JOBNM JOBCNT STEPCNT.
        READ TABLE L_IT_TBTCP INTO L_WA_TBTCP INDEX 1.
        IF SY-SUBRC = 0.
          FP_VARIANT = L_WA_TBTCP-VARIANT.
        ENDIF.
      ENDIF.
    Hope this helps.
    BR,
    Suhas

  • Dynamic Documents ( CL_DD_DOCUMENT ) in background to generate spool

    Hi Everyone,
    Is it possible for a Dynamic Document with the use of CL_DD_DOCUMENT to run in background and generate spool output?
    If it is possible, can you please tell me how?
    Thanks in advance.

    Hi Denver,
    dynamic documents are screen controls to be put in a (enjoy) container controlled by SAPGUI. In background, SAP just ignores any display processing for GUI controls.
    The CL_GUI_ALV_GRID is an exception here, in background output is converted to an ALV list. I don't know and I don't think that for dynamic documents anything comparable exists.
    Regards,
    Clemens

  • When you load Windows via Boot Camp Assistant program and run Windows does not recognize the "usb" outlets cannot identify the device through the Dvd or flash

    When you load Windows via Boot Camp Assistant program and run Windows does not recognize the "usb" outlets cannot identify the device through the Dvd or flash

    Did you install BC drivers on the Windows side?

  • RMMR1MRS-When run in background cause update failure errors looking

    hi,
          RMMR1MRS report when run in background cause update failure errors .
    There are few  below reason for the error log.
    1.  for the PO invoice already generated -  (its right if already invoice generated. should not happen again)
    2.  In  MIGO,  entire  quantity has been reversed  and also invoice generated with zero value - ( its right , should not happen invoice again )
    3. Particular PO line item deleted -  (its right if the PO line item deleted. ERS settlement not require)
    For the all above reason, the update error occurs.  But the mean time  the program  "RMMR1MRS"  should not through the update error log. 
    Note: The job was not terminated due to this update error and also no harm because of the error log
    can you please help on this update failure why it occurs.

    Have you found a solution already? If so, please, share it with the community and close this thread.

  • System is showing time out when run in background

    Dear all,
    We have two systems: One R/3 and EBP. We have made one report where the remote function module will be called from R/3 to EBP. There are 4 lakhs data in SAP. We are sending 10000 data as package in internal table and getting the corresponding output. But the system is showing time out when the report has run in background. Can you please suggest how the process can be improved so that the timeout can be avoided.
    Thanks and regards,
    Atanu

    Hi,
    Try to fetch records in smaller chunks and process them.  For example, if you are trying to fetch records for one year, instead of single query, try to fetch in 12 sets for each month.  Fetch first month and process the records and put them in the output internal table.  Then go for next month and so on.  Anyway your program is running in background.  There will not be any user complaint also.  The solution might sound bit funny.  But it works.
    Regards,
    Hema

  • Amount field getting rounded up when run in background

    Hello All,
      when i run a report in foreground the amount value(KBETR) is displaying properly with the value 12.78.But when the same report is run in background it is displaying 13.what should be done?
    Thanks,
    Rakesh.

    Hi,
    Try to fetch records in smaller chunks and process them.  For example, if you are trying to fetch records for one year, instead of single query, try to fetch in 12 sets for each month.  Fetch first month and process the records and put them in the output internal table.  Then go for next month and so on.  Anyway your program is running in background.  There will not be any user complaint also.  The solution might sound bit funny.  But it works.
    Regards,
    Hema

  • The number of rows per page is greyed out when running in background?

    Hi,
    For a customized transaction the number of rows per page cannot be set when running in background.
    While a background job is created in SM36 after entering the report name and the selection variant name in the properties of Format the rows and columns field is greyed out.It was not editable.
    Is there any settings to be done or in the custom program any code change needs to be done?
    Thanks in advance.
    Regards,
    Sharon.

    Hi Gabriel,
    After double clicking the format only the rows field is not set to edit.It was greyed out.Is it anything related to the printer settings that will be maintained for a user?
    Regards,
    Sharon.

  • Regarding running a report in background and generate spool

    Hi,
    I am developing a report [<b>REPORT1</b>].
    It is taking long to execute if data is more.
    Now i want to schedule this report in background and generate spool along with.
    So once i execute REPORT1 it should run in background & generate spool?
    Can anybody give inputs for the same!
    Thanks,
    Deep.

    Hi,
              to generate spool, use below code
    FORM create_spool .
    CONSTANTS : l_c_device(4) VALUE 'LOCL'.
    Create Spool Request
    NEW-PAGE PRINT ON
    LINE-SIZE 120
    DESTINATION l_c_device
    IMMEDIATELY ' '
    KEEP IN SPOOL 'X'
    NEW LIST IDENTIFICATION 'X'
    NO DIALOG.
    ENDFORM. " create_spool
    And after createing spool to get the spool number use below code,
    FORM obtain_spool_id .
    TYPES : BEGIN OF t_tsp01,
    rqident TYPE tsp01-rqident,
    rqowner TYPE tsp01-rqowner,
    END OF t_tsp01.
    DATA : it_tsp01 TYPE STANDARD TABLE OF t_tsp01,
    wa_tsp01 LIKE LINE OF it_tsp01.
    SELECT rqident
    rqowner
    FROM tsp01
    INTO TABLE it_tsp01
    WHERE rqowner = sy-uname.
    SORT it_tsp01 BY rqident DESCENDING.
    READ TABLE it_tsp01 INTO wa_tsp01 INDEX 1.
    IF sy-subrc = 0 .
    v_spool_nr = wa_tsp01-rqident.
    ENDIF.
    Capture the immediate spool created for this report
    v_spool_nr = sy-spono.
    ENDFORM. " obtain_spool_id
    <b>Reward points</b>
    Regards

  • Error in BIM when running in background mode

    Hi,
    I am facing an error when running a BIM in sm35.
    The BIM runs fine with my userid in all three modes( foreground,display error mode, background mode)....but fails when the functional person is testing in background mode. The BIM runs fine in all other modes.
    It gives the message when running in background mode
    "No batch input data for screen SAPLMGMW 4008"
    What should I check or do to correct it.
    Please help.
    Regards
    Rashi

    The BIM runs fine in Foreground mode and in Display error mode even for the functional..It is giving error only for Background mode.
    I also did the following
    1.   Created the BIM in my id and tried running( in background) it using the other id ...it was successful
    2.   Created the BIM in other id and ran ( in background) using my id....it failed.
    I will check again for authorisations also.
    Regards,
    Rashi

  • How can I read the EXCEL file while Program is running in background.

    Hi all Expert,
    How can I read the EXCEL file while Program is running in background.
    Thanks

    you need to place ur excel file on application server and follow this thread: Reading an Excel file from the application server?
    loots of information if you can search forum.. thanks

  • Report with BDC not displaying success message when run in Background

    I am running a  BDC report in Background mode.The below statement  is not capturing the Success message when a document is posted.But when I am running the same in ForeGround mode it is capturing and is displayed in the output.Can anyone please help me in understanding why this is happening and how can I resolve this.
    CALL TRANSACTION 'MB1C' USING bdcdata MODE mode UPDATE 'S'
         MESSAGES INTO messtab.

    Hi Madhu,
    I think your BDC didnt generated any document when you run it in 'N' screen mode.
    Debug your program when you run it in background
    Goto Tcode :SM37
    Select the job ( march checkbox )
    ==> in command prompt enter 'JDBG'
    ==> Then you can start reexecting the job .
    You can check the sucess messages accordingly in debug mode
    Also add a read statement on messtab for msgtype = 'S'.
    Thanks
    Bhanu

  • Data not getting displayed in ALV grid when run in background

    Hello experts!
    Could anyone help me out please?
    I need to display an ALV grid in the background. My requirements are as follows:
    I first display an ALV grid in the foreground based on some input parameters. The user selects a few records for updating it and clicks on the "update" button. On the click of this button another report must be called and here the ALV report is displayed in the background.I am using "reuse_alv_grid_display" to display the grid.
    I am using Import/Export to get the selected rows in my called report. When i execute this report in the foreground i get the ALV grid along with the data. But when i execute it in the background, i get only the grid with the fieldnames and not the data when i check in SP01.
    Thanks in advance!
    Smitha

    Hi Smitha,
    If you are able to see in SP01 and only see the output layout or "List contains no data" shows clealry that the data is not getting passed in the called program or the data is not being used correctly in the called program.
    Cheers
    VJ

Maybe you are looking for