Dump spool buffer to a file

Hi,
I have a requirement to capture spool job and sending it to file.
I am retrieving the output of one spool request  and sending it to a file using 'TRANSFER' statment in a loop.
it is taking too long time to complete this process..
is there any other way to, dump the buffer to a file at one instance?
Plz help me

Hi,
Try to use FM - CONVERT_ABAPSPOOLJOB_2_PDF
ot similar Fms
RSPO_DISPLAY_ABAP_SPOOLJOB  
RSPO_RETURN_ABAP_SPOOLJOB   
RSPO_RETURN_ABAP_SPOOLJOB_RAW
Thanks,
Sree.

Similar Messages

  • Transfer a buffer to a file

    Hi,
    I have a requirement to capture spool job and sending it to file.
    I am retrieving the output of one spool request and sending it to a file using 'TRANSFER' statment in a loop.
    it is taking too long time to complete this process..
    is there any other way to, dump the buffer to a file at one instance?
    Plz help me
    I have not seen any response.. so posting it again
    Thanks

    Sending to the file means downloading to application/presentation server. Then convert the spool to PDF and doanload that file. It will take less time.
    you may refer this WIKI if the spool is from NAST table -
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/gettingSpoolRequestNumberfortheOutput+type

  • Spool Buffer

    Hi,
    My question is when Spool buffer is full and new spool buffer is requetsed what happens to the request? Also where is this new request stored?
    Thanks in advance!
    Cheers,
    Vinay

    When the buffer is full, I guess the program resulting in the spool request would end in a short dump ( runtime error ).. in effect the Spool Req would not be created at all, as there is no 'space'.
    Arya.

  • 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

  • 0000000040/    32 in spooler (buffer too

    Hello ,
    4.6c system.
    We are running Z-program in the  background having LINE-SIZE 255 in the program.
    The completed jobs have spool requests generated, but they cannot be viewed for any user.
    0000000040/    32 in spooler (buffer too) is the error message.
    The spool consistency check report is running correctly in SAP.
    Default printer is used as the op device.
    Can you please suggest.

    In SM37:
    Goto>Display Requests>Settings...
    Then in "Display area"-->"From page"
    Set it to from page 1 - "no of pages" then try to display
    the spool again.

  • Multile spool output to one file

    How can i pass output of multiple spool request into a single pdf file ?
    Note : i know how to pass single spool request to pdf file.
    Help!!!

    Hi guru,
    Use two start forms and pass your two different forms thorugh those two different start forms. suppose u developed two diferent forms like one is potrait and land scape and want to generate in single spool. Then u need to call two start froms one for potrait and one for land scape. Hope this helps you. Reply for queries.
    Rewards for use ful points.
    Regards,
    Kumar.

  • Issue with spooling data to csv file

    Hi,
    I am trying to spool a table data to csv file using spool command in command prompt. and its spooling around thousand records.
    I am able to see all the thousnad records on dos prompt while spooling happening.
    Instwead of that, is there any other way that will stop printing output on dosprompt rather it will spool directly to csv file?
    Please help me...
    Thanks,
    Ravi.

    user10403630 wrote:
    Thanks for all your suggestions...
    I have tried a sample script which does have only set termout off and its working fine...
    but my script is having some thing like below
    SET ESCAPE ON
    SET SERVEROUTPUT ON
    SET ECHO OFF
    SET HEADING ON
    SET COLSEP ','
    SET FEEDBACK OFF
    SET PAGESIZE 0
    SET LINESIZE 5000
    SET TRIMSPOOL OFF
    SET TERMOUT OFF
    This is not working...
    I believe something is trying to overwrite the functionalilty of set termout off in this case
    Please help me,....So go to the SQL*Plus reference manual and read up on each of the SET options you listed above . . .

  • Dumping the data to XML file (Event driven )

    Hi ,
    Can anybody help me on this requirement .
    Whenever there is an updation or change in the HR Master data like insertion of new personnel number or deletion of personnel number then I need to dump the data to XML file . That means I need to make it event driven.
    Will it be possible programmatically ?
    Please give me your inputs.
    Best Regards
    Bhagat.

    Hi Bhagat,
    isn't it possible to use change pointers for this?
    Then in partner profile use an XML file port and it should be done!
    Probably this blog could help you:
    <a href="/people/stefan.grube/blog/2006/09/18/collecting-idocs-without-using-bpm">Collecting IDocs without using BPM</a>, have a look at the part where it explains how to write Idoc as XML.
    Hope it helps,
    Kind Regards,
    Sergio

  • Method to dump all tables to flat files?  (spool is slow)

    Hey all,
    I have been using spool with a bunch of set commands and it works great, but performance is a bit slow. Especially for our partitioned tables. (4.2 Mill records) Is there a better way to dump flat files?
    I want to use sqlldr to import (faster than IMP) but no good if creating the flat files is 10X slower than EXP utility.
    Any ideas?
    Thanks,
    Chris G

    Hi Chris,
    Maybe spooling itself is not a key issue which slow down your dumping. In my daily job, I need to dump a big bunch of data (even over 10M records in one table) to .txt files and .csv files and they are all done via spooling.
    If you find the query itself is slow, caused by partition or join, you can try to create materialized tables to get the query results and then dump the data from these tables. This is an approach when I was working on a big data warehouse project.
    Good luck,

  • Not able to convert spool output to PDF file properly

    Hi guys,
    i have got spool which contains russian characters which needs to be converted to PDF file.
    Note: ******Assuming user enters only one spool in S_Spool*******
    I am using following code to do this:
    **---- Get Spool ID Details from TSP01
    select * from tsp01 into table i_tsp01 where rqident eq s_spool.
    **---- Sort Table in Ascending order based on Spool Id
    sort i_tsp01 by rqident.
    **---- Get information about Multiple spools
    loop at i_tsp01.
    **---- Get Multiple Spool information
      call function 'RSPO_RETURN_SPOOLJOB'
        exporting
          rqident              = i_tsp01-rqident
        tables
          buffer               = i_spool_table
        exceptions
          no_such_job          = 1
          job_contains_no_data = 2
          selection_empty      = 3
          no_permission        = 4
          can_not_access       = 5
          read_error           = 6
          type_no_match        = 7
          others               = 8.
      if sy-subrc = 0.
      endif.
    **---- Get the Last line index (Number of Lines)
      describe table i_spool_table lines v_lines.
      i_otf[] = i_spool_table[].
    endloop.
    **---- Convert the OTF information to PDF.
    call function 'CONVERT_OTF_2_PDF'
      importing
        bin_filesize           = v_size
      tables
        otf                    = i_otf
        doctab_archive         = i_doc
        lines                  = i_pdf
      exceptions
        err_conv_not_possible  = 1
        err_otf_mc_noendmarker = 2
        others                 = 3.
    if sy-subrc <> 0.
      message i002(sy) with 'Cannot convert to PDF, exiting....'.
      leave program.
    endif.
    DATA: v_numbytes TYPE i.
    DATA : v_return1(128).
      CONCATENATE 'C:\' 'F_spool' '.pdf' INTO v_return1.
      CONDENSE v_return1.
      CALL FUNCTION 'WS_DOWNLOAD'
           EXPORTING
                bin_filesize = v_size
                filename     = v_return1
                filetype     = 'BIN'
             IMPORTING
                  filelength = v_numbytes
             TABLES
                data_tab     = i_pdf
         EXCEPTIONS
           file_open_error               = 1
           file_write_error              = 2
           invalid_filesize              = 3
           invalid_type                  = 4
           no_batch                      = 5
           unknown_error                 = 6
           invalid_table_width           = 7
           gui_refuse_filetransfer       = 8
           customer_error                = 9
           OTHERS                        = 10 .
      IF sy-subrc NE 0.
        EXIT.
      ENDIF.
    i have already tried standard pgm : RSTXPDFT4. But it does not work.
    Suitable answers will be rewarded.
    Thanks,
    GURU

    Hi Guru,
    Use FM 'CONVERT_ABAPSPOOLJOB_2_PDF'.
    Refer this code:
    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.
    Regards,
    Hemant

  • Signal recovery 7225 lock-in - Dumping curve buffer issue

    Hi there
    I am programming an experiment that requires me to take data fast using the curve buffer of my lock-in amplifier (Signal Recovery 7225).  I have been using the supplied vi files in labview, but seem to be having a problem with the read buffer vi.  I get a file but it only contains the names of the variables I am measuring, no data.  I would be very grateful for any assistance.  The vi is attached.
    Thanks
    Grace
    Attachments:
    PMV_lockinspeedtest_140205_rdbffrtxt.vi ‏79 KB
    SR72XXLV8.llb ‏1772 KB

    Hi Guys
    I fixed it!  I went into the curve buffer vi and removed the select function that input the dump curve comman string.  It had been selecting the dump curve as decimal values instead of the dump curve as a binary command.  The labview VISA function seems to prefer binary input.  The fixed it and the ammended vi is in the attached library as Read Curves from Buffer Binary Set.vi.
    Hope this helps someone else too.
    Grace
    Attachments:
    SR72XXLV8.llb ‏1800 KB

  • Spool query result to file

    Hi everyone,
    I would like to spool the results of my query to a CSV file with a delimiter ';' on a hard drive. I use Toad for Oracle, my script worked fine previously on version 9, and now I have version 10.1, and it doesn't work anymore.
    What happens is I do get the output alright, but for some reason the output creates blank spaces at the end of each line, but only where the last column value for the line is 0.
    For example, I get something like this:
    Let's say I have an output of 5 columns, first 3 being string and the 4th and 5th being numbers
    A B C D E
    stringA stringB stringC 1.01 26.2
    stringA stringB stringC 10.002 0
    stringA stringB stringC 23 1001.1001
    In CSV this looks like this:
    A;B;C;D;E
    stringA;stringB;stringC;1.01;26.2
    stringA;stringB;stringC;10.002;0
    stringA;stringB;stringC;23;1001.1001
    The first and third row would appear fine, but the second row (the one that ends with a zero) would have a bunch of blank spaces after the zero.
    Here is the script that I use:
    SET PAGESIZE 0 LINESIZE 2000 TRIMSPOOL ON FEEDBACK OFF ECHO OFF TERMOUT OFF;
    SPOOL "C:\SPOOL_RESULT.CSV"
    SELECT
    'A'||';'||
    'B'||';'||
    'C'||';'||
    'D'||';'||
    'E'
    FROM DUAL
    UNION ALL
    SELECT
    A||';'||
    B||';'||
    C||';'||
    D||';'||
    E
    FROM SOME_TABLE;
    SPOOL OFF;
    CLEAR BUFFER;
    My opinion is that this TRIMSPOOL doesn't work as effectively as it should. I've tried several others, such as TRIMOUT, but nothing seems to work.
    I could bypass this by setting a 'dummy' column at the end that would always have some value <> 0, say 1, but this is not a clean solution.
    Any ideas?
    Thanks

    Hi,
    Try this one.
    SET PAGESIZE 0 LINESIZE 2000 TRIMSPOOL ON FEEDBACK OFF ECHO OFF TERMOUT OFF;
    SPOOL "C:\SPOOL_RESULT.CSV"
    SELECT
    'A'||';'||
    'B'||';'||
    'C'||';'||
    'D'||';'||
    'E'
    FROM DUAL
    UNION ALL
    SELECT
    A||';'||
    B||';'||
    C||';'||
    D||';'||
    trim(E)
    FROM SOME_TABLE;
    SPOOL OFF;
    CLEAR BUFFER;Trim will remove all the blank spaces.
    SQL> select length('0      ') from dual;
    LENGTH('0')
              7
    SQL> select length(trim('0      ')) from dual;
    LENGTH(TRIM('0'))
                    1

  • How to convert spool object to XLS file in background job? (please..urgent)

    Hello all.
    My requirment is to convert a spool object to an XLS file in the background (and send it via mail).
    Is it possible?
    If so, please help!
    please attach a code sample if you have one...
    Thanks allot.
    Barak.

    hi ,
    this might healp you ought
    TABLES: TBTCP, T024D.
    *PARAMETERS TEST(5).
    DATA: TJOBNAME LIKE TBTCP-JOBNAME VALUE 'REJ_COMP_MAIL_TO_MRP',
          SPOOLID LIKE TSP01-RQIDENT,
         V_LGORT LIKE MSEG-LGORT,
          V_DISPO LIKE T024D-DISPO,
          V_REPORT TYPE RSVAR-REPORT,
          V_VARIANT TYPE RSVAR-VARIANT.
    DATA: BEGIN OF VVALUES OCCURS 0.
            INCLUDE STRUCTURE RSPARAMS.
    DATA END OF VVALUES.
    DATA : BEGIN OF T_RECEIVERS OCCURS 0.
            INCLUDE STRUCTURE SOMLRECI1.
    DATA END OF T_RECEIVERS.
    DATA: BEGIN OF T_TBTCP,
         jobname like tbtcp-jobname,
         jobcount like tbtcp-jobcount,
          LISTIDENT LIKE TBTCP-LISTIDENT,
          SDLDATE LIKE TBTCP-SDLDATE,
          SDLTIME LIKE TBTCP-SDLTIME,
          VARIANT LIKE TBTCP-VARIANT,
          END OF T_TBTCP,
          ITAB_SPOOL LIKE STANDARD TABLE OF T_TBTCP,
          WA_SPOOL LIKE T_TBTCP.
    DATA: PLIST LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
    DATA: DOCUMENT_DATA LIKE SODOCCHGI1.
    DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
    DATA: SO_ALI LIKE SOLI OCCURS 100 WITH HEADER LINE,
          REAL_TYPE LIKE SOODK-OBJTP,
          SP_LANG LIKE TST01-DLANG, LINE_SIZE TYPE I VALUE 255,
          V_NAME LIKE SOEXTRECI1-RECEIVER.
    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.
    START-OF-SELECTION.
      PERFORM GET_SPOOL_REQNUMBER USING TJOBNAME. " CHANGING SPOOLID.
      PERFORM SEND_MAIL.
    PERFORM REMOVE_BLANK_SPOOLS.
    *&      Form  GET_SPOOL_REQNUMBER
          text
         -->P_0111   text                                                *
         <--P_UU  text                                                   *
    FORM GET_SPOOL_REQNUMBER USING P_0111.
      SELECT ALISTIDENT BSTRTDATE BSTRTTIME AVARIANT
       FROM TBTCP AS A INNER JOIN TBTCO AS B
            ON AJOBNAME EQ BJOBNAME AND
               AJOBCOUNT EQ BJOBCOUNT AND
               ASTEPCOUNT EQ BSTEPCOUNT
       INTO TABLE ITAB_SPOOL
          WHERE AJOBNAME = P_0111 AND BSTRTDATE EQ SY-DATUM.
    ENDFORM.                    " GET_SPOOL_REQNUMBER
    *&      Form  send_mail
          text
    -->  p1        text
    <--  p2        text
    FORM SEND_MAIL .
    Get the spool data.
      LOOP AT ITAB_SPOOL INTO WA_SPOOL.
        REFRESH : SO_ALI, PLIST, T_RECEIVERS.
        CLEAR : SO_ALI, PLIST, V_NAME, DOCUMENT_DATA, T_RECEIVERS, SPOOLID,
                V_REPORT, V_VARIANT, V_DISPO.
        IF WA_SPOOL-LISTIDENT <> '0'.
          MOVE WA_SPOOL-LISTIDENT TO SPOOLID.
          CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
            EXPORTING
              RQIDENT              = SPOOLID
              FIRST_LINE           = 1
              LAST_LINE            = 0
              DESIRED_TYPE         = ' '
            IMPORTING
              REAL_TYPE            = REAL_TYPE
              SP_LANG              = SP_LANG
            TABLES
              BUFFER               = SO_ALI
            EXCEPTIONS
              NO_SUCH_JOB          = 1
              JOB_CONTAINS_NO_DATA = 2
              SELECTION_EMPTY      = 3
              NO_PERMISSION        = 4
              CAN_NOT_ACCESS       = 5
              READ_ERROR           = 6
              TYPE_NO_MATCH        = 7
              OTHERS               = 8.
    Check the return code.
          IF SY-SUBRC <> 0.
            MESSAGE S208(00) WITH 'Error'.
            LEAVE LIST-PROCESSING.
          ENDIF.
    DATA : DATE LIKE SY-DATUM,
           DATE1(10) TYPE C.
    Prepare the data.
    CLEAR OBJTXT.
    REFRESH OBJTXT.
    DATE = SY-DATUM - 1.
    CONCATENATE DATE6(2) '-' DATE4(2) '-' DATE+0(4) INTO DATE1.
    CONCATENATE 'PLEASE CHECK THE LIST OF REJECTED MATERIALS POSTED ON :' DATE1 INTO OBJTXT.
    APPEND OBJTXT.
    SELECT SINGLE DSNAM FROM T024D INTO T024D-DSNAM WHERE WERKS = '1000' AND DISPO = WA_SPOOL-VARIANT.
    CONCATENATE 'MRP CONTROLLER :' WA_SPOOL-VARIANT '-' T024D-DSNAM INTO OBJTXT.
    APPEND OBJTXT.
    OBJTXT = ''.
    APPEND OBJTXT.
    CLEAR PLIST.
    REFRESH PLIST.
    PLIST-TRANSF_BIN = SPACE.
    PLIST-HEAD_START = 1.
    PLIST-HEAD_NUM = 0.
    PLIST-BODY_START = 1.
    DESCRIBE TABLE OBJTXT LINES PLIST-BODY_NUM.
    PLIST-DOC_TYPE = 'RAW'.
    APPEND PLIST.
    CLEAR PLIST.
         PLIST-TRANSF_BIN = 'X'.
         PLIST-HEAD_START = 0.
         PLIST-HEAD_NUM = 0.
         PLIST-BODY_START = 0.
         PLIST-BODY_NUM = 0.
         PLIST-DOC_TYPE = 'RAW'.
          PLIST-OBJ_DESCR = WA_SPOOL-VARIANT.
         APPEND PLIST.
          PLIST-TRANSF_BIN = 'X'.
          PLIST-HEAD_START = 0.
          PLIST-HEAD_NUM = 0.
          PLIST-BODY_START = 1.
          DESCRIBE TABLE SO_ALI LINES PLIST-BODY_NUM.
          PLIST-DOC_TYPE = REAL_TYPE.
    Get the size.
          READ TABLE SO_ALI INDEX PLIST-BODY_NUM.
          PLIST-DOC_SIZE = ( PLIST-BODY_NUM - 1 ) * LINE_SIZE + STRLEN( SO_ALI ).
          APPEND PLIST.
    ***get the values of the variant
          MOVE : WA_SPOOL-VARIANT TO V_VARIANT.
          SELECT * FROM TBTCP WHERE JOBNAME EQ TJOBNAME ORDER BY SDLDATE.
            MOVE TBTCP-PROGNAME TO V_REPORT.
          ENDSELECT.
          CALL FUNCTION 'RS_VARIANT_VALUES_TECH_DATA'
            EXPORTING
              REPORT                     = V_REPORT
              VARIANT                    = V_VARIANT
            SEL_TEXT                   = ' '
            MOVE_OR_WRITE              = 'W'
            SORTED                     = ' '
            EXECUTE_DIRECT             =
          IMPORTING
            TECHN_DATA                 =
            TABLES
              VARIANT_VALUES             = VVALUES
           EXCEPTIONS
             VARIANT_NON_EXISTENT       = 1
             VARIANT_OBSOLETE           = 2
             OTHERS                     = 3.
          LOOP AT VVALUES.
            CASE VVALUES-SELNAME.
              WHEN 'S_DISPO'.
               MOVE VVALUES-LOW TO V_LGORT.
                MOVE VVALUES-LOW TO V_DISPO.
            ENDCASE.
          ENDLOOP.
          SELECT SINGLE USRKEY FROM T024D INTO T024D-USRKEY WHERE WERKS EQ '1000' AND DISPO EQ V_DISPO.
          IF SY-SUBRC EQ 0.
            T_RECEIVERS-RECEIVER = T024D-USRKEY.
            T_RECEIVERS-REC_TYPE = 'U'.
            APPEND T_RECEIVERS.
          IF V_DISPO = '3'   OR V_DISPO = '5'   OR
             V_DISPO = '21'  OR V_DISPO = '48'  OR
             V_DISPO = '51'  OR V_DISPO = '231' OR
             V_DISPO = '512' OR V_DISPO = '921'.
            T_RECEIVERS-RECEIVER = 
            T_RECEIVERS-REC_TYPE = 'U'.
            T_RECEIVERS-COPY = 'X'.
            APPEND T_RECEIVERS.
          ENDIF.
          IF V_DISPO = '14'  OR V_DISPO = '86'  OR
             V_DISPO = '515' OR V_DISPO = '704' OR
             V_DISPO = '711' OR V_DISPO = '712' OR
             V_DISPO = '713'.
            T_RECEIVERS-RECEIVER =
            T_RECEIVERS-REC_TYPE = 'U'.
            T_RECEIVERS-COPY = 'X'.
            APPEND T_RECEIVERS.
          ENDIF.
           T_RECEIVERS-RECEIVER = *        T_RECEIVERS-REC_TYPE = 'U'.
           T_RECEIVERS-COPY = 'X'.
           APPEND T_RECEIVERS.
           T_RECEIVERS-RECEIVER = *        T_RECEIVERS-REC_TYPE = 'U'.
           T_RECEIVERS-BLIND_COPY = 'X'.
           APPEND T_RECEIVERS.
          ENDIF.
          IF NOT SP_LANG IS INITIAL.
            DOCUMENT_DATA-OBJ_LANGU = SP_LANG.
          ELSE.
            DOCUMENT_DATA-OBJ_LANGU = SY-LANGU.
          ENDIF.
          V_NAME = SY-UNAME.
    Subject.
    CONCATENATE 'List of Rejected Materials, MRP Controller:' WA_SPOOL-VARIANT
                INTO DOCUMENT_DATA-OBJ_DESCR.
    Send the email.
          CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
            EXPORTING
              DOCUMENT_DATA              = DOCUMENT_DATA
              SENDER_ADDRESS             = V_NAME
              SENDER_ADDRESS_TYPE        = 'B'
            TABLES
              PACKING_LIST               = PLIST
              CONTENTS_BIN               = SO_ALI
              CONTENTS_TXT               = OBJTXT
              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.
          IF SY-SUBRC <> 0.
            MESSAGE E208(00) WITH 'Error in sending email'.
          ENDIF.
          COMMIT WORK.
    Send the email immediately.
          SUBMIT RSCONN01
          WITH MODE = 'INT'
          AND RETURN.
          IF SY-SUBRC EQ 0.
            WRITE 'To get the spool no'.
            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.
            IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
            WRITE : / 'Spool id of the job that is sent', SPOOLID,
                     GD_EVENTID,
                     GD_EVENTPARM,
                     GD_EXTERNAL_PROGRAM_ACTIVE,
                     GD_JOBCOUNT,
                     GD_JOBNAME,
                     GD_STEPCOUNT.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " send_mail
    *&      Form  remove_blank_spools
          text
    -->  p1        text
    <--  p2        text
    *FORM REMOVE_BLANK_SPOOLS .
    LOOP AT ITAB_SPOOL INTO WA_SPOOL.
       MOVE WA_SPOOL-LISTIDENT TO SPOOLID.
       CALL FUNCTION 'RSPO_ISELECT_TSP01'
         EXPORTING
           RFCSYSTEM        = SY-SYSID
           RQIDENT          = SPOOLID
      FORUPDATE        = ' '
        IMPORTING
          TSP01_ELEM       = W_INFO
        EXCEPTIONS
          ERROR            = 1
          OTHERS           = 2.
       CALL FUNCTION 'RSPO_IRETURN_RAW_DATA'
         EXPORTING
           RQ                 = W_INFO
         TABLES
          LINE_BUFFER        = W_DATA
       PAGE_INDEX         = W_PAGES
          LINE_BUFFER2       =
        EXCEPTIONS
          ERROR              = 1
          OTHERS             = 2.
       IF W_INFO-RQDOCTYPE = 'LIST'.
         CALL FUNCTION 'RSPO_R_GET_TOC_SPOOLREQ'
           EXPORTING
             RQIDENT = SPOOLID
           TABLES
             TOCDESC = W_TODESC
           EXCEPTIONS
             ERROR   = 1
             OTHERS  = 2.
         CALL FUNCTION 'RSPO_SPOOLDATA_WRITE_INIT'.
         READ TABLE W_DATA WITH KEY DATA_LINE = 'List contains no data'.
         LOOP AT W_DATA.
           IF W_DATA-DATA_LINE CP 'List contains no data'.
           ENDIF.
         ENDLOOP.
       ENDIF.
    ENDLOOP.
    *ENDFORM.                    " remove_blank_spools

  • How to copy contents of console's scrollback buffer to a file?

    I already know about
    cat /dev/vcs1 > /path/to/some_file
    and
    setterm -dump 1 -file /path/to/some_file
    but these only work for what is actually on tty1's screen when the command is run (i.e., lines in the scrollback buffer do not get written to the file). I have "fbcon=scrollback:512" in grub2's kernel line, in case it matters.
    (I am trying to recreate the old /var/log/boot but, since even in quiet mode grub2 prints [FAIL] and all the [OK] messages that follow, if the [FAIL] occurs early enough it scrolls off the screen. See here:  https://bbs.archlinux.org/viewtopic.php … 1#p1439361)
    EDIT: Link fixed. Thanks for the heads up, karol.
    Last edited by bdantas (2014-07-24 20:31:46)

    in theory you could dump the contents of the scrollback, this is the pointer to it https://git.kernel.org/cgit/linux/kerne … 6-rc7#n185
    you could dump that before the console gets switched*, right before here: https://git.kernel.org/cgit/linux/kerne … 6-rc7#n846
    * e.g. when X gets started and is about to get graphical

  • How to create sqlplus output spool to a flat file  with a header record

    Hi all,
    I've requirement to spool data from a table to a flat file along with column headings in the first row.I'm getting data but I need header record in the first row also?
    Thanks,
    Mahender.

    Hi, Mahender,
    If you give this SQL*Plus command before you start SPOOLing
    SET   PAGESIZE  50000then you can get the usual SQL*Plus column headings, and they won't repeat unless you have more than 50,000 rows of output.
    When I can't do that, I use PROMPT
    {spool}
    SPOOL foo.txt
    PROMPT empno ename job mgr ...
    SELECT empno, ename, job, mgr ...
    PROMPT will trim leading whitespace (unless you enclose it in quotes), but it will leave spacing between the columns alone.
    You could also do a separate query, where you select some literals from dual:SPOOL foo.txt
    SELECT ' empno ename job mgr ...'
    FROM dual;
    SELECT empno, ename, job, mgr ...

Maybe you are looking for

  • Error Message 0x80073afc trying to open Windows Defender

      I was working on my mother's computer and somehow Windows Defender got turned off.  There is spyware all over the computer, on every website popups, ads, highlighted words that lead to websites.  I tried turning on Windows Defender, but I get this

  • Spotlight does not work

    Hi List I have a problem similar to others within here, but the fixes that have worked for others are no use with me! Recently had a hd failure, rebuilt with new drive Segate baracuda 160 Resinstalled 10.4.3 since then Spotlight just keeps searching

  • What kind of error is this

    C:\source>java Average1 Assertion failed: offset < fFileSize, file ..\..\..\..\src\share\native\sun\awt\ font\fontmanager\fontobjects\fontObject.cpp, line 240 abnormal program termination the above source code can be compiled but when i run java it o

  • Restriction of client

    HI All,       Is there possible in SAP Restriction of client. Ex:-Suppose in EID100 client only five user can can login.If Sixth user tries it will show a error message that U R not Authorize person to login. Any one help on this regards. Thanks. Sin

  • HT204406 turned off iMatch under Store in iTunes now can't turn back on?

    turned off iMatch under Store in iTunes and now can't turn back on - any ideas