Printing Parameters on reports

Post Author: n8than1
CA Forum: Publishing
Hello,
I'm new to CR and I've created a report that has some parameters the user can select.  How can I get these parameters to print on the report?  If I drag/drop the parameter field it only shows the first item in the parameter the user selected. 
I'm using the CR XI R2

Post Author: Chris_W
CA Forum: Publishing
So you have set the 'Allow Multiple Values' setting to True on the parameter?

Similar Messages

  • Supress Background Print parameters when user executes ALV report by F9

    Hi friends,
         How can we Supress Background Print parameters pop-up, when user executes ALV report by F9
    or by navigation from selection screen -i.e;  Program ->>Execute in Background.
    Please guide me
    Thanks in Advance,
    Ganesh

    Sorry,
    i need to supress the POP-UP which asks for background Print Parameters in the ALV report. when i press F9 in a selection - screen of a Tcode
    as we supress Pop-up for a smartform or script by passing the Print Parameters
    This 'RS_SET_SELSCREEN_STATUS' excludes the commands(say F9 function code) in report
    I think we need to set the Print paramters in the Program
    please guide me
    Thanks,
    Ganesh

  • Print selection parameters en reports, lists

    Hi gurus,
    We need print reports, lists with selection parameters used in execution. For example, transaction VCUST. In this moment, system only prints the table with values.
    Any idea???
    Thank you!!!
    I will reward points all answers!

    Hi daniel
    May be these inputs will help you
    SP01 - To generate the spool request
    SPAD - Where Print parameters are set (here you can include network printer into SAP system)
    VSHP1 - to maintain print parameters
    Regards
    Srinath

  • HELP to Open and Print automatic a REPORT

    Hello, I'm a Portuguese Developer, and i've a challenge, that is, i want to open REPORT by FORMS in RDF format and i want to open and print automatic way, i do not want to open, and then have to go print button to pint them.
    I want to open by FORM way and print automatic and close imediatly.
    HEP ME PLEASE!
    Thank you

    Aslam o Alikum (Hi)
    Ofcourse you can do this by specifing system parameters like DESTYPE=Printer and DESNAME=PrinterName
    Replace PrinterName with you printer name
    See System Parameters in Reports Under Data Model

  • How to print directly to Printer from Crystal Report Viewer ?

    Hi All,
    We are integrating our Java Web Application with Crystal report XI, currently using JRC and export to PDF for user to preview and print to local printer.
    Now there is new requirement :
    Some clients is using thin client terminal (no harddisk, only has OS +Browser in ROM), so I cannot install Acrobat Reader for them to preview&print the report.
    So I am looking at  Crystal Report Viewer, the question is : Can I print from Crystal Report Viewer directly to local printer without first converting it to PDF (because I can't have acrobat reader installed) ??
    Thank you very much,
    Krist
    Indonesia

    Hi,
    It can't be achieved through XI.
    JRCXI R2 SDK offers the ability to print the report server side
    using the PrintOutputController using printReport(PrintReportOptions printReportOptions) method.
    Here is the code(for XIR2):
    import="com.crystaldecisions.reports.sdk.*"
    import="com.crystaldecisions.sdk.occa.report.lib.*"
    import="com.crystaldecisions.sdk.occa.report.document.*"
    try {
    final String REPORT_NAME = "Inventory.rpt";
    ReportClientDocument reportClientDoc = new ReportClientDocument();
    reportClientDoc.open(REPORT_NAME, 0);
    //Create and set print options.
    PrintReportOptions printOptions = new PrintReportOptions();
    //Note: Printer with the 'printer name' below must already be configured.
    printOptions.setPrinterName("
    10.10.45.220
    BOBJ 2C");
    printOptions.setJobTitle("Sample Print Job from JRC.");
    printOptions.setPrinterDuplex(PrinterDuplex.horizontal);
    printOptions.setPaperSource(PaperSource.auto);
    printOptions.setPaperSize(PaperSize.paperLetter);
    printOptions.setNumberOfCopies(1);
    printOptions.setCollated(false);
    PrintReportOptions.PageRange printPageRange = new PrintReportOptions.PageRange(1,1);
    printOptions.addPrinterPageRange(printPageRange);
    //NOTE: If parameters or database login credentials are required, they need to be set before.
    //calling the printReport() method of the PrintOutputController.
    reportClientDoc.getPrintOutputController().printReport(printOptions);
    reportClientDoc.close();
    out.println("Successfully sent report to the printer.");
    catch(ReportSDKException ex) {     
         out.println(ex);
    Please revert in case you have any query.
    Thanks,
    Neeraj

  • RSPC Variant does not exist - Could not find or load print parameters

    We are on BI 7.0 (support pack SAPKW70017).  We recently freshed test system from production.   After the refresh, we have problems opening all the process chains.  
    1. When I go to RSPC to open a process chain, I get many messages like this:
    Variant &0000000067180 does not exist (there are different variant numbers)
    Message no. DB612
    Diagnosis
    You selected variant &0000000067180 for program RSPROCESS.
    This variant does not exist.
    2. When I go to SM21 to check the system log, it displays many entries like below:
    EJ  F Could not find or load print parameters for step 1, job BI_PROCESS_TRIGGER/09134500
    Documentation for system log message EJ F :                                                                               
    An error occurred during loading of the print parameters for a        
    background job step.                                                  
    The print parameter record may have been deleted even though there was
    a still a step that needed that data. This is an error as the         
    reorganization of the print parameters should prevent this from       
    happening.                                                            
    To fix the problem, edit the step and save it, copy the job, or       
    schedule a new job. The print parameters will be regenerated in all   
    these cases.    
    3. I applied the OSS note 1169659 - Correction: Process variants not entered by BDLS.   The Basis rerun BDLS.  But it did not fix the problem.
    Would appreciate if someone could provide any help.
    Thank you.

    Hi Rebecca.
    1) Please verify if exist process types called 'unknown job'. If exist:  delete process types called 'unknown job' in your process chain. To do that please remove the chain from scheduling (menu bar > process chain > remove from schedule), afterwards switch the detail view on (menu bar >  view) > right mouse click on the process type "unknown job" > displaying scheduled jobs > delete that job. After deletion of the 'unknown jobs' activate and schedule your process chain again.
    2) After the removal of the 'unknown jobs' please check if the error messages with the missing variants pop up when calling your process chain disappears. If not, please implement and execute the attached report Z_FIND_JOBS_WITHOUT_VARIANT which deletes the jobs without variants.
    I have already attached report as Report Z_FIND_JOBS_WITHOUT_VARIANT, you can download and create the report accordingly.
    = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    REPORT  Z_FIND_JOBS_WITHOUT_VARIANT.
    data: l_t_job type table of tbtcp with header line,
          l_s_varsel    TYPE rsvar,
          l_t_variant   TYPE TABLE OF rsparams.
    parameters: delete type rs_bool.
    select * from tbtcp as job into table l_t_job
                        where progname = 'RSPROCESS'
                        and   exists ( select * from tbtco
                              where jobname = job~jobname
                              and   jobcount = job~jobcount
                              and   status = 'S' ).
    loop at l_t_job.
      l_s_varsel-report  = l_t_job-progname.
      l_s_varsel-variant = l_t_job-variant.
      CALL FUNCTION 'RS_VARIANT_CONTENTS'
        EXPORTING
          report               = l_s_varsel-report
          variant              = l_s_varsel-variant
          execute_direct       = 'X'
        TABLES
          valutab              = l_t_variant
        EXCEPTIONS
          variant_non_existent = 1
          variant_obsolete     = 2
          OTHERS               = 3.
      if sy-subrc <> 0.
        write: / l_t_job-jobname, l_t_job-jobcount.
        if delete = 'X'.
          CALL FUNCTION 'BP_JOB_DELETE'
            EXPORTING
              JOBCOUNT = l_t_job-jobcount
              JOBNAME  = l_t_job-jobname
            EXCEPTIONS
              OTHERS   = 1.
          IF SY-SUBRC <> 0.
            write 'not deleted'.
          else.
            write 'successfully deleted'.
          ENDIF.
        endif.
      endif.
    endloop.
    = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    I hope I can be helpful.
    Thanks,
    Walter Oliveira.

  • ARIA Employee Directory -How to Print Multiple Direct Report On a page

    This question goes out to the experts. If we have person that has 10,15 or a large number of direct reports how can we print them on to a page so that they all fit. I am okay if they fall to another line just need to get them all on one page rather than multiple because they fall outside the print parameters?
    All help in this area would be greatly apprecaited
    Steve

    Maybe. Keep in mind HTML was never made for print. It's quite possibly the worst medium you could choose for print. You won't be able to establish page breaks or even draw consistent boxes. In short, I estimate the probability of success in creating an org chart with an HTML template to be somewhere around 1%. I just don't want to see you spend an absurd number of hours trying to build something that's really not possible.
    With that said, here are a few options to consider:
    - Microsoft Word and Visio both have Org Chart functionality, though I'm not sure if you can populate it with data from a database. This would be an offline solution wherein one of the developers would, on a periodic basis, generate a new version of the org chart, export it to PDF, then post it as a static file.
    - Oracle BI Publisher supports Word shapes for templates, including Org Charts per this documentation:
    http://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e12187/T421739T481157.htm#T481174
    though I think it might take effort to get the template to work. At least the output medium (PDF or RTF) is made for print.
    - GraphViz (http://www.graphviz.org) is the most promising online solution I can think of. It's a command-line tool, so you would need to
    -- generate the data in a file and output that to the file system of the database server (UTL_FILE)
    -- call the command-line utility via a dbms_scheduler job, since you need call an OS utility from inside the database
    -- provide a link to the output of graphviz.
    Take a look at this image, then click on it to see the code that generated it, since that's essentially the format you'll need to output:
    http://www.graphviz.org/Gallery/directed/unix.html
    There's my 2 cents. If someone is asking you to do this all in HTML, please send them a link to this post.
    Tyler

  • Error WHen trying to print a crystal report

    I am trying to print a system crystal report and it is giving me the following error: "Error during printing; ensure all parameters are defined". And it prints the first page, but none of the consecutive pages if there are more than 1. Is there some type of setting that needs to be set for printing?

    Hmmmmm it says "page range" ALL. I was able to print fine until I created a new layout and saved it. THen I went to print it and got the error. But it seems I get the error when I print any crystal report in any DB. Is this a setting in crystal, SAP, or printer itself? I can print the second page if I toggle through to the second page on the crystal report view, and go to print, and put 2 next to pages feild. Otherwise it is set to print ALL, however it is not doing that.

  • Print List Processing Report to PDF

    hi all,
    i've read many forums about convert info into PDF. but i'm very new to understand those forums.
    In case I want to print list processing report as PDF (not hard copy thru printer). First, user types the data on the screen then click on 'Execute' button, then the system shows the result on screen. After that user asks system for print the screen on menu bar by List=>Print.
    So please advise me how to get the spool id, then export as pdf. As my opinion, i may use CONVERT_ABAPSPOOLJOB_2_PDF and GUI_DOWNLOAD. But where is the place I should put the methods on?
    Thanks in advance.
    Peerasit

    Hi,
    Go through The simple Anallise this program.
    report zabap_2_pdf.
    *-- Enhancements: only allow to be run with variant.  Then called
    *-- program will be transparent to users
    *-- TABLES
    tables:
      tsp01.
    *-- STRUCTURES
    data:
      mstr_print_parms like pri_params,
      mc_valid(1)      type c,
      mi_bytecount     type i,
      mi_length        type i,
      mi_rqident       like tsp01-rqident.
    *-- INTERNAL TABLES
    data:
      mtab_pdf    like tline occurs 0 with header line,
      mc_filename like rlgrap-filename.
    *-- SELECTION SCREEN
    parameters:
      p_repid like sy-repid, " Report to execute
      p_linsz like sy-linsz default 132, " Line size
      p_paart like sy-paart default 'X_65_132'.  " Paper Format
    start-of-selection.
    concatenate 'c:\'
                p_repid
                '.pdf'
      into mc_filename.
    *-- Setup the Print Parmaters
      call function 'GET_PRINT_PARAMETERS'
       exporting
         authority= space
         copies   = '1'
         cover_page                   = space
         data_set = space
         department                   = space
         destination                  = space
         expiration                   = '1'
         immediately                  = space
         in_archive_parameters        = space
         in_parameters                = space
         layout   = space
         mode     = space
         new_list_id                  = 'X'
         no_dialog= 'X'
         user     = sy-uname
       importing
         out_parameters               = mstr_print_parms
         valid    = mc_valid
       exceptions
         archive_info_not_found       = 1
         invalid_print_params         = 2
         invalid_archive_params       = 3
         others   = 4.
    *-- Make sure that a printer destination has been set up
    *-- If this is not done the PDF function module ABENDS
      if mstr_print_parms-pdest = space.
        mstr_print_parms-pdest = 'LOCL'.
      endif.
    *-- Explicitly set line width, and output format so that
    *-- the PDF conversion comes out OK
      mstr_print_parms-linsz = p_linsz.
      mstr_print_parms-paart = p_paart.
      submit (p_repid) to sap-spool without spool dynpro
                       spool parameters mstr_print_parms
                       via selection-screen
                       and return.
    *-- Find out what the spool number is that was just created
      perform get_spool_number using sy-repid
                 sy-uname
        changing mi_rqident.
    *-- Convert Spool to PDF
      call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
        exporting
          src_spoolid= mi_rqident
          no_dialog  = space
          dst_device = mstr_print_parms-pdest
        importing
          pdf_bytecount                  = mi_bytecount
        tables
          pdf        = mtab_pdf
        exceptions
          err_no_abap_spooljob           = 1
          err_no_spooljob                = 2
          err_no_permission              = 3
          err_conv_not_possible          = 4
          err_bad_destdevice             = 5
          user_cancelled                 = 6
          err_spoolerror                 = 7
          err_temseerror                 = 8
          err_btcjob_open_failed         = 9
          err_btcjob_submit_failed       = 10
          err_btcjob_close_failed        = 11
          others     = 12.
    call function 'DOWNLOAD'
         exporting
              bin_filesize            = mi_bytecount
              filename                = mc_filename
              filetype                = 'BIN'
         importing
              act_filename            = mc_filename
         tables
              data_tab                = mtab_pdf.
          FORM get_spool_number *
          Get the most recent spool created by user/report              *
    -->  F_REPID               *
    -->  F_UNAME               *
    -->  F_RQIDENT             *
    form get_spool_number using f_repid
         f_uname
                    changing f_rqident.
      data:
        lc_rq2name like tsp01-rq2name.
      concatenate f_repid+0(8)
                  f_uname+0(3)
        into lc_rq2name separated by '_'.
      select * from tsp01 where  rq2name = lc_rq2name
      order by rqcretime descending.
        f_rqident = tsp01-rqident.
        exit.
      endselect.
      if sy-subrc ne 0.
        clear f_rqident.
      endif.
    endform." get_spool_number
    Regards
    swamy

  • Printing a Web Report Using Firefox Results in Lost Session Variables

    Post Author: AVXFlyer
    CA Forum: .NET
    I'm  having a problem with Firefox users printing a Crystal Report from a web site. 
    The first page of the web site collects information to be used in the report generation, for example, start date, end date, type of report etc.  These are all various text boxes, drop down lists, radio buttons and check boxes.  When the user clicks to show the report, everything works fine and the first page of the report will display. The code behind this page takes care of saving al the session variables into hidden fields on the page so the settings will be accessible when the user clicks to view the next page of the report.
    On clicking to view the next page of the report, everything is still fine and the process works beautifully and I've had no problems. 
    A new problem has surfaced during the printing of these reports.  Users who use IE6.0 or IE 7.0 do not have a problem, however, users who use Firefox do have a problem.
    It seems that the print dialog which appears as part of the the Crystal web control manages to 'lose" the variables which were present on the calling page.  It only does this with the Firefox browser.  Calls on postback to retrieve the variables from the hidden fields result in 0's or empty strings ("").
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init .... ....  If Me.IsPostBack = False Then ... ...        strDiscontinuedOnly = Request.Form.Item("ddlInvStatus")             If strDiscontinuedOnly = Nothing Then                 isDiscontinuedOnly = False             Else                 Select Case strDiscontinuedOnly                     Case 0 'All Inventory                         isDiscontinuedOnly = False                     Case 1 'Discontinued Inventory                         isDiscontinuedOnly = True                     Case 2 'Active Inventory                         isDiscontinuedOnly = False                 End Select             End If Else 'Postback is true             intRequestedReport = Request.Form.Item("fldReportID")             strDiscontinuedOnly = Request.Form.Item("fldInvDiscItemsOnly")             isDiscontinuedOnly = Request.Form.Item("fldInvDiscItemsOnly") ... ... end if

    Can't explain it, but here are a few tests;
    1) Try to print a saved data report
    2) Try to print a report that is not using parameters
    3) Try a different printer driver as "default"
    4) Enable the option "Dissociate Formatting Page Size and Printer Paper Size" on the report
    5) What format do you export to?
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Print parameters in Excel sheet

    Hi,
    I have a question regarding print parameters of an excelsheet.
    we have a report program which downloads the data into Excelsheet. The users run the program online, and once the excel is downloaded, they will take a print out.
    This excel has different tabs. The users need to change the print parameters like changing from lanscape to potrait, setting the margins etc.... and then take a print output. can we avoid this manual process programatically.
    our developer has used classes to download the excel.
    any help would be greatly appreciated.
    Thanks.

    So it is downloaded, then the user opens the document manually and prints it.  Have you looked into OLE.
    /people/rich.heilman2/blog/2005/09/12/manipulate-excel-with-ole-abap
    Using OLE, you can automatically print out the excel documents.  I would also assume that you can change the parameter as needed. 
    Here is a sample code showing the OLE code that will print the excel sheet.
    report zrich_0003.
    include ole2incl.
    data: e_sheet type ole2_object.
    data: e_appl  type ole2_object.
    data: e_work  type ole2_object.
    data: e_col1  type ole2_object.
    data: e_col2  type ole2_object.
    data: e_cols  type ole2_object.
    data: e_cell  type ole2_object.
    data: e_wind  type ole2_object.
    data: field_value(30) type c.
    parameters: p_file type localfile default 'C:RichTest.xls'.
    start-of-selection.
    * Start the application
      create object e_appl 'EXCEL.APPLICATION'.
      set property of e_appl 'VISIBLE' = 1.
    * Open the file
      call method of e_appl 'WORKBOOKS' = e_work.
      call method of e_work 'OPEN'
              exporting
                   #1 = p_file.
    <b>  get property of e_appl 'ACTIVEWORKBOOK' = e_work.
      call method of e_work 'PRINTOUT'.</b>
    * Close the file
      call method of e_work 'close'.
    * Quit the file
      call method of  e_appl  'QUIT'.
      free object e_appl.
    Regards,
    Rich Heilman

  • Printing Oracle 10g Reports in Line Matrix Printers

    Hello!
    I encountered problem when printing a generated report in Oracle 10g Reports to a Line Printer. When the report is in PDF format, the fonts when printed on line printers become scattered and the orientation of the report rotates 90 degrees. If I use HTMLCSS format, the pages are not of fixed size. Please help me.
    Thanks in advance.

    1. Setup CUPS Printing Environment in Linux / Unix (on many modern Linux systems, CUPS is the default Printing System at the moment). The details of setup / build of CUPS is beyond the scope of this article. For details, please visit CUPS sites and documentation :
    http://www.cups.org
    http://www.cups.org/doc-1.1/sam.html
    The setup of CUPS is complete for our purposes, once you are able to print PDF documents directly from unix shell as follows :
    $ PRINTER=yourprinter
    $ export PRINTER
    $ lp test.pdf
    OR
    $ lpr test.pdf
    * The "yourprinter" above should be substituted with the name of your printer queue defined in CUPS and "test.pdf" is any pdf document available on this server.
    2. In reports.sh, set the following parameter and restart the Report Server:
    REPORTS_CUPS_PRINTING=YES; export REPORTS_CUPS_PRINTING
    3. Setup PDF functionality (including Font Subsetting / Embedding etc) to display the output as required in PDF format. To check this, run the report with the option "...destype=cache&desformat=PDF...".
    4. Run the report with parameters "...&desformat=PDF&destype=printer&desname=yourprinter&...."
    This way, Reports Server generates a PDF file in cache and sends it to CUPS printer queue, ie the "desformat=pdf" option is no longer ignored with "destype=printer".

  • How to pass parameters to reports

    Hi,
    I am a new user to dev2000, i am struck at passing parameters to the reports, i have used lexical referrences, to the where clause, in the query that i have written in reports builder. It created a user_parameter of that where_clause. now i am trying to pass this parameter, from the form to generate a report btw'n dates. please sugest me if there is any other way, or correct me if i am on the right path, here is the code that i am calling from the form.
    DECLARE
    pl_id ParamList;
    --repid REPORT_OBJECT;
    --v_rep VARCHAR2(100);
    BEGIN
    pl_id := Get_Parameter_List('tmpdata');
    IF NOT Id_Null(pl_id) THEN
    Destroy_Parameter_List( pl_id );
    END IF;
    pl_id := Create_Parameter_List('tmpdata');
    Add_Parameter(pl_id, 'WHERE_CLAUSE', TEXT_PARAMETER, 'WHERE SYS_DATE = ''18-JUL-01''');
    --repid := find_report_object('report34');
    --v_rep := RUN_REPORT_OBJECT(repid);
    Run_Product(REPORTS, 'REPORT34', ASYNCHRONOUS, BATCH,
    FILESYSTEM, pl_id,NULL);
    END ;
    I am gettting an error saying FRM-41211: Integration error:ssl failure running another product.
    this error is comming when i try to access for the first time, and
    Starting report REPORT34 [Tue Jul 24 16:35:14 2001] ...
    REP-0110: Unable to open file 'REPORT34'.
    REP-1070: Error while opening or saving a document.
    REP-0110: Unable to open file 'REPORT34'.
    End report REPORT34 [Tue Jul 24 16:35:20 2001].
    this for the next time, with out closing runtime env.
    If i have to use RUN_REPORT_OBJECT how can i pass parameters to reports.
    Another thing i encountered is when i am using RUN_REPORT_OBJECT which is working it shows me the parameter form of the reports and when i click on run report, it is just creating a file under forms directory and asking each time when i run report wether to replace it or not and from where it is calling the printer object and actually nothing is being printed, and every thing is fine with the printer and it is not showing the report out put and it shows end of report in the log file of the background report product.

    For your 1st problem it seems to be a bug in Forms 6i - you can visit this site:
    http://pipetalk.revealnet.com/~plsql/
    and find there 41211.
    Helena

  • Error in passing print parameters

    Hi,
    I am submitting a report in background and using FM Get_print_parameters to get and pass print parameters to the dialog box appears while submitting that report.
    My problem is that i am passing printing device 'lab1' to dialog box through function module get_print_parameters but '$lab1' appears in the dialog box and hence due to invalid device spool request is not getting generated.I am running program in background so can't remove 
    '$' from the device name.
    Kindly advice me what can be done to solve this problem...
    Regards..
    Edited by: shekhar kumar on Nov 1, 2008 6:20 AM

    Generally the $ sign comes when the output device does not exist. Just check in SPAD tcode whether the output device lab1 is present or not? If it is not then create or use the some other output device. But if it is there and then also you are getting the error then dbl click on the output device and try to pass the short text of the output device instead of lab1.
    Regards
    Shiba Prasad Dutta

  • How can I change the values for print parameters

    Hi all,
    There is a program which prints the documents every time the t.code is executed. I want the output to be stored in spool and NEVER wants it to be printed.
    A spreadsheet which has the details of articles is uploaded and a background job is created through ABAP SUBMIT statement to upload the article numbers to the table.
    GET_PRINT_PARAMETERS function module is used. Is there any way to pass the print parameters so that output will not be printed and only stored in the spool?
    Help me out and points will be rewarded.

    Hi Rathi,
    I am more or less giving as you mentioned. Here is the piece of code. 
    Y_XXXX is my report.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          MODE                   = 'BATCH'
          NO_DIALOG              = 'X'
          REPORT                 = 'Y_XXXX'
        IMPORTING
          OUT_ARCHIVE_PARAMETERS = ls_ArchivePrintParms
          OUT_PARAMETERS         = ls_PrintParms.
      SUBMIT Y_XXXX
       AND RETURN
        USER                sy-Uname
        VIA JOB             lw_JobName
            NUMBER          lw_JobNumber
        TO SAP-SPOOL
        WITHOUT SPOOL DYNPRO
        SPOOL PARAMETERS    ls_PrintParms
        ARCHIVE PARAMETERS  ls_ArchivePrintParms   
        WITH p_Matnr     =  ps_CreateArticleDatum-Article
        WITH p_MrchCt    =  ps_CreateArticleDatum-MerchCat
        WITH p_ArtTyp    =  ps_CreateArticleDatum-ArticleType
        WITH p_ArtCat    =  ps_CreateArticleDatum-ArticleCat
        WITH p_UOM       =  ps_CreateArticleDatum-UOM
        WITH p_ArtDsc    =  ps_CreateArticleDatum-ArticleDesc
        WITH p_ValCls    =  ps_CreateArticleDatum-ValueClass
        WITH p_PurGrp    =  ps_CreateArticleDatum-PurchGrp
        WITH p_StLsPr    =  ps_CreateArticleDatum-StoreListProc
        WITH p_DCLsPr    =  ps_CreateArticleDatum-DCListProc
        WITH s_RefStr    IN lr_RefStoresRange
        WITH p_BackGd    =  yartc_BooleanFalse
        WITH p_Test      =  yartc_BooleanFalse.
    But the o/p gets printed everytime I run the t.code.

Maybe you are looking for