Create spool number from the report program

Hello,
I want to know the function module to create the spool request from report program, through which I can write the content of the internal table to spool.
Thanks,
Lucky

Hi Lucky ,
you will have to use 3 function modules in sucession to create a spool request as follows :
JOB_OPEN
JOB_SUBMIT
JOB_CLOSE
In case of any problem please get back to me.
Regards,
Nikhil

Similar Messages

  • How  to  crate a spool number for the abap program

    hi
    how  to  create a spool number for the abap program

    Hi,
    Check this thread
    how to create a spool requset for 'z program'.
    Regards,
    Satish

  • How to Pre fill the screen XD01/XD02, from the report program

    Hello,
    I have a requirment where i have to pass the screen values for the genral view of the tcode XD01/XD02,
    For example : In my report program i get the Name, City, Country, PIN etc.. now my requirement is that the First Screen(Genral view) of the XD01 is pre filled with all the values that are passed from the Program and the user can continue after that.
    Please suggest a way to achieve the mentioned functionality .
    Regards,
    Abhinav

    Thanks
    But the screen fields that i have to fill don't have parameter id's ..and i dont want to open the object by access key.
    also my requirement is to leave to the transaction with the filled  screen field .from the report prog...so when i use BDC i get the OK code , that i want to avoid.

  • Triggering smartform output from the report program

    Hi,
    I have developed a new report program.The selection screen of the report program is like this.
    plant:    ________
    warehouse:  ___________
    sheet #:      _________  to _________
    bay/bin:      ___________  to  __________
    building:     ___________ to __________
    counter sheet printer:  __________
    Auditor sheet printer:   _________
    When the data for sheet#,bay,building, counter sheet printer is given,then the counter sheet smartform has to be output on the screen.
    or
    When the data for sheet#,bay,building, auditor sheet printer is given,then the auditor sheet smartform has to be output on the screen.
    Is it pessible to trigger the smartform from the selection screen of the report.If so can anyone send me a sample code for that.

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = <smartform name>
        IMPORTING
          fm_name            = v_form_fm
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
    Call Smartfrom to print the document
    CALL FUNCTION v_form_fm
        EXPORTING
          p_compensation   = p_comp  <--parameter list
          p_skill          =         p_skill
          p_deci_auhtority = p_da
        TABLES
          s_job            = s_job         <--select option list
          s_level          = s_level
          s_date           = s_date
            EXCEPTIONS
          formatting_error = 1
          internal_error   = 2
          send_error       = 3
          user_canceled    = 4
          OTHERS           = 5.
    declare the paramters of your selection screen in the form interface section of the smartform.
    If you have a parameter in teh selection screen then declare it in the smartform as:
    P_matnr     TYPE     matnr (in form interface -     
                                                     >import)
    If you have a select option then
    S_LEVEL     LIKE  <dictionary structure like a range>
    this u declare it in the tables section of the form interface. For the select option , the dictionary sructures should be like a range (see RNGE_OBJID as an example). If you dont have a dictionary structure
    then u need to declare it in the dictionary.
    REWARD IF HELPFUL

  • Create a url from a report program

    Hi All,
    Could anyone please suggest me how do i generate a url from a report program. I need to use this generated url then, as a link in an excel sheet.
    Thanks in advance,
    Warm Regards,
    Preethi.

    Hi Preethi,
    REPORT  ZAZUURL                                 .
    DATA: BEGIN OF URL_TABLE OCCURS 10,
    L(25),
    END OF URL_TABLE.
    URL_TABLE-L = 'http://www.lycos.com'.APPEND URL_TABLE.
    URL_TABLE-L = 'http://www.hotbot.com'.APPEND URL_TABLE.
    URL_TABLE-L = 'http://www.sap.com'.APPEND URL_TABLE.
    LOOP AT URL_TABLE.
      SKIP. FORMAT INTENSIFIED OFF.
      WRITE: / 'Single click on '.
      FORMAT HOTSPOT ON.FORMAT INTENSIFIED ON.
      WRITE: URL_TABLE. HIDE URL_TABLE.
      FORMAT HOTSPOT OFF.FORMAT INTENSIFIED OFF.
      WRITE: 'to go to', URL_TABLE.
    ENDLOOP.
    CLEAR URL_TABLE.
    AT LINE-SELECTION.
    IF NOT URL_TABLE IS INITIAL.
      CALL FUNCTION 'WS_EXECUTE'
           EXPORTING
                program = 'C:\Program Files\Internet Explorer\IEXPLORE.EXE'
                commandline     = URL_TABLE
                INFORM         = ''
              EXCEPTIONS
                PROG_NOT_FOUND = 1.
      IF SY-SUBRC <> 0.
         WRITE:/ 'Cannot find program to open Internet'.
      ENDIF.
    ENDIF.
    <b>Regards,
    Azhar</b>

  • How to create spool in an online report

    Hi All,
    I have a requirement where the ALV report output has customers and details related to it.For example My report output has three customers(with a check box against it) and each customer has 5 line items.The user will select first and the last customer and press a push button provided.Once he clicks this push button, I should get the customers which are selected by the users and the line items related to this customers.I am able to capture all this.Now the real problem here is that I have to create a pdf document for each customer along with line items and send it as an email.In effect, in this scenario I have to create two pdf documents since the user has selected two customers on the output screen and send it to the email of that particular customer.Is there any FM available to create spool in the background for each of these customers(along with line items data) and make use of this spool number to generate a pdf document using CONVERT_ABAPSPOOLJOB_2_PDF.Once I get this I can send the email.
    Please help!
    Thanks in advance
    Sandeep

    The following steps shows how to download the output data in to PDF.
    1.Provide Spool Parameters using following function module 'GET_PRINT_PARAMETERS'.
    --This function module will provide the print parameters for creating the output in the spool; the required parameters are passed to the ‘OUT_PARAMETERS’ import parameter.
    2.Submit the report to generate the output in the spool.
    SUBMIT (sy-repid) TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                         SPOOL PARAMETERS wa_mstr_print_parms
                         WITH SELECTION-TABLE  i_int_tab
                         AND RETURN.
    --Submit the report to generate the output in the spool as i_int_table is an internal table with structure RSPARAMS. As variant allows you to set the names and contents of the parameter and selection options dynamically at runtime, we need to use the function module RS_REFRESH_FROM_SELECTOPTIONS to read the contents of the parameters and selection options of the current program into an internal table i_int_table with the structure RSPARAMS and pass that internal table in above manner.
    3.To Find the spool number from the table TSP01
    Data: l_rq2name LIKE tsp01-rq2name.
    *Concatenate the report and User name as per the value available in the table   
    TSP01.
      CONCATENATE f_repid+0(9)
                  f_uname+0(3)
        INTO l_rq2name.
    *Fetch the most recent spool from the TSP01 table
      SELECT * FROM tsp01 WHERE  rq2name = l_rq2name
      ORDER BY rqcretime DESCENDING.
        l_rqident = tsp01-rqident.
        EXIT.
      ENDSELECT.
    4.Convert Spool to PDF using the FM : CONVERT_ABAPSPOOLJOB_2_PDF.
    5.Download to local file by using the FM : DOWNLOAD
    This function module returns an internal table data_tab contains the PDF formatted output.
    Using above points your can create the output in the PDF from there you can send the email.
    Hope your reqirement can met using the above five points.
    Reward points please
    Thanks,
    Ravi Kanth

  • How to get the spool id or how to create a spool id for the report .

    hi,
    how to get the spool id or how to create a spool id for the report .
    this spool id i have to use it in CONVERT_ABAPSPOOLJOB_2_PDF fm to get the pdf download file.
    my requirement is to download a pdf file from the alv grid list.

    Hi Raghu,
    Execute this program.
    REPORT  ZTEST_3318                              .
    tables: usr01.
    perform send_report_to_spool.
    *&      Form  send_report_to_spool
          text
    form send_report_to_spool.
      data: loc_dest like pri_params-pdest,
            wf_listname type char12,
            wf_listtext like PRI_PARAMS-PRTXT,
            wf_copies type i,
            wf_days type i,
            wf_PARAMS LIKE PRI_PARAMS,     " achieving file PRI_PARAMS.
            wf_valid type c.
      clear : wf_listname , loc_dest , wf_listtext .
      move: 'AP interface' to   wf_listname .
      move: 'AP interface' to   wf_listtext .
    select single spld into usr01-spld from usr01 where bname eq sy-uname .
      if sy-subrc eq 0 .
        move: usr01-spld to loc_dest .
      endif .
      call function 'GET_PRINT_PARAMETERS'
        EXPORTING
          destination    = loc_dest
          copies         = 1
          list_name      = wf_listname
          list_text      = wf_listtext
          immediately    = ' '
          release        = ' '
          new_list_id    = 'X'
          expiration     = 1
          line_size      = 200
          line_count     = 65
          layout         = 'X_65_200'
          sap_cover_page = 'X'
          receiver       = 'SAP*'
          department     = ''
          no_dialog      = 'X'
        IMPORTING
          out_parameters = wf_params
          valid          = wf_valid.
      if wf_valid <> space.
        new-page print on parameters wf_params no dialog.
        perform write_summary .
        new-page print off.
      endif .
    endform.                    "send_report_to_spool
    *&      Form  write_summary
          text
    -->  p1        text
    <--  p2        text
    FORM write_summary .
    data: begin of itab occurs 0,
          matnr type matnr,
          end of itab.
    select matnr
           from mara
           into table itab
           up to 10 rows.
    loop at itab.
    write: / itab-matnr.
    endloop.
    ENDFORM.                    " write_summary
    This will create spool in SP01.What data you want to put in Spool write it in form write_summary.I have done coding for testing purpose
    After that use that spool for your purpose.
    If Useful award point

  • Delete the internal sessions created in the report program

    Hi,
    I have problem when a user defined transaction is called for many times from a report program. My program uses call transaction method to call a user-defined transaction for many times, i get a error like 'Maximum number of internal sessions reached' when the number of  internal sessions created exceeds 6 . Please let me know whether there is any way to close/delete the previous internal sessions that are created through the program.
    Please help me to solve this problem.
    Thanks in Advance,
    Prabavathi

    Hi prabhavathi,
    1. If a new window is opened then, by default, we can have atmost
        six sessions.
      (This can be increased by basis team)
    2. I just tried, from a program, 
       using call transaction 10 times.
      But the first one is executed, and when we come out of it,
      only then the second one gets executed.
      Its remaining in only one window/session.
    regards,
    amit m.

  • Getting data from table control to the report program.

    Hi,
    I created a table control using report program and i am trying to enter data in the table control which i want to update in the DB table. How can i get the data entered in table control to the report program, so that i can update the DB table.
    Please help me finding out which variable will hold the data entered in table control(dynamically).

    hi,
    in your table control you give some name to that table control say it_cntrl.
    this only serves as the internal table to process the table control data.
    like u can write like this.
    loop at it_cntrl into wa_cntrl.   "wa_cntrl is work area of type it_cntrl table type
    .........        "do your functining
    end loop.
    any clarification get in touch
    thnks

  • Standard program to fetch the article number from the EAN

    Hi all,
    Is there any standard report, that retrieves the article number from the EAN provided. I don't require a function module which satisfies this requirement.
    Kindly provide your valuable inputs.
    Thanks & Regards,
    Revathi.

    Here is code that can fetch any site.
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    public class fetchresult extends Frame implements ActionListener{
         TextField t1;
         TextArea ta;
         Button b1;
         public fetchresult(){
              super("Fetch Result");
              t1=new TextField("http://www.sitename.com",20);
              b1=new Button("Get");
              ta=new TextArea("",20,80);
              setLayout(new FlowLayout());
              add(t1);
              add(b1);
              b1.addActionListener(this);
              add(ta);
              setSize(200,200);
              setVisible(true);
         public void actionPerformed(ActionEvent e)
              try
              String s = t1.getText();
              URL u = new URL(s);
              URLConnection uc = u.openConnection();
              InputStream is = uc.getInputStream();
              BufferedReader rd = new BufferedReader(new InputStreamReader(is));
              String str;
              while((str = rd.readLine()) !=null){
                   ta.append(str);
                   ta.append("\n");
              rd.close();
              int available = is.available();
              int z;char c;
              for(int x=0;x<available;x++){
                   z=is.read();
                   c=(char)z;
                   ta.append(String.valueOf(c));
              catch(Exception ee){ta.append(ee.toString());}
         public static void main(String args[]){
              fetchresult obj = new fetchresult();
    Manu

  • I have the latest version of Itunes downloaded and installed to my computer.  I have a music library already created for my replaced Ipod Nano.  I've just purchased a new Nano.  When I try to access the Itunes store from the Itunes program, it gets hung u

    I have tried uninstalling and reinstalling Itunes, but it still gets hung up when trying to access the Itunes Store from the Itunes program.
    I've been unable to register the new Nano or sync it with my library.

    Many thanks.
    With those symptoms, I'd try the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store
    (If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.)

  • XML Report completes with error due to REP-271504897:  Unable to retrieve a string from the Report Builder message file.

    We are in the middle of testing our R12 Upgrade.  I am getting this error from the invoice XML-based report that we are using in R12. (based on log).  Only for a specific invoice number that this error is appearing.  The trace is not showing me anything.  I don't know how to proceed on how to debug where the error is coming from and how to fix this.  I found a patch 8339196 that shows exactly the same error number but however, I have to reproduce the error in another test instance before we apply the patch.  I created exactly the same order and interface to AR and it doesnt generate an error.  I even copied the order and interface to AR and it doesn't complete with error.  It is only for this particular invoice that is having an issue and I need to get the root cause as to why.  Please help.  I appreciate what you all can contribute to identify and fix our issue.  We have not faced this issue in R11i that we are maintaining right now for the same program which has been running for sometime.  However, after the upgrade for this particular data that the user has created, it is throwing this error REP-271504897.
    MSG-00100: DEBUG:  Get_Country_Description Return value:
    MSG-00100: DEBUG:  Get_Country_Description Return value:
    REP-0002: Unable to retrieve a string from the Report Builder message file.
    REP-271504897:
    REP-0069: Internal error
    REP-57054: In-process job terminated:Terminated with error:
    REP-271504897: MSG-00100: DEBUG:  BeforeReport_Trigger +
    MSG-00100: DEBUG:  AfterParam_Procs.Populate_Printing_Option
    MSG-00100: DEBUG:  AfterParam_Procs.Populate_Tax_Printing_Option
    MSG-00100: DEBUG:  BeforeReport_Trigger.Get_Message_Details
    MSG-00100: DEBUG:  BeforeReport_Trigger.Get_Org_Profile.
    MSG-00100: DEBUG:  Organization Id:  117
    MSG-00100: DEBUG:  BeforeReport_Trigger.Build_Where_Clause
    MSG-00100: DEBUG:  P_Choi
    Report Builder: Release 10.1.2.3.0 - Production on Tue Jul 23 09:56:46 2013
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.

    Hi,
    Check on this note also : Purchasing Reports Fail When Changing Output To XML REP-0002 REP-271504897 REP-57054 (Doc ID 1452608.1)
    If you cant reproduce the issue on other instance, apply the patch on the test instance and verify all the funcionality related to the patch works OK. Then move the patch to production. Or you can clone the prod environment to test the patch.
    Regards,

  • Getting the variant name when the report program is run in background

    Hi All,
    How to get the variant name for the report program when run in background? My requirement is to create an email attachement with the name 'variant.XLS', where variant = selection screen variant, when the report program is run in background. The system field SY-SLSET holds the variant name only when run online.
    Any pointers to this will be highly appreciated.
    Thanks and regards,
    Nilesh.

    Hello Nilesh,
    Please find the algo:
    1. Call the FM: GET_JOB_RUNTIME_INFO to get the background job details.
    2. Select data from TBTCP using these details:
    DATA:
    FP_EVENTID   TYPE BTCEVENTID
    FP_EVTPARM   TYPE BTCEVTPARM
    FP_ACTIVE    TYPE BTCXPGFLAG
    FP_JOBCNT    TYPE BTCJOBCNT
    FP_JOBNM     TYPE BTCJOB
    FP_STEPCNT   TYPE BTCSTEPCNT.
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
        IMPORTING
          EVENTID                 = FP_EVENTID
          EVENTPARM               = FP_EVTPARM
          EXTERNAL_PROGRAM_ACTIVE = FP_ACTIVE
          JOBCOUNT                = FP_JOBCNT
          JOBNAME                 = FP_JOBNM
          STEPCOUNT               = FP_STEPCNT
        EXCEPTIONS
          NO_RUNTIME_INFO         = 1
          OTHERS                  = 2.
      IF SY-SUBRC <> 0.
    *   Error calling FM: GET_JOB_RUNTIME_INFO
      ENDIF.
    DATA: FP_VARIANT TYPE BTCVARIANT.
      SELECT JOBNAME JOBCOUNT STEPCOUNT VARIANT
      FROM   TBTCP
      INTO TABLE L_IT_TBTCP
      WHERE  JOBNAME   = FP_JOBNM
      AND    JOBCOUNT  = FP_JOBCNT
      AND    STEPCOUNT = FP_STEPCNT.
      IF SY-SUBRC = 0.
        SORT L_IT_TBTCP BY JOBNM JOBCNT STEPCNT.
        READ TABLE L_IT_TBTCP INTO L_WA_TBTCP INDEX 1.
        IF SY-SUBRC = 0.
          FP_VARIANT = L_WA_TBTCP-VARIANT.
        ENDIF.
      ENDIF.
    Hope this helps.
    BR,
    Suhas

  • There is no email program associated to perform the requested action. Please install an email program or, if one is already installed, create an association in the Default programs control panel

    I just installed Window 7 professional in place of Windows 7 Ultimate RC to which I subscribed. I was not pleased to do a clean install as opposed to an upgrade and was not informed about it.
    When I reinstalled Office 2007, my outlook does not work, although exchange on the web works. I get the following error message:
    There is no email program associated to perform the requested action. Please install an email program or, if one is already installed, create an association in the Default programs control panel 

    Louis,
    This issue may occur if the Outlook registry key is corrupted. When other programs try to use the Outlook Simple MAPI interface, they cannot retrieve the required information from the registry.
    You must first remove the corrupted Outlook registry key, and then perform a Detect and Repair operation to have Outlook rebuild the key. To do this, follow these steps:
    Click Start, and then click Run.
    In the Open box, type regedit, and then press ENTER.
    In Registry Editor, locate the following subkey in the registry: HKEY_LOCAL_MACHINE\Software\Clients\Mail\Microsoft Outlook
    Select the subkey, and then press DELETE.
    Click Yes.
    Quit Registry Editor.
    Start Outlook.
    On the Help menu, click Office Diagnostics.
    Follow the instructions on the screen to complete the repair.
    Important: Above section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
    322756  (http://support.microsoft.com/kb/322756/ ) How to back up and restore the registry in Windows.
    Hope above information helps.
    Pooja Katiyar

  • Vaue of sy-tcode when executing the report program in the background

    Hello All,
    To test and find out the value of sy-tcode when the report program is exectued in the background. I have done the below steps.
    1. created a report program with the code given below.
    Select option was just defiend to get the selection screen. it is of no use.
    Select-options: s_name for sy-uname.
    Write:/ sy-uname,sy-tcode.
    2. then I created a transaction for the program to identify whether the value of sy-tcode explicitly.
    3. Then I launched the transaction and in the selection screen of the program I selected the option of executing the program in the backgroung and i process the job immediately.
    4 . In the spool I am able to see the correct sy-uname value but not the sy-tcode.
    Where as if i am executing it in the foregroung it is giving the correct value of sy-uname and sy-tcode.
    Can anybody provide me the reason as to why this is happening . that is in the backgound mode the value of sy-tcode is getting cleared.
    Thanks,
    Mohit

    Hello,
    As they say it is an SAP standard behavior, you can "hardcode" the transaction itself into the ABAP code...
    ie:
    if sy-batch eq 'X' "->IT MEANS THAT IT IS A BACKGROUND JOB.
    w_tcode = 'Z*****'.
    else.
    endif.
    bYE!!
    Gabriel P.-

Maybe you are looking for

  • Only one device at a time.....

    If my main machine is downloading an update or watching tv over the network it takes all the bandwidth stopping any other wi-fi device from connecting.  The only wi-fi connections I have in my home are Main Machine, Printer, Wii, Another Laptop and a

  • Screen changes using Radio-button

    Hi All There are 3 blocks on Sel-screen. Before that I want 1 more screen which has 3 RB's & depanding on RB's these blocks will be displayed. I have to display all 3blocks depanding on RB but some fields are diff in diff blocks. Any sample code for

  • How to configure the Access point 1602 that I just purchased

    Hi Everyone, Hope you can help. I just purchased a AIR-SAP1602I-A-K9 from one internet vendor. Along with it I also purchased an power injector. I tried to use it as a standalone AP. It does not come with any instruction and I am not good at Wifi con

  • For SU01 automatically addition of field extension with  "0" in child system

    Hi Ids and roles are created through CUA and then it is distributed in the child systems. However in one of the child system, the users are automatically assigned a value 0 in extension field of SU01. This is then not allowing the program RSEOUT01 to

  • Passing multiple parameter to where condition

    Hi all, I want to pass multiple parameters to where condition.. it is as follows: i'll pass only TODAY date to M_DATE_TO variable. CURSOR C_COUNT(M_DATE_FROM  DATE, M_DATE_TO  DATE) IS SELECT COUNT (*) FROM table_name WHERE   TRUNC(table_name.join_da