Downloading in background schduling

i have written a program which fetches the spoll request and then converting into pdf but i need to download the pdf file to local pc, how to do that will gui_download will work. here is my code.
REPORT  z_rfi_inv_movement_spool                .
PARAMETERS: p_repid like sy-repid,
            p_delspl  AS CHECKBOX.
DATA: gd_recsize TYPE i,
      v_pri_params LIKE pri_params,
       v_filename LIKE rlgrap-filename.
CONCATENATE: 'c:\'
               p_repid
               '.pdf'
               INTO v_filename.
Spool IDs
TYPES: BEGIN OF t_tbtcp.
        INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
      wa_tbtcp TYPE t_tbtcp.
Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
      gd_eventparm LIKE tbtcm-eventparm,
      gd_external_program_active LIKE tbtcm-xpgactive,
      gd_jobcount LIKE tbtcm-jobcount,
      gd_jobname LIKE tbtcm-jobname,
      gd_stepcount LIKE tbtcm-stepcount,
      gd_error    TYPE sy-subrc,
      gd_reciever TYPE sy-subrc.
DATA:  w_recsize TYPE i.
DATA: gd_subject   LIKE sodocchgi1-obj_descr,
      it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      gd_sender_type     LIKE soextreci1-adr_typ,
      gd_attachment_desc TYPE so_obj_nam,
      gd_attachment_name TYPE so_obj_des.
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
      gd_destination LIKE rlgrap-filename,
      gd_bytecount LIKE tst01-dsize,
      gd_buffer TYPE string.
Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
        INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE  sy-sysid VALUE 'DEV',
           c_no(1)     TYPE c   VALUE ' ',
           c_device(4) TYPE c   VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
Write statement to represent report output. Spool request is created
if write statement is executed in background. This could also be an
ALV grid which would be converted to PDF without any extra effort
  WRITE 'Hello World'.
  NEW-PAGE.
  COMMIT WORK.
  NEW-PAGE PRINT OFF.
  IF sy-batch EQ 'X'.
    PERFORM get_job_details.
    PERFORM obtain_spool_id.
Get spool id from program called above
IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
    PERFORM convert_spool_to_pdf.
    IF p_delspl EQ 'X'.
      PERFORM delete_spool.
    ENDIF.
    IF sy-sysid = c_dev.
      WAIT UP TO 5 SECONDS.
      SUBMIT rsconn01 WITH mode   = 'INT'
                      WITH output = 'X'
                      AND RETURN.
*Fetching report name from selection screen and run with out spool
*parameters and returns.
      SUBMIT (p_repid) TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                       SPOOL PARAMETERS v_pri_params
                       VIA SELECTION-SCREEN
                      AND RETURN.
    ENDIF.
  ELSE.
    SKIP.
    WRITE:/ 'Program must be executed in background in-order for spool',
            'request to be created.'.
  ENDIF.
      FORM obtain_spool_id                                          *
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_spool_id
      FORM get_job_details                                          *
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.                    "get_job_details
      FORM convert_spool_to_pdf                                     *
FORM convert_spool_to_pdf.
  CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
    EXPORTING
      src_spoolid              = gd_spool_nr
      no_dialog                = c_no
      dst_device               = c_device
    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
      FORM delete_spool                                             *
FORM delete_spool.
  DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
  ld_spool_nr = gd_spool_nr.
  CHECK p_delspl <> c_no.
  CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
    EXPORTING
      spoolid = ld_spool_nr.
ENDFORM.                    "delete_spool

Hello,
You can try this code but it might only support a download to a PC:
FUNCTION Z_DS_CREATE_LOCAL_PDF_FILE .
*"*"Local interface:
*"  EXPORTING
*"     REFERENCE(AFILENAME) LIKE  RLGRAP-FILENAME
*"  TABLES
*"      OTF_LINES STRUCTURE  ITCOO
  DATA: PDF_LINES
  LIKE TLINE OCCURS 1000 WITH HEADER LINE,
   ARCH LIKE TOA_DARA, NO_LINES TYPE I.
  CALL FUNCTION 'CONVERT_OTF'
       EXPORTING
            FORMAT       = 'PDF'
       IMPORTING
            BIN_FILESIZE = NO_LINES
       TABLES
            OTF          = OTF_LINES
            LINES        = PDF_LINES.
  CALL FUNCTION 'DOWNLOAD'
       EXPORTING
            BIN_FILESIZE = NO_LINES
            FILENAME     = 'c:test.pdf'
            FILETYPE     = 'BIN'
       IMPORTING
            ACT_FILENAME = AFILENAME
       TABLES
            DATA_TAB     = PDF_LINES.
Regards,
Vasanth

Similar Messages

  • Download Other Backgrounds

    Need to know if you can download other backgrounds for IMovie 09? There just isn't enough!

    Sure. Make your backgrounds in Photoshop, Keynote, Powerpoint, or your favorite tool. Then save it as a jpeg file.
    Put them in iPhoto. Put them in an album called Backgrounds. And drag them in from the photo browser.

  • Apps downloading in background that have already updated? Pause them in Launchpad but keep on at it!

    apps downloading in background that have already updated? Pause them in Launchpad but keep on at it! At this rate my ISP will cap me.

    Divine88 wrote:
    I have Recently been trying to update several apps of mine, and when i click update all, or one at a time, it takes me straight to my billing information.
    That's because the billing information is out of date or there was a problem with a previous purchase.
    Then after that it says i need to pay to update my apps that have already been purchased or apps that i have gotten for free
    No. That's not what it says. What is the EXACT message you get?
    However, when i took my iPhone 5 with iOS 7.1.1  to the apple store, the "geniuses" have told me i have outstanding payments on an app so in order to update them, i need to go and purchase more itunes cards.. So i have went out and bought about Three 20$ itunes cards hoping that by using just 1 card - it would fix the problem im having. but it isnt.
    Contact iTunes store support and find out what the problem is.
    ALSO if i purchase an app without having the same amount of what it costs it will not let me buy/download it
    Um... yeah... That's the way it works. If you want to buy something, you have to have enough to actually pay for it.
    Contact iTunes store support.
    You're not talking to Apple.  This is a user forum.

  • Where can i download more backgrounds?

    Hey guys,
    I like making videos for the purpose of sharing music I've written. However, there are only so many background choices to use like "underwater", "industrial", or "blobs". Is there a way to download more backgrounds? I would use still frame pictures, but that can get boring. Thanks!

    castlljs wrote:
    .. Is there a way to download more backgrounds?
    actually, iM09 doesn't allow installation of any plug-ins, add-ons, theme-packages etc.
    and the backgrounds are not just 'videos', you could easily replace, but complex 'Quartz animations'.
    Plan B)
    record your own 'background' .. point your camera to some pond, a tree in the wind, a campfire, smoke of a cigar, while driving thru Monument Valley .. I assume, I would have thousands of ideas to 'illustrate' music/lyrics.
    to make those videos more 'background-ish', de-focus on record (if cam supports manual focus), de-saturate, over-saturate (iMovie's video-settings), 'all knobs to max/min' .. => make the video more 'abstract' than real ..

  • How to Make Folios Download in Background for Newsstand

    I have a Professional Adobe DPS account and my folios do not seem to ever download in background in the newsstand.
    How do you enable this functionality?
    I have Auto-Content download enabled for the app in General --> Newsstand. But new issues still do not auto-download to a wired (fully-charged) device with a persistent wifi connection and available data storage.

    I have a Professional Adobe DPS account and my folios do not seem to ever download in background in the newsstand.
    How do you enable this functionality?
    I have Auto-Content download enabled for the app in General --> Newsstand. But new issues still do not auto-download to a wired (fully-charged) device with a persistent wifi connection and available data storage.

  • How to enable download in background?

    Everytime I start downloading something and go to HOME by pressing home button or open another app, the ongoing download fails. This problem does not occurs if I keep firefox opened.
    Duplicated: [/questions/1027956]

    HI aniksau,
    Is it possible to leave the browser running in the background?

  • Smartforms  to file  .PDF and download  in Background

    Hi
    Actually  i´m converting  a smartforms in PDF file and doing a download in line , but i need to do the same in background.
    How can i do it??
    Regards
    Gregory

    *& Report  ZSMARTFORM_SPOOL_G
    REPORT  zsmartform_spool_g.
    *************Types Declaration ****************************
    TYPES : BEGIN OF gty_tab,                          " Spool Requests
            rqident   TYPE tsp01-rqident,              " Spool request number
            rqdoctype TYPE tsp01-rqdoctype,            " Spool: document type
            rqo1name  TYPE tsp01-rqo1name,             " TemSe object name
           END OF gty_tab.
    *********Work Area ****************************************
    DATA: form_name TYPE rs38l_fnam,      " Used to get the function module of Smartform
          wa_outopt TYPE ssfcompop,       " SAP Smart Forms: Smart Composer (transfer) options
          gs_tab    TYPE gty_tab.         " Spool Requests
    *******Internal Table Declarations ************************
    DATA: gt_tab TYPE STANDARD TABLE OF gty_tab,       " Spool Requests
          gt_pdf TYPE STANDARD TABLE OF tline,         " SAPscript: Text Lines
          gt_spoolid TYPE tsfspoolid,                  " Table with Spool IDs
          gt_otfdata TYPE ssfcrescl.                 " Smart Forms: Return value at end of form prnt
    *********Variable Declarations ****************************
    DATA: gv_bytecount   TYPE i,               "#EC NEEDED " PDF Byte Count
          gv_file_name   TYPE string,                    " File name
          gv_file_path   TYPE string,                    " File Path
          gv_full_path   TYPE string,                    " Path
          gv_binfilesize TYPE i,                         " Bin File size
          gv_rqident   TYPE tsp01-rqident,               " Spool request number
          gv_name TYPE tst01-dname,                      " TemSe object name
          gv_objtype TYPE rststype-type,                 " TemSe: Object type name
          gv_type TYPE rststype-type.                    " TemSe: Object type name
    START-OF-SELECTION.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = 'ZPDF_G'
        IMPORTING
          fm_name            = form_name
        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.
    *Get Spool IDs
      wa_outopt-tdnewid = 'X'.
      wa_outopt-tddest = 'LP01'.
      CALL FUNCTION form_name
        EXPORTING
          output_options   = wa_outopt
          user_settings    = 'X'
        IMPORTING
          job_output_info  = gt_otfdata
        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.
    *Assign the spool id
      gt_spoolid = gt_otfdata-spoolids.
    Generate spool and pdf for the output of the form
      PERFORM sub_generate_spool_pdf.
    END-OF-SELECTION.
    *&      Form  sub_generate_spool_pdf
          Generate Spool and PDF output
    FORM sub_generate_spool_pdf .
      DATA: ls_spoolid LIKE LINE OF gt_spoolid.
    *----Get the Spool Number
      CLEAR ls_spoolid.
      READ TABLE gt_spoolid INTO ls_spoolid INDEX 1.
      IF sy-subrc = 0.
        gv_rqident = ls_spoolid.
      ENDIF.
      CLEAR gt_tab.
      SELECT  rqident rqdoctype rqo1name INTO TABLE gt_tab
               FROM tsp01 WHERE rqident = gv_rqident.
      IF sy-subrc = 0.
        CLEAR gs_tab.
    Get the TemSe: Object name into variable gv_name
        READ TABLE gt_tab INTO gs_tab INDEX 1.
        IF sy-subrc = 0.
          gv_name = gs_tab-rqo1name.
        ENDIF.
      ENDIF.
      CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
        EXPORTING
          authority     = 'SP01'
          client        = sy-mandt
          name          = gv_name
          part          = 1
        IMPORTING
          type          = gv_type
          objtype       = gv_objtype
        EXCEPTIONS
          fb_error      = 1
          fb_rsts_other = 2
          no_object     = 3
          no_permission = 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.
    Check if temse object name type is 'OTF' or 'LIST'
      IF gv_objtype(3) = 'OTF'.
        PERFORM get_otf_spool_in_pdf.
      ELSE.
        PERFORM get_abap_spool_in_pdf.
      ENDIF.
    Generate F4 functionality from spool to pdf
      PERFORM write_pdf_spool_to_pc.
    ENDFORM.                    " sub_generate_spool_pdf
    *&      Form  get_abap_spool_in_pdf
          Generate the Spool number
    FORM get_abap_spool_in_pdf .
      REFRESH gt_pdf.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid              = gv_rqident
        IMPORTING
          pdf_bytecount            = gv_bytecount
        TABLES
          pdf                      = gt_pdf
        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.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " get_abap_spool_in_pdf
    *&      Form  get_otf_spool_in_pdf
          Generate OTF data from the Spool Number
    FORM get_otf_spool_in_pdf .
      REFRESH gt_pdf.
      CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid              = gv_rqident
        IMPORTING
          pdf_bytecount            = gv_bytecount
        TABLES
          pdf                      = gt_pdf
        EXCEPTIONS
          err_no_otf_spooljob      = 1
          err_no_spooljob          = 2
          err_no_permission        = 3
          err_conv_not_possible    = 4
          err_bad_dstdevice        = 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.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " get_otf_spool_in_pdf
    *&      Form  write_pdf_spool_to_pc
          Generate PDF format
    FORM write_pdf_spool_to_pc .
      CALL METHOD cl_gui_frontend_services=>file_save_dialog
        CHANGING
          filename             = gv_file_name
          path                 = gv_file_path
          fullpath             = gv_full_path
        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.
    ----DOWNLOADING THE PDF DATA***
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          bin_filesize            = gv_binfilesize
          filename                = gv_full_path
          filetype                = 'BIN'
        TABLES
          data_tab                = gt_pdf
        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.
    ENDFORM.                    " write_pdf_spool_to_pc
    Rewards if useful..............
    Minal

  • DMS: Download file background

    Hi,
    I have a problem. i have a c# application in the user PC that is going to call a sap webservice that downloads a file from DMS to the user PC. this is possible or this counts as background and we only can download to the application server? if that so, is there anyway to after the file is in the application server copy it automaticly to the user PC?
    Best regards,
    Ricardo
    Edited by: Ricardo Araújo on Jun 29, 2011 4:50 PM

    Hello Ricardo Araújo ,
                                          Using webservice also there may be some logic that we can use to write a file to the user's desktop PC.
    But we need to investigate more in the technical prespective first.
    Other easiest option is inside the webservice logic we can create a file in the application server and FTP / Or write it to a share folder , that share folder is accessible to the user from the desktop PC.
    But to write it to a shared folder we need to do the File Mounting in the SAP application server / Shared folder host machine.
    This is purely a BASIS job.
    Hope this answers your question.
    Thanks,
    Greetson

  • File download in Background mode

    Hi All,
    A file need to be downloaded to the folder
    dc20\nt71data\jsox\" while execution in background mode.
    It is also mentioned that the file need not be sent to the application server.
    I am sure in background mode file couldn't be downloaded to the presentation server.
    Can you please predict where would be this folder and how to proceed?
    Thanks & Regards,
    Lakshmanan

    hi,
    Please check in AL11 transaction.Where you will find the list of folders in Application server.
    Regards,
    Shan

  • Foreground(Download file)- Background (BAPI)- Foreground(results) howto

    I have a program that currently:
    1) Downloads an industry specific file
    2) Converts the file into BAPI_SALESORDER_CHANGE call
    3) Displays the result in an ALV Grid.
    The problem is that the BAPI_SALESORDER_CHANGE can exceed the dialog workprocess timeout value for any decent sized order.  
    We want to:
    1) Download the file in the dialog wp.
    2) Process the bapi call in the background
    3) Awake the dialog process and display the results
    1&2 -- np
    3 - Problem ->   Using CL_GUI_TIMER.   Appears to work for a certain number of refreshes but the event randomly stops invoking at some point in the future.  
    This is some test code I was playing with:   It stops on my system somewhere between 40 and 150 iterations.
    *& Report  YNRK8_TIMER_TEST
    REPORT  ynrk8_timer_test.
    parameters: pa_refrs type i default 1.
    DATA: rf_gui_timer TYPE REF TO CL_GUI_TIMER.
    *       CLASS lcl_event_handler DEFINITION
    CLASS lcl_event_handler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS: on_finished FOR EVENT finished OF cl_gui_timer IMPORTING sender.
    ENDCLASS. "lcl_event_handler DEFINITION
    *       CLASS lcl_event_handler IMPLEMENTATION
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD on_finished.
        STATICS: ltp_refreshed TYPE i.
        DATA:   l_remain TYPE i.
        ADD 1 TO ltp_refreshed.
        l_remain = ltp_refreshed MOD 5.
        IF l_remain = 0.
          WRITE: 'Refresh number:', ltp_refreshed.
        ENDIF.
        sender->run( ).
      ENDMETHOD.
    ENDCLASS.
    start-of-selection.
    create object rf_gui_timer.
    set handler lcl_event_handler=>on_finished for rf_gui_timer.
    rf_gui_timer->interval = pa_refrs. rf_gui_timer->run( ).
    write 'Wait for a while:'.
    So I'm either looking for a solution that allows CL_GUI_TIMER to work indefinately OR a better way.   My basis team does not want to dump the dialog work process timeout value at all.

    Are you using gui_download in foreground and open dataset in background? U'll get different file size because, by default, gui_download adds CRLF at the end of each line, and open dataset adds only LF. so the foreground file size should be little bigger than the other.
    Regards
    Sridhar

  • CRM IC Inbox - Excel Download in background mode

    Hi Gurus
    I have requirement,
    In the result list of the Inbox , we have an icon - Excel which downloads the results to excel sheet. Now we will have execute this in background mode and send a mail once the job is completed.
    Could me please let me know how to proceed.
    Thanks
    Rakesh

    You be able to use the function "WS_DONLOAD" ?
    parameters: p_fnam like  rlgrap-filename memory id fnam obligatory.
    data: begin of t_registro occurs 0,
            registro(1000),
          end of t_registro.
          describe table t_registro lines sy-tfill.
          if sy-tfill gt 0.
            l_tam = strlen( p_fnam ).
            call function 'WS_DOWNLOAD'
                 exporting
                      filename                = p_fnam
                 tables
                      data_tab                = t_registro
                 exceptions
                      file_open_error
                      file_write_error
                      invalid_filesize
                      invalid_type
                      no_batch
                      unknown_error
                      invalid_table_width
                      gui_refuse_filetransfer
                      customer_error.
            if sy-subrc <> 0.
              open dataset p_fnam for output in text mode.
              if sy-subrc = 0.
                loop at t_registro.
                  transfer t_registro to p_fnam.
                endloop.
                close dataset p_fnam.
                write:/ 'Se genero el archivo:', p_fnam(l_tam).
              else.
                write:/ 'No se pudo generar el archivo:', p_fnam(l_tam).
              endif.
              close dataset p_fnam.
            else.
              write:/ 'Se genero el archivo:', p_fnam(l_tam).
            endif.
       endif.
    I hope this works for you.
    See ya.
    Ar@

  • ALV out put to be downloaded in Background to apps server

    Hello All,
    I want to download ALV output to APPL Server in TAB delimited format.
    I am able to get the internal table values usinf open record set and transfering.
    But the real issue is they are having diffrent layouts and according to layout i need to down the file.
    Is it possible ? if please suggest.
    Rgds,
    O

    Hi,
    I have an old code that I have wrote to transform ALV in HTML in background to send the result by email. Maybe that could help you (don't be rude, it's one of my first ALV program ).
    The comments are in french, but, you could understand.
    I hope that could help you
    Rgd
    Frédéric
    * Complete.
      call function 'LVC_FIELDCATALOG_MERGE'
           exporting
                i_structure_name   = 'ZGRE000_S2'
                i_bypassing_buffer = ' '
                i_buffer_active    = ' '
           changing
                ct_fieldcat      = itab_fieldcatalog.
      call function 'LVC_FIELDCAT_COMPLETE'
        EXPORTING
    *     I_COMPLETE             =
          IS_LAYOUT              = v_es_layout
          I_REFRESH_BUFFER       = ''
          I_BUFFER_ACTIVE        = ''
    *   IMPORTING
    *     E_EDIT                 =
        changing
          ct_fieldcat            = itab_fieldcatalog.
      call function 'LVC_SORT_COMPLETE'
        exporting
          it_fieldcat       = itab_fieldcatalog
        changing
          ct_sort           = itab_mt_sort.
      call function 'ALV_DATA_EXPORT'
        exporting
          i_report                = ''
          IT_FIELDCAT             = itab_fieldcatalog
        tables
          it_data                 = itab_zgre000_s2.
    * Recherche de la variante d'affichage.
      move : sy-repid to struct_variant-report ,
             sy-uname to struct_variant-username ,
             '2'      to struct_variant-handle.
      if p_vgrid ne space.
        move p_vgrid to struct_variant-variant.
      endif.
    * Ne pas demander d'explication, merci :)
      get reference of itab_zgre000_s2 into mt_outtab.
    * Créé l'objet variant.
      create object m_cl_variant
             exporting
               it_outtab             = mt_outtab
               it_fieldcatalog       = itab_fieldcatalog
               it_sort               = itab_mt_sort
               it_filter             = itab_mt_filter
               is_variant            = struct_variant
               is_layout             = v_es_layout
               i_variant_save        = v_e_var_save
               i_variant_default     = v_e_var_def.
      move : 'A' to v_e_var_save ,
             'X' to v_e_var_def .
      call method m_cl_variant->set_values
           exporting it_outtab             = mt_outtab
                     it_fieldcatalog       = itab_fieldcatalog
                     it_sort               = itab_mt_sort
                     it_filter             = itab_mt_filter
                     is_variant            = struct_variant
                     is_layout             = v_es_layout
                     i_variant_save        = v_e_var_save
                     i_variant_default     = v_e_var_def.
       loop at itab_fieldcatalog into tmp_fieldcatalog
            where tabname ne space.
         exit.
       endloop.
    * Recherche de la variante.
      call method m_cl_variant->load_variant
           exporting i_tabname          = tmp_fieldcatalog-tabname
                     i_bypassing_buffer = 'X'
                    i_dialog           = space.
      create data  mt_ct00 like itab_zgre000_s2.
      create data  mt_ct01 like itab_zgre000_s2.
      create data  mt_ct02 like itab_zgre000_s2.
      create data  mt_ct03 like itab_zgre000_s2.
      create data  mt_ct04 like itab_zgre000_s2.
      create data  mt_ct05 like itab_zgre000_s2.
      create data  mt_ct06 like itab_zgre000_s2.
      create data  mt_ct07 like itab_zgre000_s2.
      create data  mt_ct08 like itab_zgre000_s2.
      create data  mt_ct09 like itab_zgre000_s2.
      assign mt_ct00->* to <lt_ct00>.
      assign mt_ct01->* to <lt_ct01>.
      assign mt_ct02->* to <lt_ct02>.
      assign mt_ct03->* to <lt_ct03>.
      assign mt_ct04->* to <lt_ct04>.
      assign mt_ct05->* to <lt_ct05>.
      assign mt_ct06->* to <lt_ct06>.
      assign mt_ct07->* to <lt_ct07>.
      assign mt_ct08->* to <lt_ct08>.
      assign mt_ct09->* to <lt_ct09>.
    * Recherche des valeurs à partir de la variante sélectionnée.
      call method m_cl_variant->get_values
           importing es_variant     = struct_variant
             et_fieldcatalog        = itab_fieldcatalog
             et_sort                = itab_mt_sort
             et_filter              = itab_mt_filter
             es_layout              = v_es_layout
             et_grouplevels_filter  = mt_grouplevels_filter
             e_variant_save         = v_e_var_save
             e_variant_default      = v_e_var_def.
      call function 'LVC_SORT_APPLY'
        exporting
          it_sort         = itab_mt_sort
    *     I_AS_TEXT       = 'X'
    *     I_STABLE        = 'X'
        tables
          ct_data         = itab_zgre000_s2.
      call function 'LVC_TRANSFER_TO_KKBLO'
        exporting
          it_sort_lvc                     = itab_mt_sort
          it_grouplevels_lvc              = mt_grouplevels_filter
        importing
          et_sort_kkblo                   = itab_lt_sort
          et_grouplevels_kkblo            = itab_lt_grouplevels
        exceptions
          it_data_missing                 = 1
          it_fieldcat_lvc_missing         = 2
          others                          = 3.
      call function 'ALV_GROUPLEVELS_GET'
        exporting
          i_subtotals_only          = 'X'
          it_sort                   = itab_lt_sort
          i_subtract_counter        = 'X'
        importing
          et_groups                 = itab_lt_grouplevels
        tables
          t_outtab                  = itab_zgre000_s2.
      call function 'LVC_TRANSFER_FROM_KKBLO'
        exporting
          it_grouplevels_kkblo            = itab_lt_grouplevels
        importing
          et_grouplevels_lvc              = mt_grouplevels_filter
        exceptions
          it_data_missing                 = 1
          others                          = 2.
    * Recupération des totaux.
      call function 'LVC_TOTALS_GET'
        exporting
          it_sort                  = itab_mt_sort
          is_layout                = v_es_layout
          it_filter_index          = itab_mt_filter_i
        tables
          it_data                  = itab_zgre000_s2
          et_collect00             = <lt_ct00>
          et_collect01             = <lt_ct01>
          et_collect02             = <lt_ct02>
          et_collect03             = <lt_ct03>
          et_collect04             = <lt_ct04>
          et_collect05             = <lt_ct05>
          et_collect06             = <lt_ct06>
          et_collect07             = <lt_ct07>
          et_collect08             = <lt_ct08>
          et_collect09             = <lt_ct09>
        changing
          cs_total_options         = ms_total_options
    *      ct_fieldcat              = mt_fieldcatalog
          ct_fieldcat              = itab_fieldcatalog
          ct_grouplevels           = mt_grouplevels_filter
          c_calculate_totals       = m_calculate_totals
          c_sumlevel               = m_sumlevel .
    * Converti dans un language comprehensible par SAP.
      call function 'LVC_TABLE_FOR_DISPLAY'
        exporting
          it_fieldcat                    = itab_fieldcatalog
          it_sort                        = itab_mt_sort
          it_filter                      = itab_mt_filter
          is_total_options               = ms_total_options
          is_layout                      = v_es_layout
        importing
          et_lvc_data                    = itab_mt_data
          et_lvc_info                    = itab_mt_info
        tables
          it_data                        = itab_zgre000_s2
          it_collect00                   = <lt_ct00>
          it_collect01                   = <lt_ct01>
          it_collect02                   = <lt_ct02>
          it_collect03                   = <lt_ct03>
          it_collect04                   = <lt_ct04>
          it_collect05                   = <lt_ct05>
          it_collect06                   = <lt_ct06>
          it_collect07                   = <lt_ct07>
          it_collect08                   = <lt_ct08>
          it_collect09                   = <lt_ct09>
        changing
          ct_grouplevels                 = mt_grouplevels_filter
        exceptions
          fieldcat_not_complete          = 1
          others                         = 2.
      if sy-subrc ne space.
        write : /1 'Probleme de convertion.'.
        stop.
      endif.
    * Convertie en HTML.
      call function 'LVC_ALV_CONVERT_TO_HTML'
        exporting
          it_data                       = itab_mt_data
          it_info                       = itab_mt_info
          i_file_dialog                 = ' '
        importing
          et_html                       = itab_html.

  • Background schduling for COBRA Plan

    Hi ,
    As per my client requirement i have to schdule the Z program in Background. So that every month it will trigers automatically with the help of BASIS people.
    So, now i have to automate 4 programes in a Z program which belongs to COBRA Plan.
    Alll the 4 programs belongs to differnt functionality. First progrm will  collects the COBRA Event collection, 2nd one will generate the letter. 3rd one wil extract the data for the letter generated employees, 4th one will finalaise the output and keeps into a text file.
    Now, my problem in 2 progrm, currently iam selecting the employee mannually , but in automatic background scheduling how can choose the employees.
    Please help me in finding any way to select all the employees for letter generation automatically.
    Please help me on this.....
    Thanks & regards,
    Naga

    Hi ,
    As per my client requirement i have to schdule the Z program in Background. So that every month it will trigers automatically with the help of BASIS people.
    So, now i have to automate 4 programes in a Z program which belongs to COBRA Plan.
    Alll the 4 programs belongs to differnt functionality. First progrm will  collects the COBRA Event collection, 2nd one will generate the letter. 3rd one wil extract the data for the letter generated employees, 4th one will finalaise the output and keeps into a text file.
    Now, my problem in 2 progrm, currently iam selecting the employee mannually , but in automatic background scheduling how can choose the employees.
    Please help me in finding any way to select all the employees for letter generation automatically.
    Please help me on this.....
    Thanks & regards,
    Naga

  • Downloading in background

    I am using a web page to run an exe file which is rather
    large.
    If I call the exe file direct it takes a very long time to
    download and run
    If I use a please wait exe then use jumpout, the large file
    downloads and runs in seconds.
    I am now going to write the login form as a separate entity
    to the learning exe.... so Is there a way I can download this file
    in the back ground, whilst the user is logging on.

    Copying from a network drive should be easy to achieve. eMail
    me off
    list and I will send you a U32/sample file to try.
    Mark
    mark at authorwarextras dot co dot uk
    The Pc Doctor wrote:
    > Hi Mark,
    >
    > I'll try anything to solve this problem !
    >
    > As I write VB programs as well the way I'm thing of
    resolving this is to carry
    > out the below steps....
    >
    > 1. Test to see if the file exists in a folder on the C
    Drive.
    > 2. If yes then don't download use the file that's there
    > 3. If No then download file (either while user is
    logging on or a please wait
    > loading screen is displayed)
    > 4. Once download is completed then run the .exe
    Authorware file from the C
    > Drive.
    >
    > My reasoning behind this is that on our network we have
    several users logging
    > onto each computer, but not all computers will have the
    .exe run on them. If I
    > can manage this then it would mean that the
    Authorware.exe file will only need
    > to be downloaded once and after that it's allready
    there. This not only save
    > bandwidth but users time as well.
    >
    > The .exe to run is on a network server, not a web server
    unfortunately.
    >
    > In VB this would present no problem to me, but in
    Authorware, which I am very
    > new to, (without any training) I'm lost and would be
    grateful for any pointers
    > at all.
    >
    > To be honest I don't even know if it's possible in
    Authorware..........
    >
    >
    quote:
    Originally posted by:
    Newsgroup User
    > So you are trying to do this from a file packaged as
    .exe ? I have a
    > U32 that will get the file for you using an http address
    on my site, but
    > it is synchronous. In other words, you start the
    download and the flow
    > will wait there (in the calc icon) until it completes.
    >
    > Mark
    >
    > www.AuthorwareXtras.co.uk
    >
    > The Pc Doctor wrote:
    > > Thanks to both of you, but the way I read the help
    file is that only works
    > for
    > > web packages. Because of local network issues I
    have to use just exe files.
    > >
    > > Is it worth my while exploring the possiblities of
    first using a small
    > logon
    > > form which downloads the large exe file into a
    folder on the host PC then
    > runs
    > > it???
    > >
    > >
    >
    >
    >
    >

  • Newsstand, subscription pauses downloading, no background downloading?

    Straingt to the point, in newsstand there's nat geo magazine and Times... both which I am subscribed to, the thing is when there's a new issue coming out and I click download, it goes fine.. but when I close the app and go to another apps or leave it alone for a while and the screen goes to black, it pauses the download. Must I "wait" and "watch" the progress bar to complete d/loading every time then close the apps? sometimes the internet speed is kind of slow so the dload process would take about 15-30 minutes... Is this default feature of the Ipad mini? I wonder if there's something about the setting that i'm missing. So everytime downloading a new issue of the magazines... I would have to download it at the newsstand screen, let it finish before doing anything, that's if the pauses don't happen and if it did, I would have to click continue.

    My guess is the anti virus software you are using may be the problem. As there are no (that's zero, none, zip, nada) viruses for OS X using anti virus software is a waste of resources and time. I would suggest reading the Macintosh Virus Guide.
    You can try downloading and using Little Snitch, this may provide the information you're after.

Maybe you are looking for