Regd - Spool request

Dear all,
I have a requirement, to download the list output in PDF format. I am using the following code. This program converts the list output into spool request. But the problem is it is having number of pages is 0(We can see in SP01).
Could you please let me know the reason why it is having the number of pages is 0. It shoud show number of pages is atleast 1(since its having some data).
Please help me at the earliest.
This is the code I am using.....
TABLES :mara, makt.
TYPES: BEGIN OF t_mara,
           matnr LIKE mara-matnr,
           meins LIKE mara-meins,
           matkl like mara-matkl,
           ersda LIKE mara-ersda,
           ername LIKE mara-ernam,
      END OF t_mara.
DATA: i_mara TYPE TABLE OF t_mara,
      wa_mara LIKE LINE OF i_mara.
DATA: v_dest LIKE tsp01-rqdest,
v_handle LIKE sy-tabix,
v_spool_id LIKE tsp01-rqident,
v_rc TYPE c,
v_errmessage(100) TYPE c,
v_text(70) TYPE c,
gd_spool_nr LIKE tsp01-rqident.
START-OF-SELECTION.
  SELECT matnr FROM mara INTO TABLE i_mara
         UP TO 10 ROWS.
  CALL FUNCTION 'RSPO_OPEN_SPOOLREQUEST'
  EXPORTING
   dest = 'LOCL'
   layout = 'X_58_170'
   name =   ' LOCL'
   suffix1 =  'LOCL'
   suffix2 = 'Z_DOWNLOASUT'
   copies = '1'
   prio = '5'
  immediate_print = 'X'
AUTO_DELETE =
TITLELINE =
RECEIVER =
DIVISION =
AUTHORITY =
POSNAME =
ACTTIME =
LIFETIME = '8'
APPEND =
COVERPAGE =
codepage = '1152'
doctype = 'LIST'
  IMPORTING
  handle = v_handle
  spoolid = gd_spool_nr
  rc = v_rc
  errmessage = v_errmessage.
  LOOP AT i_mara INTO wa_mara.
    CONCATENATE wa_mara-matnr wa_mara-meins "i_mara-maktl
                wa_mara-ersda wa_mara-ername INTO v_text SEPARATED BY space.
    CALL FUNCTION 'RSPO_WRITE_SPOOLREQUEST'
    EXPORTING
    handle = v_handle
    text = v_text
LENGTH =
CODEPAGE =
TRUNCATE =
    IMPORTING
    rc = v_rc
    errmessage = v_errmessage
    EXCEPTIONS
    handle_not_valid = 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.
  ENDLOOP.
  CALL FUNCTION 'RSPO_CLOSE_SPOOLREQUEST'
    EXPORTING
      handle           = v_handle
    IMPORTING
      rc               = v_rc
      errmessage       = v_errmessage
    EXCEPTIONS
      handle_not_valid = 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.
  COMMIT WORK.
  SUBMIT rstxpdft4 WITH spoolno = gd_spool_nr
                   WITH download = 'X'
                   VIA SELECTION-SCREEN
                   AND RETURN.
Thanks And regards,
Janardhan

oK

Similar Messages

  • How I set the auto delete old spool request

    Hi
    I would like to know , how to auto delete old spool request. Have any option in SAP.
    I want spool requests on server for 3 days only.
    Pls suggest.
    Tapovardhan

    As a default background job SAP schedules<b> RSPO0041</b> program in background, this program's variant has the <b>Minimum age in days</b> value.
    Can you check with what variant this program is running. 
    This program needs to be scheduled daily with <b>Minimum age in days</b> field.
    Regds
    Manohar

  • Is it possible to have Multiple Spool requests in one batch job overview?

    Hi,
    While running one of my z program in back ground, there are two spools generated (one by write statement and one by OPEN_FORM statement and both the spools are available in SP01 Transaction), but when i see the job overview in transaction SM37, I only see one spool request (that of the last spool request). Can any body in the group please tell me is it possible to see multiple spool requests in the job overview of one Abap program and if yes, how?
    Thank you.
    Abinash

    Hi Jayanthi,
    Thank you for the link. But probably that discussion was also an unsolved one.
    Anyway, does any one in the group think that display of multiple spools per one step job is dependent on client / SAP Server setting? Because as evident from the chain of mails in the link provided by Jayanthi, some people say that they see multiple spool requests for one program in batch mode job overview (SM37)? If yes, can some body tell me the required configuration?

  • F110 - one spool request number per payment order --URGENT

    Hi folks,
      I am ABAPer working for ECC6 upgrade project when i am running F110 payment run for customers to generate payment orders i am getting all the orders in one spool request no, But i need to generate one spool request no. per payment order.
      thanks in advance for you valuble inputs
    regards,
    ramahari

    Hi Madhuri,
    Call open form write form and close form in loop so that till sales order remains in the loop the form will continue to print. In this way all sales order in internal table will print in the same spool.
    Hope this will help you.
    Regards,
    Vijay

  • How to create the multiple spool requests for a single report.

    Hi gurus,
                     I have one requirement to be completed , i need to send the out put of the report via mail in pdf format. for that what i did was, iam executing report in background and creating spool request and converting it to pdf and sending the file.
    now the problem is, its a customer ledger report, for each customer i need to create a new spool request and send mail to that particular customer, now my dought is how to create multiple spool requests for a single pro and how i need to go about it.
    And one more question is can we create a spool request for a report which is running in online.
    waiting for inputs frm gurus.

    Hello,
    As per my knowledge for creating new spool id you will have to set
    output_options-tdnewid = 'X'.
    and then using
    job_output_info-spoolids
    create a pdf using
    call function 'CONVERT_OTFSPOOLJOB_2_PDF'
    Rachana.

  • Handle not valid for open spool request

    Hello everyone,
    i am facing an error while clicking the print preview option in change PO (me22n).
    i have given the dispatch time in further data of o/p as 'Send with application own transaction'.
    now, when i save and click print preview button i get an error as
    "Handle not valid for open spool request"
    Kindly give me some idea how to tackle this.
    Thanks
    gaurav

    Gaurav,
    I am having a similar issue and would appreciate if you could let us know how your problem was solved?
    What control parameters did you change to make this work?
    Thanks,
    Jay

  • How to send as an email the spool request?

    Dear Experts,
    My last post was Email background schedule report to gmail or yahoo mail .
    I got solution but it's work as a notification which we can say the after report run it triggers mail that report is completed as this time.
    But i required the thing how to send a spool request of a report  as an email attachment.
    it will be in .xls or .pdf or xyz format.
    It was the additional task which was required by my organization.
    I also want to know the following things.
    1. what is sap default configuration and system behind it.
    2. what the things abaper have to check.
    3. what is bcs_examples & where do i found these bcs_example8.
    Please guide me to explore my knowledge.
    Thanks & regards
    Nayan Lad
    Note for moderator : Sir, I will close request at 2:30 pm today onward, so please do not lock it.
    Moderator Message: All your questions can be answered by searching.
    Edited by: kishan P on Nov 13, 2010 3:29 PM

    need solution..

  • An error occurred when processing the spool request.  (Possibly due to memory problems)

    Hi SAP,
    My backgroud job is failing with log as shown below
    Job started
    Step 001 started (program ZMRS0065, variant SUS
    Step 002 started (program ZDRS0090, variant SUS
    Step 003 started (program ZFRS0305, variant SUS
    Step 004 started (program ZFRS0300, variant SUS
    Access error
    Job cancelled after system exception ERROR_MESSAGE
    An error occurred when processing the spool request.  (Possibly due to memory problems)
    Kindly help out in this issue
    Regards
    Mohammed

    Hello Mohammed,
    Have you seen any error in your SM21 system log and developer trace of spool work process
    during that time?
    The maximum size when create spool is 2GB.Pls also check if you are creating a spool
    larger than it.
    Best Regards
    Jie Bai

  • Smartform internal_error when merging forms into 1 spool request

    Hi,
    I have 2 smartforms - a letter and a certificate. The user has the option to print either one of these forms or both, per employee. I'm using 1 spool request.
    As soon as I call the second smartform there is an INTERNAL_ERROR. Why does this happen and how do I solve the problem?
    Please refer to the code sample below:
    loop at i380.
    make sure the spool is not closed
      control_parameters-no_open = 'X'.
      control_parameters-no_close = 'X'.
      AT FIRST.
       control_parameters-no_open = ' '.  
      ENDAT.
      AT LAST.
        control_parameters-no_close = ' '.
      ENDAT.
    call smartform 1
        call function 'SSF_FUNCTION_MODULE_NAME'
             EXPORTING
                  formname           = 'ZLETTER'
             IMPORTING
                  FM_NAME            = FM_NAME
             EXCEPTIONS
                  NO_FORM            = 1
                  NO_FUNCTION_MODULE = 2
                  OTHERS             = 3.
        if sy-subrc <> 0.
          WRITE: / 'ERROR 1'.
        endif.
         CALL FUNCTION FM_NAME
                 EXPORTING
                      CONTROL_PARAMETERS = control_parameters
                      OUTPUT_OPTIONS     = output_options
                      USER_SETTINGS      = ' '
                      pernr              = i380-pernr
                 IMPORTING
                      JOB_OUTPUT_INFO    = otf_info
                 EXCEPTIONS
                      FORMATTING_ERROR   = 1
                      INTERNAL_ERROR     = 2
                      SEND_ERROR         = 3
                      USER_CANCELED      = 4
                      OTHERS             = 5.
            IF SY-SUBRC <> 0.
            endif.
    second smartform - certificate
        call function 'SSF_FUNCTION_MODULE_NAME'
             EXPORTING
                  formname           = 'ZCERTIFICATE'
             IMPORTING
                  FM_NAME            = FM_NAME2
             EXCEPTIONS
                  NO_FORM            = 1
                  NO_FUNCTION_MODULE = 2
                  OTHERS             = 3.
        if sy-subrc <> 0.
          WRITE: / 'ERROR 1'.
        endif.
         CALL FUNCTION FM_NAME2
                 EXPORTING
                      CONTROL_PARAMETERS = control_parameters
                      OUTPUT_OPTIONS     = output_options
                      USER_SETTINGS      = ' '
                      pernr              = i380-pernr
                 IMPORTING
                      JOB_OUTPUT_INFO    = otf_info
                 EXCEPTIONS
                      FORMATTING_ERROR   = 1
                     <b> INTERNAL_ERROR     = 2</b>                  SEND_ERROR         = 3
                      USER_CANCELED      = 4
                      OTHERS             = 5.
            IF SY-SUBRC <> 0.
            ENDIF.
    endloop.
    I cleared output_parameters, output_options and otf_info when calling form ZCERTIFICATE but this does not solve the problem. When ZCERTIFICATE is called seperately, there is no problem.  The forms should be printed directly without conversion to PDF.
    Your help will be appreciated.

    Hi,
    In the loop AT Last is in wrong place. May be that could be the reason for your problem. Then the second call to samrt from is will be working on a closed session.
    regards
    austin
    Message was edited by: Joseph Austin Prabhu Paulthas

  • Spool request internal error

    Dear All,
    When I am executing a report in background using tcode se38, I am not able to view the output of the report from the spool request .
    When I try to view the contents of the spool request, It simply gives a message
    as follows :
    Request 74837 in system PRD : internal error
    00000040/ in spooler.
    Please advice me on this issue.
    Thanks
    Gaurav

    hello Gaurav,
    it is coming because the columns in spool is exceeding the SAP defined limit of 255. Either you need to create a device type with columns greater than 255 or else use the OSS note: 186603. It has a simple report <b>ZRSPOSHOWLIST</b>  that you need to create in your system. I created this report and now whenever i have such errors I use it to view the spool.
    regards.
    Ruchit.

  • Write the Error log from background Job to the Spool request

    Hi ,
    I have a situation where in i need to capture the error log of a Z program which runs as a background job and write that log into the spool request. My Z program calls runs RSEINB00 program using the SUBMIT statement. When this Job fails the error log can be seen in SM37. But i need this error log to be sent in to a spool.
    I can read the error log using the BP_JOBLOG_READ FM and can also create a spool using the RSPO_SPOOL_OPEN FM.
    The problem is, when the Submit statement executes, due to internal valdation in the RSEINB00 program the program terminates. Due to this it is not able to perform the SY-SUBRC Check and thus doesn't read the log.
    Can anybody suggest me how to overcome this problem. I am attaching the code for your refernece.
    SUBMIT RSEINB00
           USING SELECTION-SET 'TEST2'
                           TO SAP-SPOOL
                           LIST NAME 'LOCL'
                           IMMEDIATELY space
                           KEEP IN SPOOL 'X'
           AND RETURN.
    <b>If sy-subrc <> 0.</b>           
                 CALL FUNCTION 'BP_JOBLOG_READ'
                  EXPORTING
                    CLIENT                      = SY-MANDT
                    JOBCOUNT                    = i_tbtco-jobcount
                    JOBLOG                      = i_tbtco-joblog
                    JOBNAME                     = i_tbtco-jobname
                   TABLES
                     JOBLOGTBL                   = l_joblog
                 IF SY-SUBRC <> 0.
                 else.
                    message i002 with l_joblog-msgv1.
                 ENDIF.
    <b>
    ENDIF.</b>
    Rgds,
    Kewal
    P.S. : any other approach to solve this problem will be appreciated too and the points will be rewarded suitably.

    If I select a job in SM37 and I click on "spool" I get a list with separate spool entries for each of the steps, e. g.
    Programmname/Kommand   Programmtyp   Spoolliste
    Z_MM_STAT_UPDATE_WERK  ABAP             1707445
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_WERK  ABAP             1707459
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_MARA  ABAP             1721423
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_WERK  ABAP             1721437
    Z_MM_STAT_UPDATE_MARA  ABAP             1721446
    Z_MM_STAT_UPDATE_WERK  ABAP             1721447
    Z_MM_STAT_UPDATE_VKORG ABAP             1721471
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_VKORG ABAP             1721521
    ZSLEEP                 Ext. Kommando
    Z_MM_STAT_UPDATE_VKORG ABAP             1721816
    It's in German but I'm sure you get the idea. For each Z_MM_STAT_UPDATE and variant I have a separate spool list that I can display.
    Markus

  • SM37 - Graphical display of spool request in Hebrew

    Hello,
    I'm running a report in background. When I look at the spool request display
    the header display in hebrew from left to right instead right to left.
    when I'm running online I don't have a problem. I enter the session in hebrew.
    does anyone have any idea ?
    thanks,
    Michal

    Useful for background
    http://www.sappoint.com/basis/bckprsng.pdf
    http://help.sap.com/saphelp_nw04/helpdata/en/6f/08703713bf277ee10000009b38f8cf/frameset.htm
    http://publib.boulder.ibm.com/infocenter/wbihelp/index.jsp?topic=/com.ibm.wbix_adapters.doc/doc/mysap4/sap4x41.htm

  • How to delete the spool request number

    HI Masters,
                My program creates a spool request. And i want to delete that spool request number? How to delete that??
                  Thanks in advance.

    hi
    good
    The program are RSPO0041 or RSPO1041.
    This is handy whenever you encounter a user who managed to create a lot of spool requests which are choking your system.
    Deleting them with SP01 will be too slow and you will get time out if it exceed the online time limit specify by your basis people.
    <b><REMOVED BY MODERATOR></b>
    thanks
    mrutyun^
    Message was edited by:
            Alvaro Tejada Galindo

  • How to print Spool requests for cheque printing sequentially

    Dear All,
    I am making vendor payments and printing cheques using F-58. It automatically creates a spool requests at the end of the transaction. When i complete all my payments and go to SP01 for viewing spool requests, the last request appears at the top of the list.
    If i select 3 consecutive requests and print them at a time, the last request gets printed first on the first cheque number and the first request gets printed on the last cheque number.
    This results in anomaly in the cheque number assigned in the system and the printed cheque as the last payment is printed on the first cheque.
    I am using dot matrix printer with  page format fixed for cheque specifications. The cheques are printed properly as per the format except the order of printing.
    Kindly let me know how to print multiple requests sequentially from the spool requests list such that the spool request number printed matches with the serial cheque numbers.
    Regards,
    SAP_2009

    Hi,
    I understod your issue.
    Whenever you posted multiple payment documents, and after that if you want to take cheque printouts sequentially by using more spool requests.........there is a way to sort out this issue.
    1) Select all of your spool requests and click on Sort in ascending Order (CtrlShiftF5) and click on Print directly (CtrlShiftF8). By doing this you will get the cheque printouts sequentially according to your payment document sequence.
    Hope this will help you
    Assign ********, if it solved your problem.
    Thanks,
    Srinu

  • Printing multiple spool requests at a time

    Hi All,
    I am using function module RSPO_OUTPUT_SPOOL_REQUEST to print the contents of the spool request. I want to print multiple spool requests at a time. We can input only one spool request number to the above function module at a time. Is there any way that I can print multiple spool requests with only single Print Popup Window ?
    Thanks.

    Hi Khanna,
    I tried that option at first place only. It results in multiple Print Popups. I want to avoid this. For all spool print requests, I want to show ONLY ONE Print Popup.
    Thanks.

Maybe you are looking for

  • The file "iTunes Library" cannot be read

    Hi I'm running a MBP with "all software up to date" including LION OS 10.7.2.  My iPhone is running 5.0.1.  Every time I try to open iTunes on the MBP I get this message: "The file "iTunes Library" cannot be read because it was created by a newer ver

  • Purchase TV to DVD

    Can I burn purchased TV programs I have bought through the iTunes Store onto DVD either to backup or to play on a DVD player?

  • Replacing Pavilion g7-2233cl HDD with SSD?

    I've got a Pavilion g7-2233cl that the HDD recently failed on, was considering switching to an SSD. I'm trying to figure out if the SSD I'm looking at is compatable with my machine. This is a link to the product on Amazon. http://www.amazon.com/SanDi

  • From Still to Video Clip

    I've brought a layered image in from Photoshop so I can move an arrow around over the background to point things out. Is there any way to actually make a video clip from this in which the arrow layer is being moved around over the background image as

  • Parsing single chars to a vector.

    I'm reading from a file, using BufferedReader. Readig a line at a time. Currently i have a StringTokenizer which breaks up the line using whitespace. How can I break up the "input" line by single chars, and how do I get the delim to work using the St