Redirecting spool output to a file on app. server

I'm running a SAP report as a background job.
I hve a requirement to send the spool output to a file on app. server. This needs to happen automatically in background.
I'll appreciate any suggestion.

Hi,
use report from Re: output to pdf format and substitute pc-download with file transfer
good luck
Andreas

Similar Messages

  • How to export spool data to memory / save spool data to file in app server

    I need to save output from a report painter generated report to the file in app server.
    I tried submit exporting list to memory and return. but got Not_Found exception when call FM LIST_FROM_MEMORY.  I also tried to call FM CONVERT_ABAPSPOOLJOB_2_PDF with no device parameter, but the pdf output from that FM is not readable.
    Any suggestions will be greatly appreciated!

    Moderator message - Welcome to SCN.
    But please do not cross post. Have a look at Please read "The Forum Rules of Engagement" before posting!  HOT NEWS!! and How to post code in SCN, and some things NOT to do... before posting.
    Rob

  • Redirect SM50 output on unix file

    Hello,
    how can we execute daily SM50 daily and redirect html output on unix file?
    I Tried SE38, execute SM50 succefully, but no way to redirect output of this transaction on a unix file ?
    Thanks in advance.

    Hi majda,
    Hope you are doing good.
    Maybe check /nSM49 and create a OS command using ">>" operator Divyanshu mentioned:
    Restrict Authorizations for Executing External Commands - SAP NetWeaver Application Server ABAP Security Guide - SAP Lib…
    Thank you!
    Kind Regards,
    Hemanth
    SAP AGS

  • Transfer a file from App Server to a FTP site.

    Hi, Abapers.
    I need your help. Probably, this topic has already been posted in a similar way, but we need an answer to solve our problem.
    We have to sent a PDF file from a directory of our app server (AIX) to a FTP directory... which would the FM sequence we should use to goal it?
    Best Regards.

    Hi Santiago,
    create fm to send file from APP server to FTP site.
    if you want to Post file from desktop to Appl use Transaction - CG3Y
    if you want to Post file from Appl to Desktop use Transaction - CG3Z
    copy the code below....
    *  Author: Prabhudas                            Date:  02/21/2006  *
    *  Name: Z_FTP_FILE_TO_SERVER                                          *
    *  Title: FTP File on R/3 Application Server to External Server        *
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(DEST_HOST) TYPE  C
    *"     REFERENCE(DEST_USER) TYPE  C
    *"     REFERENCE(DEST_PASSWORD) TYPE  C
    *"     REFERENCE(DEST_PATH) TYPE  C
    *"     REFERENCE(SOURCE_PATH) TYPE  C
    *"     REFERENCE(FILE) TYPE  C
    *"     REFERENCE(BINARY) TYPE  CHAR1 OPTIONAL
    *"     REFERENCE(REMOVE_FILE) TYPE  CHAR1 OPTIONAL
    *"  TABLES
    *"      FTP_SESSION STRUCTURE  ZMSG_TEXT OPTIONAL
    *"  EXCEPTIONS
    *"      CANNOT_CONNECT
    *"      SOURCE_PATH_UNKNOWN
    *"      DEST_PATH_UNKNOWN
    *"      TRANSFER_FAILED
    *"      COMMAND_FAILED
      DATA: w_password     TYPE zftppassword,
            w_length       TYPE i,
            w_key          TYPE i                  VALUE 26101957,
            w_handle       TYPE i,
            w_command(500) TYPE c.
      REFRESH ftp_session.
    * Scramble password (new Unicode-compliant routine)
      w_length = STRLEN( dest_password ).
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = dest_password
          sourcelen   = w_length
          key         = w_key
        IMPORTING
          destination = w_password.
    * Connect to FTP destination (DEST_HOST)
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          user            = dest_user
          password        = w_password
          host            = dest_host
          rfc_destination = 'SAPFTPA'
        IMPORTING
          handle          = w_handle
        EXCEPTIONS
          not_connected   = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
          RAISING cannot_connect.
      ENDIF.
    * Optionally, specify binary file transfer
      IF binary = 'X'.
        w_command = 'bin'.
        CALL FUNCTION 'FTP_COMMAND'
          EXPORTING
            handle        = w_handle
            command       = w_command
          TABLES
            data          = ftp_session
          EXCEPTIONS
            command_error = 1
            tcpip_error   = 2.
        IF sy-subrc <> 0.
          CONCATENATE 'FTP command failed:' w_command
            INTO w_command SEPARATED BY space.
          MESSAGE ID 'ZW' TYPE 'E' NUMBER '042'
              WITH w_command
              RAISING command_failed.
        ENDIF.
      ENDIF.
    * Navigate to source directory
      CONCATENATE 'lcd' source_path INTO w_command SEPARATED BY space.
      CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          handle        = w_handle
          command       = w_command
        TABLES
          data          = ftp_session
        EXCEPTIONS
          command_error = 1
          tcpip_error   = 2.
      IF sy-subrc <> 0.
        CONCATENATE 'FTP command failed:' w_command
          INTO w_command SEPARATED BY space.
        MESSAGE ID 'ZW' TYPE 'E' NUMBER '042'
            WITH w_command
            RAISING source_path_unknown.
      ENDIF.
    * Navigate to destination directory
      CONCATENATE 'cd' dest_path INTO w_command SEPARATED BY space.
      CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          handle        = w_handle
          command       = w_command
        TABLES
          data          = ftp_session
        EXCEPTIONS
          command_error = 1
          tcpip_error   = 2.
      IF sy-subrc <> 0.
        CONCATENATE 'FTP command failed:' w_command
          INTO w_command SEPARATED BY space.
        MESSAGE ID 'ZW' TYPE 'E' NUMBER '042'
            WITH w_command
            RAISING dest_path_unknown.
      ENDIF.
    * Transfer file
      CONCATENATE 'put' file INTO w_command SEPARATED BY space.
      CALL FUNCTION 'FTP_COMMAND'
        EXPORTING
          handle        = w_handle
          command       = w_command
        TABLES
          data          = ftp_session
        EXCEPTIONS
          command_error = 1
          tcpip_error   = 2.
      IF sy-subrc <> 0.
        CONCATENATE 'FTP command failed:' w_command
          INTO w_command SEPARATED BY space.
        MESSAGE ID 'ZW' TYPE 'E' NUMBER '042'
            WITH w_command
            RAISING transfer_failed.
      ENDIF.
    * Disconnect from destination host
      CALL FUNCTION 'FTP_DISCONNECT'
        EXPORTING
          handle = w_handle.
    * Optionally, remove file from source directory
      IF remove_file = 'X'.
       CONCATENATE source_path '/' file INTO w_command.
      CONCATENATE 'rm' w_command INTO w_command SEPARATED BY space.
       OPEN DATASET '/dev/null' FOR OUTPUT FILTER w_command.
       CLOSE DATASET '/dev/null'.
    ENDIF.
    Regards,
    Prabhudas

  • Tab delimited file on app server. How to do that?

    Hello,
    When i transfer a tab delimited file from pre. server(windows) to app. server(windows) using CG3Z , the tab delimitation  is not working.
    for eg : the file with below layout
    01.04.2007     31.03.2008     1     120     
    01.05.2007     31.07.2008     2     140     
    is getting changed like
    01.04.2007#31.03.2008#1#120     
    01.05.2007#31.07.2008#2#140     
    All i need is a tab delimited file in app server also . Wats that i need to do for this ? Also how can i write a tab delimited file on app server through my program using open dataset.
    Thanks for ur time.
    Jeeva.

    Hi..
    Check this code: you will find the solution:
    Using the Static Attribute <b>CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB</b>
    Example:
    This is the Simple way you can download the ITAB with Tab delimiter:
    DATA : V_REC(200).
    OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    LOOP AT ITAB INTO WA.
      Concatenate WA-FIELD1 WA-FIELD2
             INTO V_REC
             SEPARATED BY CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
      TRANSFER V_REC TO P_FILE.
    ENDLOOP.
    CLOSE DATASET P_FILE.
    Note: if there are any Numeric fields ( Type I, P, F) In your ITAB then before CONCATENATE you have to Move them to Char fields ..
    Reward if Helpful.
    Example:
    DATA: V_RECORD(200).
    OPEN DATASET P_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF SY-SUBRC <> 0.
      EXIT.
    ENDIF.
    DO.
    READ DATASET P_FILE INTO V_RECORD.
      IF SY-SUBRC NE 0.
        EXIT.
      ENDIF.
    SPLIT V_Record at CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
                                INTO WA-FIELD1 WA-FIELD2.
    APPEND WA TO ITAB.
    ENDDO.
    <b>reward if Helpful.</b>

  • Delete file from app server

    hi, i am running a background job in bw and for that created a file on the application server.now how do i delete that file.to create the file i just gave the name in the bw and the file got created.i am not able to find how to delete it.
    or
    rather than deleting the file how can we delete the data it is containing.please do let me know

    hi,
    but using DELETE DATASET u can remove file for app server.
    If u want to delete the data alone then give the same name without data it will overwrite.
    U can check it in AL11.
    regards
    md zubair sha
    U can also use the function module - EPS_DELETE_FILE
    Message was edited by:
            md zubair sha

  • System exception while deleting the file from app server in background job

    Hi All,
    I have a issue while the deleting the file from application server.
    I am using the statement DELETE DATASET in my program to delete the file from app server.
    I am able to delete the file from the app server when i run the program from app server.
    When i run the same report from background job i am getting the message called System exception.
    Is there any secuirity which i need to get the issue.
    Thank You,
    Taragini

    Hi All,
    I get all the authorization sto delete the file from application serever.
    Thing is i am able to run the program sucessfully in foreground but not in the background .
    It i snot giving any short dump also just JOB is cancelled with the exception 'Job cancelled after system exception ERROR_MESSAGE'.
    Can anybody please give me suggestion
    Thanks,
    Taragini

  • Problem with READ DATASET when reading file from app server

    Hi,
    wondering if anyone can help, I'm using the following code to read from a file on app server, the file is of type .rtf
    OPEN DATASET file_rtf FOR INPUT IN TEXT MODE
                                 ENCODING DEFAULT
                                 WITH SMART LINEFEED.
    DO.
    READ DATASET file_rtf INTO string.
    IF SY-SUBRC = 0.
    EXIT.
    ENDIF.
    ENDDO.
    the open dataset part works sy-subrc = 0, but the read returns sy-subrc = 8 and no data is passed to string.
    Any ideas as to what is causing this problem appreciated, <removed>
    Thanks
    Edited by: Thomas Zloch on Mar 17, 2010 3:57 PM - please don't offer p...

    Hi Adam,
    The source code in the below link has details about how to read/write to application server.
    [Application server file operartions|http://www.divulgesap.com/blog.php?p=NDk=]
    Please let us know if you have any issues.
    Regards,
    Ravi

  • Problem in downloading file from app server using CG3Y in to .XLS fomat

    hi All,
    I have uploaded file in to application server through a program using open data set with the separater as "|" ( pipe ) . Now the user should be able to download the file from apps server to presenataion server in .XLS format using txn CG3Y. but when we download, the format appears wierd and the data is not consistent across columns in excel. i.e the data which is supposed to be in one column in the excel is in the other column. what precautaions should i take  before moving data to apps server so that it will be downloaded in a good format.
    Appreciate your help...
    Regards,
    Sreekanth.

    Separate each values with TAB space present in the application server .
    Currently u r using | pipe character. Instead of that use CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB as delimiter.
    Each value will displayed in separate cells in excel sheet when u download it frm app.server
    Regards,
    Lakshman.

  • Reading uploaded file from app. server

    Hi All,
    I am trying to upload a .csv format file to app. server thru txn CG3Z....
    When i try to open the file in my code thru open dataset and read dataset ...it is giving it in the form of 
    30002058,1000#50055501,2000#
    Now i want it to be in
    30002058,1000
               50055501,2000
    format...
    pleas suggest..
    thnx
    Rk

    Hi Rahul,
    have you tried reading it in BINary format?
    Kind regards,
    Alvaro

  • Download PDF file from APP server!

    Hi!
    Has anyone tried uplaoding and downloding a PDF table from app server as I tried from a normal method by Open dataset, Transfer but it wont work.
    Please provide any inputs.
    Thanks.

    Hi park,
    1. Using open data set, transfer , close etc,
       also it will work.
       ( it will download / upload any kind of file from app server)
    2. Just make sure the
       FULL PATHNAME and the FILENAME
       are mentioned in EXACT CASE
      (small/CAPITAL).
    3. U can check thru transaction AL11, to see the file and path.
    regards,
    amit m.

  • Saving report output to a file on the server.

    Hi,
    We are using BI Publisher Standalone version 10.1.3.3.1.
    Is it possible to schedule a report to output to a file on the server?
    I want the whole report to be saved as a file on the server.
    This is somewhat similar to bursting to a file system, but, I don't want to split the output.
    Any help is appreciated.
    Thanks,
    Nanda

    Yes, use the scheduler and schedule the report,
    do the bursting into FTP or
    schedule the report to run and run it into FTP as a single FILE.
    First option, you need to provide the query , with FTP server name, username, password etcccc.

  • How do I get the last changed date & time of a file in app server?

    Hi Experts,
    How do I get the last changed date & time of a file in app server?
    Thanks!
    - Anthony -

    Hi,
    that's what I use...
      CALL 'C_DIR_READ_FINISH'.             " just to be sure
      CALL 'C_DIR_READ_START' ID 'DIR' FIELD p_path.
      IF sy-subrc <> 0.
        EXIT. "Error
      ENDIF.
      DO.
        CLEAR l_srvfil.
        CALL 'C_DIR_READ_NEXT'
          ID 'TYPE'   FIELD l_srvfil-type
          ID 'NAME'   FIELD l_srvfil-file
          ID 'LEN'    FIELD l_srvfil-size
          ID 'OWNER'  FIELD l_srvfil-owner
          ID 'MTIME'  FIELD l_mtime
          ID 'MODE'   FIELD l_srvfil-attri.
    *    l_srvfil-dir = p_path .
        IF sy-subrc = 1.
          EXIT.
        ENDIF." sy-subrc <> 0.
        PERFORM p_to_date_time_tz
          USING    l_mtime
          CHANGING l_srvfil-mod_time
                   l_srvfil-mod_date.
        TRANSLATE l_srvfil-type TO UPPER CASE.               "#EC TRANSLANG
        PERFORM translate_attribute CHANGING l_srvfil-attri.
        CHECK:
          NOT l_srvfil-file = '.',
          l_srvfil-type = 'D' OR
          l_srvfil-type = 'F' .
        APPEND l_srvfil TO lt_srvfil.
      ENDDO.
      CHECK NOT lt_srvfil IS INITIAL.
      pt_srvfil = lt_srvfil.
    FORM p_to_date_time_tz  USING    p_ptime  TYPE p
                            CHANGING p_time   TYPE syuzeit
                                     p_date   TYPE sydatum.
      DATA:
        l_abaptstamp TYPE timestamp,
        l_time       TYPE int4,
        l_opcode     TYPE x VALUE 3,
        l_abstamp    TYPE abstamp.
      l_time = p_ptime.
      CALL 'RstrDateConv'
        ID 'OPCODE' FIELD l_opcode
        ID 'TIMESTAMP' FIELD l_time
        ID 'ABAPSTAMP' FIELD l_abstamp.
      l_abaptstamp = l_abstamp.
      CONVERT TIME STAMP l_abaptstamp TIME ZONE sy-zonlo INTO DATE p_date
          TIME p_time.
    ENDFORM.                    " p_to_date_time_tz
    Regards,
    Clemens

  • How to redirect CELLCLI output to text file

    Hi,
    I would like to redicrect the output of the cellcli command to a text file .
    For example , how to redirect the output of this command to a text file on /tmp
    CellCLI> list metrichistory where objectType = 'CELL' -
    and name = 'CL_TEMP'Thanks

    cellcli has spooling capabilities similar to sqlplus:
    CellCLI> help spool
      Usage:  SPO[OL] [<filename> [ CRE[ATE] | REP[LACE] | APP[END]] | OFF ]
      Purpose: SPOOL <filename>: Direct the results to the file <filename>.
               SPOOL OFF: Turn off the spooling.
               SPOOL: Check the current spooling status.
      Arguments:
        <filename>: The filename where the results will be output.
      Options:
        [APPEND]: If the filename already exists, the following output will
                  be appended to the file. Without this option, the existing file
                  contents will be replaced.
        [CREATE]: If the filename already exists, an error is reported.
        [REPLACE]: If the filename already exists, the contents will be
                  replaced.  This is the default, when no option is provided.
      Examples:
        spool myfile
        spool myfile append
        spool off
        spoolBut if you are trying to script it, it would be easier to just run it command line:
    # cellcli -e "list metrichistory where objectType = 'CELL' and name = 'CL_TEMP'" > /tmp/CL_TEMP.txtAlso look into dcli which allows you to run cellcli commands on one or more cells from a compute node.
    Good luck.

  • Redirecting XSLT output to multiple files

    Hi,
    I am trying to redirect the output of the XSLT into multiple files using
    <xsl:variable name="filename" select="concat(@id,'.xml')" />
    <redirect:write select="$filename">
    </redirect:write>I dont want to hard-code the directory of the $filename in XSL, I want to set it or resolve it programatically in the java code.
    Can you please tell me if this can be done in someway ?

    Aravinda wrote:
    I dont want to hard-code the directory of the $filename in XSL, I want to set it or resolve it programatically in the java code.
    Can you please tell me if this can be done in someway ?You + setParameter + method of your Transformer in java code to set parameters. like below:
    transformer.setParameter("message1", "This is my message to XSLT from Java Class.");
    transformer.setParameter("message2", "Hello XSLT how are you?");
    . . .You can retrieve above parameters in global parameters/variables(must be as child of xsl:stylesheet element in xslt) defined in xslt like below:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:param name="message1"></xsl:param>
         <xsl:variable name="message2"></xsl:variable>
         <xsl:template match="/">
              <xsl:value-of select="$message1"/>     // retrieving message1
              <xsl:value-of select="$message2"/>     // retrieving message2
              <xsl:value-of select="concat($message1,$message2)"/>     // performing concat on message1 and message2
         </xsl:template>
    </xsl:stylesheet>*Cheers
    TYPUROHIT*
    (Tejas Purohit)

Maybe you are looking for

  • Key Stuck - *EVEN WHEN NO KEYBOARD CONNECTED*

    Hello The up cursor on the keyboard is stuck on. But it stays stuck even when no keyboard is connected at all. i.e. if you use the mouse to open a menu, the options will highlight from the bottom up. If you type a document the cursor will keep flying

  • Is there a way to include a text document within the DVD?

    I am using Encore CS5. I do a DVD series. For the latest installment, I have been asked to include a 17 page document which the user could print from their computer or view from their TV, and which the main menu of the DVD would link to. Is this poss

  • Problem for install itunes11.1

    I'm not able to install itunes 11.1 because they ask me itunes64.msi but I don't know what it is ??? Please help me ....

  • Converting WMV files to QuickTime  and file size

    I have QT Pro and I have no problem doing a "save as..." for converting WMV files to .mov. I also have Flip4Mac converting the file to be viewed in QT first. My question is that if I do a straight-ahead "save as..." it'll make the file's size about 2

  • Updated to iso 7 now no slide show?

    iPhone 4 updated to ios 7 now there is no slideshow triangle in the photos app. Went to - Settings > Photos & Camera > Slideshow > Play Each Slide For > time is gayed out. I can change the play time 3 to 20 seconds showing blue check mark but time re