ALV report run In background gives 2 spool numbers

Hi ,
The ALV report which I am running in Background gives me 2 spool numbers after the Job is created in sm37.
I am just executing my ALV report by running it in backgroung procressing, but I get 2 spool one has all the correct data of the ALV and 1 blank spool is created.
I have Passed the followin parameter to my ALV FM.
  lwa_print-no_change_print_params = 'X'.
  lwa_print-no_print_listinfos = 'X'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
   EXPORTING
     i_callback_program       = sy-repid
     i_callback_pf_status_set = 'SET_PF_STATUS'
     i_callback_user_command  = 'USER_COMMAND'
     i_default                = space
     is_layout                = t_layout
     is_print                 = lwa_print
     it_fieldcat              = t_fieldcat
   TABLES
     t_outtab                 = t_final
   EXCEPTIONS
     program_error            = 1
     OTHERS                   = 2.
Unable to find the reason why I get 2 spool created for it?
Thanks
Ritesh

Hi venkatesh,
Thanks for the reply.
I tried that also but issue was due to a SKIP statement called in the program and due to which a new spool which was blank was called.
The issue is resolved.
Thanks
Solanki Ritesh

Similar Messages

  • Error when OO ALV report run in background

    Hello all,
    We recently applied stack 12 for a 7.0 system.  My custom ALV report using CL_GUI_CUSTOM_CONTAINER coding now returns an error when run in Background.  It works fine in dialog.
    The error occurred in program CL_GUI_CUSTOM_CONTAINER=======CP.  The log message was "Control Framework: Fatal error - GUI cannot be reached".
    Is there a solution for OO ALV reports run in the background?  I would not like to re-write my ALV reports using the function call.  Any advice is appreciated.  Thanks!!

    Yes, you need to code it a little differently, but you can still use CL_GUI_ALV_GRID.  Here is an example. 
    REPORT ZRICH_0006 .
    DATA: ITAB TYPE TABLE OF MARA.
    DATA: R_GRID TYPE REF TO CL_GUI_ALV_GRID.
    DATA: R_CONTROL TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    DATA: G_DOCK TYPE REF TO CL_GUI_DOCKING_CONTAINER.
    DATA: OKCODE type sy-ucomm.
    START-OF-SELECTION.
      SELECT * FROM MARA INTO TABLE ITAB  up to 100 rows.
      CALL SCREEN 100.
    *& Module STATUS_0100 OUTPUT
    * text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS '0100'.
      SET TITLEBAR '0100'.
      IF R_CONTROL IS INITIAL.
    * Check whether the program is run in batch or foreground
        IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
    * Run in foreground
          CREATE OBJECT R_CONTROL EXPORTING CONTAINER_NAME = 'CONTAINER_1'.
          CREATE OBJECT R_GRID EXPORTING I_PARENT = R_CONTROL.
        ELSE.
    * Run in background
          CREATE OBJECT R_GRID EXPORTING I_PARENT = G_DOCK.
        ENDIF.
        CALL METHOD R_GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
        I_STRUCTURE_NAME = 'MARA'
        CHANGING
        IT_OUTTAB = ITAB.
      ENDIF.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    * text
    MODULE USER_COMMAND_0100 INPUT.
      CASE OKCODE.
        WHEN 'BACK'.
          leave program.
      ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    Regards,
    Rich Heilman

  • Hi experts 1 query regarding alv report running in background

    when i run my alv report with 40 columns in background in spool when i get output disturbed 20 lines of first row is moving to second row so when i download to excel the o/p is completely disturbed and no use for me is there any way to solve this problem.please reply

    hi ,
    this will solve your problem
    http://www.****************/Tutorials/ALV/Spool/width.htm
    Increasing the width of the spool when using ALV List
    By Aafaque Husain, YASH Technologies
    Whenever an ALV report (with more number of columns) is scheduled in background, the output will be displayed in a zigzag fashion as shown below:  
    If we try to download the output from the spool or try to view the output, then we observe that the output is not in an appropriate fashion.  
    To get the right format of output in the spool we generally increase the u201Cno. of columns fieldu201D in the Format typesu201D. Have a look at the following screenshot:   
    Sometimes even when we change this field, we get the output truncated at the end, like last few columns are not displayed. There is certain limitation for this field, so that even if increase this value again, we find no change in the output display in spool. 
    This value is effective only when we check the check box u201CNumber of columns from list display formatu201D in the SPAD transaction.
    Ø       GO to SPAD Transaction code
    Ø       In the menu Settings -> Spool System as shown belowu2026
    Ø       In the others tab check the first check box in the Output Controller block, SAVE and exit.
    Now Schedule the ALV report again by providing the output device and format, and then we get the full output in the spool as shown below: 
    Regards,
    Madhavi

  • ALV report run in background creates problem

    hi All,
    i have a ALV report which works fine in foreground but when i run the report in background
    (Execute in beackground option) the job always gets cancelled.
    As i was thinking that its due to quantity and currency field i passed the below parameters inMY FIELD CAT
    w_fieldcat-CFIELDNAME  =  p_001.
       w_fieldcat-CURRENCY    = 'WAERS'.
    w_fieldcat-CFIELDNAME  =  p_001.
        w_fieldcat-QUANTITY    = 'MEINS'.
    Still the job gets cancelled always , can anybody help me with this issue?
    Please give some useful suggestions?

    Hi Bhanu
    After populating the Grid/List elements, may be you were using 'REUSE_ALV_LIST/GRID_DISPLAY' function module.
    As some Function Modules will give problems in background execution,please call the same function module using CL_GUI_ALV_GRID => REUSE_ALV_LIST_DISPLAY for some cases it is the good solution.
    Regards,
    Sreeram Kumar.Madisetty

  • ALV report - run in background and output to screen

    I wish to run a report in background and then output the report to screen as a standard ALV report with all the associated functionality. Can anyone tell me how to do this?
    Thanks.

    Hi,
       In background i dont think so its possible.
    Regards,
    Prashant

  • Spool to PDF Conversion in ECC6 from Report running in Background

    Hi Friends,
    Iam working in ECC6, I have created one Classical report with line size of 295 which is running in Background and spool is generating.
    But my requirement is I have to send this spool to email through PDF Attachment.
    Here i have to convert Spool of line size 295 to PDF format. and then using FM give mail to respective email ids.
    Here is the code i have written for your refference:
    IF sy-batch EQ 'X'.
        PERFORM get_job_details.
        PERFORM obtain_spool_id.
        PERFORM convert_spool_to_pdf.
        PERFORM process_email.
    endif.
    1.      FORM GET_JOB_DETAILS .
    Get current job details
         CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
            IMPORTING
            eventid                 = gd_eventid
            eventparm               = gd_eventparm
            external_program_active = gd_external_program_active
            jobcount                = gd_jobcount
            jobname                 = gd_jobname
            stepcount               = gd_stepcount
        EXCEPTIONS
          no_runtime_info         = 1
          OTHERS                  = 2.
    ENDFORM.                    " G
    2.  FORM OBTAIN_SPOOL_ID .
         CHECK NOT ( gd_jobname IS INITIAL ).
         CHECK NOT ( gd_jobcount IS INITIAL ).
         SELECT * FROM  tbtcp
                     INTO TABLE it_tbtcp
                     WHERE      jobname     = gd_jobname
                     AND        jobcount    = gd_jobcount
                     AND        stepcount   = gd_stepcount
                     AND        listident   <> '0000000000'
                     ORDER BY   jobname
                                jobcount
                                stepcount.
      READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
      IF sy-subrc = 0.
        MESSAGE s004(zdd) WITH gd_spool_nr.
        gd_spool_nr = wa_tbtcp-listident.
        MESSAGE s004(zdd) WITH gd_spool_nr.
      ELSE.
        MESSAGE s005(zdd).
      ENDIF.
    ENDFORM.                    " OBTAIN_SPO
    3.       CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
              EXPORTING
              src_spoolid              = gd_spool_nr
             no_dialog                = c_no
            dst_device               = c_device
         dst_device               = 'ZLOCL'
          PDF_DESTINATION          = 'X'
        IMPORTING
          pdf_bytecount            = gd_bytecount
        TABLES
          pdf                      = it_pdf_output
        EXCEPTIONS
          err_no_abap_spooljob     = 1
          err_no_spooljob          = 2
          err_no_permission        = 3
          err_conv_not_possible    = 4
          err_bad_destdevice       = 5
          user_cancelled           = 6
          err_spoolerror           = 7
          err_temseerror           = 8
          err_btcjob_open_failed   = 9
          err_btcjob_submit_failed = 10
          err_btcjob_close_failed  = 11
          OTHERS                   = 12.
      CHECK sy-subrc = 0.
    *Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att = gd_buffer.
        APPEND it_mess_att.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.                    " CONVERT_SPOOL_TO_PDF
    4.     FORM PROCESS_EMAIL .
            DESCRIBE TABLE it_mess_att LINES gd_recsize.
          *DESCRIBE TABLE it_pdf_output LINES gd_recsize.
          CHECK gd_recsize > 0.
          PERFORM send_email USING p_email1.
    ENDFORM.                    " P
    5.   FORM SEND_EMAIL  USING    P_EMAIL.
         CHECK NOT ( p_email IS INITIAL ).
         REFRESH it_mess_bod.
    Default subject matter
      gd_subject         = 'Subject'.
      gd_attachment_desc = 'Attachnament'.
      CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
      it_mess_bod        = 'Message Body text, line 1'.
      APPEND it_mess_bod.
      it_mess_bod        = 'Message Body text, line 2...'.
      APPEND it_mess_bod.
    If no sender specified - default blank
      IF p_sender EQ space.
        gd_sender_type  = space.
      ELSE.
        gd_sender_type  = 'INT'.
      ENDIF.
    Send file by email as PDF  format
      PERFORM send_file_as_email_attachment
                                   TABLES it_mess_bod
                                          it_mess_att
                                          it_pdf_output
                                    USING  p_email1
                                          'PDF Document Attached'
                                          'PDF'
                                          gd_attachment_name
                                          gd_attachment_desc
                                          p_sender
                                          gd_sender_type
                                 CHANGING gd_error
                                          gd_reciever.
    ENDFORM.                    " SEND_EMAIL
    6.         FORM SEND_FILE_AS_EMAIL_ATTACHMENT  TABLES  it_message
                                                it_attach
                                          USING p_email
                                                p_mtitle
                                                p_format
                                                p_filename
                                                p_attdescription
                                                p_sender_address
                                                p_sender_addres_type
                                       CHANGING p_error
                                                p_reciever.
    DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
      DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
              t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
              t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
              t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
              t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
              w_cnt TYPE i,
              send_mail LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
              w_sent_all(1) TYPE c,
              w_doc_data LIKE sodocchgi1.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      LOOP AT p_email1.
        t_receivers-receiver =  p_email1-low.
        t_receivers-rec_type = 'U'.
        t_receivers-com_type = 'INT'.
        t_receivers-notif_del = 'X'.
        t_receivers-notif_ndel = 'X'.
        APPEND t_receivers.
      ENDLOOP.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          document_data              = w_doc_data
          put_in_outbox              = 'X'
          sender_address             = ld_sender_address
          sender_address_type        = ld_sender_address_type
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = w_sent_all
        TABLES
          packing_list               = t_packing_list
          contents_bin               = t_attachment
          contents_txt               = it_message
          receivers                  = t_receivers
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.                    " SEND_FILE_AS_EMAIL_ATTACHMENT
    But when iam executing the report in Background mail is coming to respective email ids but when i opened that attachment which is in PDF is not opening, giving error as below:
    "Could not parsed Attachment.PDF!"
    and file size is less oringinallly file size should be 125 KB buit in mail it is coming only 3 KB.
    When i executed FM CONVERT_ABAPSPOOLJOB_2_PDF in foreground, its working fine for that Spool id.
    Any suggestions from u friends.
    regards,
    Sekhar.

    Hi when ur running tha application in background pass the below parameters .
    DATA:
    w_form_name TYPE tdsfname VALUE 'Zpramu_TEST',
    w_fmodule TYPE rs38l_fnam,
    w_cparam TYPE ssfctrlop,
    w_outoptions TYPE ssfcompop,
    W_bin_filesize TYPE i, " Binary File Size
    w_FILE_NAME type string,
    w_File_path type string,
    w_FULL_PATH type string.
    Internal tables declaration
    Internal table to hold the OTF data
    DATA:
    t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
    Internal table to hold OTF data recd from the SMARTFORM
    t_otf_from_fm TYPE ssfcrescl,
    Internal table to hold the data from the FM CONVERT_OTF
    T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
    This function module call is used to retrieve the name of the Function
    module generated when the SMARTFORM is activated
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = w_form_name
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    fm_name = w_fmodule
    EXCEPTIONS
    no_form = 1
    no_function_module = 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.
    Calling the SMARTFORM using the function module retrieved above
    GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF
    format of the output
    w_cparam-no_dialog = 'X'.
    w_cparam-preview = space. " Suppressing the dialog box
                                                        " for print preview
    w_cparam-getotf = 'X'.
    Printer name to be used is provided in the export parameter
    OUTPUT_OPTIONS
    w_outoptions-tddest = 'LP01'.
    CALL FUNCTION w_fmodule
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    control_parameters = w_cparam
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    output_options = w_outoptions
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    job_output_info = t_otf_from_fm
    JOB_OUTPUT_OPTIONS =
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 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.
    t_otf[] = t_otf_from_fm-otfdata[].
    Function Module CONVERT_OTF is used to convert the OTF format to PDF
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT = 'PDF'
    MAX_LINEWIDTH = 132
    ARCHIVE_INDEX = ' '
    COPYNUMBER = 0
    ASCII_BIDI_VIS2LOG = ' '
    PDF_DELETE_OTFTAB = ' '
    IMPORTING
    BIN_FILESIZE = W_bin_filesize
    BIN_FILE =
    TABLES
    otf = T_OTF
    lines = T_pdf_tab
    EXCEPTIONS
    ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    ERR_BAD_OTF = 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.
    To display File SAVE dialog window
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
    WINDOW_TITLE =
    DEFAULT_EXTENSION =
    DEFAULT_FILE_NAME =
    FILE_FILTER =
    INITIAL_DIRECTORY =
    WITH_ENCODING =
    PROMPT_ON_OVERWRITE = 'X'
    CHANGING
    filename = w_FILE_NAME
    path = w_FILE_PATH
    fullpath = w_FULL_PATH
    USER_ACTION =
    FILE_ENCODING =
    EXCEPTIONS
    CNTL_ERROR = 1
    ERROR_NO_GUI = 2
    NOT_SUPPORTED_BY_GUI = 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.
    Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
    presentation server
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE = W_bin_filesize
    filename = w_FULL_PATH
    FILETYPE = 'BIN'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    CONFIRM_OVERWRITE = ' '
    NO_AUTH_CHECK = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = ' '
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    IMPORTING
    FILELENGTH =
    tables
    data_tab = T_pdf_tab
    FIELDNAMES =
    EXCEPTIONS
    FILE_WRITE_ERROR = 1
    NO_BATCH = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE = 4
    NO_AUTHORITY = 5
    UNKNOWN_ERROR = 6
    HEADER_NOT_ALLOWED = 7
    SEPARATOR_NOT_ALLOWED = 8
    FILESIZE_NOT_ALLOWED = 9
    HEADER_TOO_LONG = 10
    DP_ERROR_CREATE = 11
    DP_ERROR_SEND = 12
    DP_ERROR_WRITE = 13
    UNKNOWN_DP_ERROR = 14
    ACCESS_DENIED = 15
    DP_OUT_OF_MEMORY = 16
    DISK_FULL = 17
    DP_TIMEOUT = 18
    FILE_NOT_FOUND = 19
    DATAPROVIDER_EXCEPTION = 20
    CONTROL_FLUSH_ERROR = 21
    OTHERS = 22
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Data is missing in Even Page when report running in background (spool)

    Hi
    I have this weird problem in my report. The report would run in background convert the data in to PDF from spool and then email it to people.
    Now when the PDF has more then 1 page the error occurs.
    It drops the last row from the even page. The total at the end and every thing shows correctly. If there r more than 2 pages then on page 3 the last row is not dropped and its all fine but again on page 4 it drops one record and on page 5 again its working fine.
    One thing is it also puts an extra line(horizontal line which is not in the code) on those pages where its unable to put the record and its always the last one on the even page. I also looked up the spool. Its doing it in the spool too. So i think its not the PDF converter its when the spool is getting created for some reason its droping the rows for the even pages...
    Did any one else encountered some thing like this? please help.
    Thanks
    Message was edited by:
            Anwarul Kabir

    is there any problem with Background spools with SAP? We are running R3 here. And looks like its the spool background job that's creating the error. When i execute the report it shows all the record in print preview or if i print it.
    Please Help!

  • Error while report running in background

    Hello to all,
    I am running a report in backgroud using SM37.This report already programmed to call a report in background.It takes stocks for given period,I am taking the values using  "import memory-id" statement.It gives an error log in SM37 as:
    Choose at least one scope of list
    Message no. M7829
    Can we call a submit stmt in a report that is to run in  background?? or pls provide any alternative for this problem??
    Thnax & Regards
    Vipin B.

    Hi,
    If you faced problem in submit statement,then try replacing the same by running the bdc for the particular program that you are using in submit statement.
    Make sure that you had given values for all the mandatory parameters and select option in the selection screen of the report program that you are submitting using submit statement.
    Kindly reward points by clicking the star on the left of reply,if it helps.

  • Is it possible to download to excel when a report running in background

    Dear All,
    I tried to execute one ALV report in foreground and background. In foreground the report is giving excel download but in background no excel download is coming. Is there any specific reason for that?
    Thanks and regards,
    Atanu

    Atanu dey,
    If you wnat to download excel in back ground
    You have to download in application server only.
    EX:
    DATA :  v_filepath(80)     VALUE '/data/sapdata/inc/error_log/pme_br/',
      c_coma     VALUE ',' .
    OPEN DATASET v_filepath FOR OUTPUT IN TEXT MODE.
        IF sy-subrc EQ 0.
         LOOP AT i_errors_bat.
         CONCATENATE i_errors_bat-plant c_coma
                                 i_errors_bat-zzvendor c_coma
                           INTO v_string.
            TRANSFER v_string TO v_filepath.
          ENDLOOP.
       CLOSE DATASET v_filepath.
    Note : you can download in presentation server also.
    but it requires lot of authorizations and have to use
    FTP commands.
    Reason is Apllication server in back ground has to
    recognize the from which system request came.
    Better go for OPEN DATA sets.
    Don't forget to reward if useful.....

  • Printout of report running in background.

    Hi
    i have a report which i am running in background , If i want to take printout of the output
    list generated, which FM am i suppose to use ?
    thanks in advance.

    Sample code would be
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          copies                 = 1
          department             = c_dept
          destination            = c_dest
          expiration             = 2
          layout                 = c_layout
          line_count             = 65
          line_size              = 255
          list_name              = text-031
          list_text              = text-032
          mode                   = ' '
          new_list_id            = 'X'
          no_dialog              = 'X'
          receiver               = c_rec
          release                = 'X'
          sap_cover_page         = 'X'
          user                   = sy-uname
        IMPORTING
          out_parameters         = l_params
        EXCEPTIONS
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          OTHERS                 = 4.
      IF sy-subrc = 0 AND NOT l_params IS INITIAL.
        NEW-PAGE PRINT ON PARAMETERS l_params  NO DIALOG NEW-SECTION.
        g_spool = 'X'.
      ENDIF.

  • Less coloumns displayed when report run in background

    Hi,
    There is a problem, when i run a report in background last few columns are not displayed. But when i run it in foreground all the columns are displayed properly.. Bt since the report hs to be run background, I need to fix this issue..
    Cn anyone explain why this is happenin and wht i cn do to rectify it?
    Thanks
    Keshi

    Hi,
    Use REUSE_ALV_GRID_DISPLAY and you will be able to run the report in foreground or background.
    If you must use OO ALV controls, you won't be able to run the program in background. In this scenario, I would check SY-BATCH and if it is set, I run REUSE* FM and if not I do CALL SCREEN..
    If you are using the ABAP Grid Control (OO object), you can still create the ALV list as a spool listing for the background job.
    The easiest way to do this is to put all the create object statements and method calls for the custom container and ALV grid object inside a subroutine (for example, present_grid).
    All that is required is a simple check of the sy-batch variable to determine if the program is being executed in the foreground or background.
    e.g. if sy-batch is initial.
    call screen 0100.
    else.
    perform present_grid.
    endif.
    In a PBO module of screen 0100, the subroutine present_grid is also performed.
    The set_table_for_first_display method will be invoked in the routine present_grid, however, due to the job being executed in the background, the ALV list output will be written as spool output for the background job.
    Regards,
    Srini

  • Default Layout for a report running in background

    Dear Friends,
    I have created a layout for report ME2L and set as default layout  (for every user)....
    Foreground execution picked the DEFAULT layout but when am trying to execute the same report in background, default layout is not picked but the STANDARD layout is shown in the spool
    Could you please suggest me how can i use same report layout for foreground as well as background
    Thanks in Advance
    Ana

    Atanu dey,
    If you wnat to download excel in back ground
    You have to download in application server only.
    EX:
    DATA :  v_filepath(80)     VALUE '/data/sapdata/inc/error_log/pme_br/',
      c_coma     VALUE ',' .
    OPEN DATASET v_filepath FOR OUTPUT IN TEXT MODE.
        IF sy-subrc EQ 0.
         LOOP AT i_errors_bat.
         CONCATENATE i_errors_bat-plant c_coma
                                 i_errors_bat-zzvendor c_coma
                           INTO v_string.
            TRANSFER v_string TO v_filepath.
          ENDLOOP.
       CLOSE DATASET v_filepath.
    Note : you can download in presentation server also.
    but it requires lot of authorizations and have to use
    FTP commands.
    Reason is Apllication server in back ground has to
    recognize the from which system request came.
    Better go for OPEN DATA sets.
    Don't forget to reward if useful.....

  • After reports running in background job need to get automatically open in excel sheet

    Dear All,
    I have a requirement which is new to me ,
    Once the user runs the report in background  system is displaying the output in HTML format .... But the Users needs to open in Excel sheet .
    kindly  do the needful
    Regards
    Srikanth BG

    Hi Srikanth,
    Excel processing in background is currently not possible using standard ways. There exist a really good external library that allows you to handle Excel files, and even create them in background. So you could create a final, ready to use Excel file from your background run that can then be opened.
    You might have a look at the library here: http://wiki.scn.sap.com/wiki/display/ABAP/abap2xlsx
    Maybe it helps and suits your needs.
    Cheers,
    Marc

  • ALV reports emailed in background job

    Hi,
    we have a background job that emails a report to some users. So far so good but the emailed result is a (not very nicely formated) txt file. Is there any way to specify the format of the output so that the report is emailed as a pdf or an html or and excel spreadsheet? Any would do.
    Thanks in advance
    Tania

    hi tania,
    check this code mailing with XLS attachment.
    report zxxx.
    tables: ekko.
    parameters: p_email   type somlreci1-receiver
                                      default '[email protected]'.
    types: begin of t_ekpo,
      ebeln type ekpo-ebeln,
      ebelp type ekpo-ebelp,
      aedat type ekpo-aedat,
      matnr type ekpo-matnr,
    end of t_ekpo.
    data: it_ekpo type standard table of t_ekpo initial size 0,
          wa_ekpo type t_ekpo.
    types: begin of t_charekpo,
      ebeln(10) type c,
      ebelp(5)  type c,
      aedat(8)  type c,
      matnr(18) type c,
    end of t_charekpo.
    data: wa_charekpo type t_charekpo.
    data:   it_message type standard table of solisti1 initial size 0
                    with header line.
    data:   it_attach type standard table of solisti1 initial size 0
                    with header line.
    data:   t_packing_list like sopcklsti1 occurs 0 with header line,
            t_contents like solisti1 occurs 0 with header line,
            t_receivers like somlreci1 occurs 0 with header line,
            t_attachment like solisti1 occurs 0 with header line,
            t_object_header like solisti1 occurs 0 with header line,
            w_cnt type i,
            w_sent_all(1) type c,
            w_doc_data like sodocchgi1,
            gd_error    type sy-subrc,
            gd_reciever type sy-subrc.
    *START_OF_SELECTION
    start-of-selection.
      Retrieve sample data from table ekpo
      perform data_retrieval.
      Populate table with detaisl to be entered into .xls file
      perform build_xls_data_table.
    *END-OF-SELECTION
    end-of-selection.
    Populate message body text
      perform populate_email_message_body.
    Send file by email as .xls speadsheet
      perform send_file_as_email_attachment
                                   tables it_message
                                          it_attach
                                    using p_email
                                          'Example .xls documnet attachment'
                                          'XLS'
                                          'filename'
                                 changing gd_error
                                          gd_reciever.
      Instructs mail send program for SAPCONNECT to send email(rsconn01)
      perform initiate_mail_execute_program.
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
      select ebeln ebelp aedat matnr
       up to 10 rows
        from ekpo
        into table it_ekpo.
    endform.                    " DATA_RETRIEVAL
    *&      Form  BUILD_XLS_DATA_TABLE
          Build data table for .xls document
    form build_xls_data_table.
    CONSTANTS: con_cret TYPE x VALUE '0D',  "OK for non Unicode
                con_tab TYPE x VALUE '09'.   "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    constants:
        con_tab  type c value cl_abap_char_utilities=>horizontal_tab,
        con_cret type c value cl_abap_char_utilities=>cr_lf.
      concatenate 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
             into it_attach separated by con_tab.
      concatenate con_cret it_attach  into it_attach.
      append  it_attach.
      loop at it_ekpo into wa_charekpo.
        concatenate wa_charekpo-ebeln wa_charekpo-ebelp
                    wa_charekpo-aedat wa_charekpo-matnr
               into it_attach separated by con_tab.
        concatenate con_cret it_attach  into it_attach.
        append  it_attach.
      endloop.
    endform.                    " BUILD_XLS_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          Send email
    form send_file_as_email_attachment tables pit_message
                                              pit_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      data: ld_error    type sy-subrc,
            ld_reciever type sy-subrc,
            ld_mtitle like sodocchgi1-obj_descr,
            ld_email like  somlreci1-receiver,
            ld_format type  so_obj_tp ,
            ld_attdescription type  so_obj_nam ,
            ld_attfilename type  so_obj_des ,
            ld_sender_address like  soextreci1-receiver,
            ld_sender_address_type like  soextreci1-adr_typ,
            ld_receiver like  sy-subrc.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      clear w_doc_data.
      read table it_attach index w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + strlen( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      clear t_attachment.
      refresh t_attachment.
      t_attachment[] = pit_attach[].
    Describe the body of the message
      clear t_packing_list.
      refresh t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      describe table it_message lines t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      append t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      describe table t_attachment lines t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      append t_packing_list.
    Add the recipients email address
      clear t_receivers.
      refresh t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      append t_receivers.
      call function 'SO_DOCUMENT_SEND_API1'
           exporting
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           importing
                sent_to_all                = w_sent_all
           tables
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_receivers
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                others                     = 8.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      loop at t_receivers.
        ld_receiver = t_receivers-retrn_code.
      endloop.
    endform.
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          Instructs mail send program for SAPCONNECT to send email.
    form initiate_mail_execute_program.
      wait up to 2 seconds.
      submit rsconn01 with mode = 'INT'
                    with output = 'X'
                    and return.
    endform.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
           Populate message body text
    form populate_email_message_body.
      refresh it_message.
      it_message = 'Please find attached a list test ekpo records'.
      append it_message.
    endform.                    " POPULATE_EMAIL_MESSAGE_BODY

  • Report run in background, attachment needs to be sent to user via email

    Hi all,
    we have a PDF solution which allows the system to send a PDF document as attachment via email to the recipient, all one needs to do is type in recipient email to a predefined PDF printer.
    What i need is a similar solution but instead of PDF it has to be an Excel file attached to email.
    The enduser does not have authorization to use SM36.
    Searching the Web (and with help from our Basis team) i have found several ideas but not sure as it would mean coding programs and so on.
    Is there an easier way?
    regards
    RM

    Hi all,
    we have a PDF solution which allows the system to send a PDF document as attachment via email to the recipient, all one needs to do is type in recipient email to a predefined PDF printer.
    What i need is a similar solution but instead of PDF it has to be an Excel file attached to email.
    The enduser does not have authorization to use SM36.
    Searching the Web (and with help from our Basis team) i have found several ideas but not sure as it would mean coding programs and so on.
    Is there an easier way?
    regards
    RM

Maybe you are looking for

  • ''Because a USB device was drawing too much power"

    Can somebody please help me? I have plugged my external hard drive ( silicon power Stream S10 USB 3.0) to my iMac ( OSX 10.8.5 ) and for some reason this messaged apperead Now, the external hard drive was working fine all this time, it was working fi

  • Help with iPod Touch in recovery mode

    I am trying to help my sister with her daughter's iPod touch. The end goal is to update to iOS6. It is a fourth gen iPod Touch. I plugged it into iTunes (iPod was still iOS V4.something or other) and it said there was an update availalbe. I clicked D

  • Narrowing Page Width - Bleed Area

    Hello, I would like to add a bleed area around the website pages that I am developing currently, in order to accommodate people that want to view the site with smaller screens. I am aware of the fact that the website page height and width can obvious

  • Selecting attributes in a cube

    I have two cubes which both have the info object 0SHIP_TO. When building a query using one of the two cubes I can select several attributes that belong to 0SHIP_TO.  They appear under the same dimension table as 0SHIP_TO.  NOTE: The attributes do not

  • GUI Server Process Error when installing NetWeaver 2004s Sneak Preview ABAP

    Hi, I've downloaded the SAP NetWeaver 2004s Sneak Preview ABAP and tried to install it. As adviced in the Installing guide I installed the SDK first. When starting SAPinst.bat I get pretty soon this error - what can I do to solve this problem: Thanks