Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SUBMIT PROGRAM WITH SPOOL PARAMETERS

Former Member
0 Likes
5,632

Hello Experts,

I am using Submit Program and Passing the Some Print Parameters but it is not having any effect.

So I am passing below two parameters

                print_parameters-prbig = ' '.

                print_parameters-prsap = ' '.

as i dont want to print the coverpage.


When I am checking the spool, the actual output is one page but the spool when downloaded to PDF is giving 2 pages.

Second page is the actual output and first page is the giving output as below.


Now i dont want the above page 1 to come.

Please help

Regards

6 REPLIES 6
Read only

yogendra_bhaskar
Contributor
0 Likes
2,392

Hi Rohan ,

If you are using export to pdf feature , then you will get the default page in PDF.

Its better you can create your own program for exporting PDF.

use FM

: CONVERT_ABAPSPOOLJOB_2_PDF

& GUI_DOWNLOAD

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'

    EXPORTING

      src_spoolid   = spoolno

      no_dialog     = ' '

    IMPORTING

      pdf_bytecount = l_no_of_bytes

      pdf_spoolid   = l_pdf_spoolid

      btc_jobname   = l_jobname

      btc_jobcount  = l_jobcount

    TABLES

      pdf           = it_pdf.

  "Download PDF file C Drive

  CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

      filename = 'C:\itab_to_pdf.pdf'

      filetype = 'BIN'

    TABLES

      data_tab = it_pdf.

Hope this will help you out

Regards

Yogendra Bhaskar

Read only

0 Likes
2,392

I am doing the same thing.

But the issue is with the spool request.

When I am checking the spool request via SP01, I am able to see 2 pages.

But my requirement is only one page, which is the second page.

Regards

Read only

0 Likes
2,392

Hi Rohan ,

For setting the print parameters , Are you using FM SET_PRINT_PARAMETERS ?

CALL FUNCTION 'SET_PRINT_PARAMETERS'

     EXPORTING

       DESTINATION = 'LOCL' " Printer

       LAYOUT      = 'X_65_512/2' "Format "X_65_255

       LINE_COUNT  = '65' "Line Count

       LINE_SIZE   = '1024'. "Line Size

Default Cover page will not appear.

Regards

Yogendra Bhaskar

Read only

0 Likes
2,392

Hi,

I assume you are talking about ALV-specific print parameters (print ALV selections: YES/NO). These cannot be controlled via SET/GET_PRINT_PARAMETERS. They can be controlled via ALV API or can be preset via user- (and report-) specific print parameters. Please see SAP note 551593.

Regards,

  Alex

Read only

0 Likes
2,392

the user-specific print parameters may be changed as shown in the screen captures here -> https://scn.sap.com/thread/3899665

Read only

Former Member
0 Likes
2,392

Hi Rohan ,

Check if this code is useful.

DATA: number           TYPE tbtcjob-jobcount,
      name             TYPE tbtcjob-jobname VALUE 'JOB_TEST',
      print_parameters TYPE pri_params.

...

CALL FUNCTION 'JOB_OPEN'
  EXPORTING
    jobname              = name
  IMPORTING
    jobcount             = number
  EXCEPTIONS
    cant_create_job  = 1
    invalid_job_data = 2
    jobname_missing      = 3
    OTHERS           = 4.
IF sy-subrc = 0.
  SUBMIT submitable TO SAP-SPOOL
                    SPOOL PARAMETERS print_parameters
                    WITHOUT SPOOL DYNPRO
                    VIA JOB name NUMBER number
                    AND RETURN.
  IF sy-subrc = 0.
    CALL FUNCTION 'JOB_CLOSE'
      EXPORTING
        jobcount             = number
        jobname              = name
        strtimmed            = 'X'
      EXCEPTIONS
        cant_start_immediate = 1
        invalid_startdate    = 2
        jobname_missing      = 3
        job_close_failed     = 4
        job_nosteps          = 5
        job_notex            = 6
        lock_failed          = 7
        OTHERS               = 8.
    IF sy-subrc <> 0.
      ...
    ENDIF.
  ENDIF.
ENDIF.

With Regards,

Sudhir S