Skip to Content
author's profile photo Former Member
Former Member

print spool

hi to all

in my bdc report i have to files success and error records files.

i am passing records into these two files.

if i error record filr contains reords.

then i have to pass message to print spool and screen like below

write to printspool “Errorlines are written to 'some filename' Errorrecordsfile"

write message to screen “Errorlines are written to 'some filename' Errorrecordsfile

can any one help me

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2008 at 05:38 AM

    Hi,

    Check below code:

    
    DATA: pripar TYPE pri_params,
          arcpar TYPE arc_params,
          lay TYPE pri_params-paart,
          lines TYPE pri_params-linct,
          rows TYPE pri_params-linsz.
    DATA: val(1), val1(1).
    DATA: dest TYPE pri_params-pdest VALUE 'NHREMOTE'. " Printer Name, can use local printer
    DATA: name TYPE pri_params-plist VALUE 'Testing'.
    DATA: i_pdf TYPE STANDARD TABLE OF tline.
    DATA: spono TYPE tsp01-rqident.
    
    
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
        destination            = dest
        no_dialog              = 'X'
        immediately            = ' '
      IMPORTING
        out_archive_parameters = arcpar
        out_parameters         = pripar
        valid                  = val
        valid_for_spool_creation = val1
      EXCEPTIONS
        archive_info_not_found = 1
        invalid_print_params   = 2
        invalid_archive_params = 3
        OTHERS                 = 4.
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    
    pripar-prdsn = 'DSN'.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
        in_archive_parameters    = arcpar
        in_parameters            = pripar
        no_dialog                = 'X'
        list_name                = name
      IMPORTING
        out_archive_parameters   = arcpar
        out_parameters           = pripar
        valid                    = val
        valid_for_spool_creation = val1
      EXCEPTIONS
        archive_info_not_found   = 1
        invalid_print_params     = 2
        invalid_archive_params   = 3
        OTHERS                   = 4.
    
    IF sy-subrc EQ 0.
      NEW-PAGE PRINT ON  " Starts spool, all WRITE statements from here will be to the spool
      NEW-SECTION
      PARAMETERS pripar
      ARCHIVE PARAMETERS arcpar
      NO DIALOG.
    ELSE.
      WRITE:/ 'Unable to create spool'.
    ENDIF.
    
    WRITE:/ 'First Line'.
    WRITE:/ 'Second Line'.
    
    NEW-PAGE PRINT OFF. " Closing the spool
    
    

    Kind Regards

    Eswar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2008 at 12:03 PM

    hi ehwar

    My problem solved

    thank you

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.