Application Development 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: 

Submit results with two spool request

Former Member
0 Kudos

Hi

I using the following submit code in my abap program.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING
*  DESTINATION           = 'LOCL'

LIST_NAME             = 'TEST'

LIST_TEXT             = 'SUBMIT ... TO SAP-SPOOL'

IMMEDIATELY           = ' '

LINE_SIZE              = 1023

NO_DIALOG             = 'X'

IMPORTING OUT_PARAMETERS        = PARAMS

VALID                 = VALID.

SUBMIT (pgnam) USING SELECTION-SET vrint

TO SAP-SPOOL WITHOUT SPOOL DYNPRO

SPOOL PARAMETERS PARAMS AND RETURN.

This is working fine in my development system. But when i test this in testing server (QAS) it returns two spool one with 0 pages and second one with correct output. Can anyone help me with this?

points will be rewarded for useful answers.

thanks

1 ACCEPTED SOLUTION

former_member223537
Active Contributor
0 Kudos
REPORT demo NO STANDARD PAGE HEADING. 

DATA: spfli_wa TYPE spfli, 
      sflight_wa TYPE sflight. 

DATA: print_parameters TYPE pri_params, 
      valid_flag       TYPE c LENGTH 1. 

START-OF-SELECTION. 

  CALL FUNCTION 'GET_PRINT_PARAMETERS' 
    IMPORTING 
      out_parameters       = print_parameters 
      valid                = valid_flag 
    EXCEPTIONS 
      invalid_print_params = 2 
      OTHERS               = 4. 

  IF valid_flag = 'X' AND sy-subrc = 0. 
    SELECT carrid connid 
           FROM spfli 
           INTO CORRESPONDING FIELDS OF spfli_wa. 
      WRITE: / spfli_wa-carrid, spfli_wa-connid. 
      HIDE:    spfli_wa-carrid, spfli_wa-connid. 
    ENDSELECT. 
  ELSE. 
    ... 
  ENDIF. 

AT LINE-SELECTION. 
  NEW-PAGE PRINT ON PARAMETERS print_parameters 
                    NO DIALOG. 
  SELECT * 
         FROM sflight 
         INTO sflight_wa 
         WHERE carrid = spfli_wa-carrid AND 
               connid = spfli_wa-connid. 
    WRITE: / sflight_wa-carrid, sflight_wa-connid, 
             sflight_wa-fldate ... 
  ENDSELECT. 
  NEW-PAGE PRINT OFF.
11 REPLIES 11

Former Member
0 Kudos

Do you have the same problem, when you specify the destination/printer name?

Regards

Eswar

0 Kudos

Yes i have the same pbm when i specify dest name

Former Member
0 Kudos

Hi

Have just tried with below format and it seems to be okay, can you try and check the same:


   submit <prog> to sap-spool
          destination <dest>
          list name <list name>
          keep in spool 'X'
          without spool dynpro
          and return.

Regards

Eswar

0 Kudos

I have tried this too

submit <prog> to sap-spool

destination <dest>

list name <list name>

keep in spool 'X'

without spool dynpro

and return.

Former Member
0 Kudos

Hi

You may have to use the PRINT ON and PRINT OFF Functions...

And Pass the Contente Individually to the spools ..

I did it long time back..

Will try to search the code ..

Thanks

Praveen

0 Kudos

Hi Praveen will be waiting for your code.

May be you can give me more hints so that i too can search

former_member223537
Active Contributor
0 Kudos
REPORT demo NO STANDARD PAGE HEADING. 

DATA: spfli_wa TYPE spfli, 
      sflight_wa TYPE sflight. 

DATA: print_parameters TYPE pri_params, 
      valid_flag       TYPE c LENGTH 1. 

START-OF-SELECTION. 

  CALL FUNCTION 'GET_PRINT_PARAMETERS' 
    IMPORTING 
      out_parameters       = print_parameters 
      valid                = valid_flag 
    EXCEPTIONS 
      invalid_print_params = 2 
      OTHERS               = 4. 

  IF valid_flag = 'X' AND sy-subrc = 0. 
    SELECT carrid connid 
           FROM spfli 
           INTO CORRESPONDING FIELDS OF spfli_wa. 
      WRITE: / spfli_wa-carrid, spfli_wa-connid. 
      HIDE:    spfli_wa-carrid, spfli_wa-connid. 
    ENDSELECT. 
  ELSE. 
    ... 
  ENDIF. 

AT LINE-SELECTION. 
  NEW-PAGE PRINT ON PARAMETERS print_parameters 
                    NO DIALOG. 
  SELECT * 
         FROM sflight 
         INTO sflight_wa 
         WHERE carrid = spfli_wa-carrid AND 
               connid = spfli_wa-connid. 
    WRITE: / sflight_wa-carrid, sflight_wa-connid, 
             sflight_wa-fldate ... 
  ENDSELECT. 
  NEW-PAGE PRINT OFF.

0 Kudos

Hi Prashant, how will this print on and print off will help my spool pbm?

0 Kudos

Hello

The First Spool Is Created By Calling FM GET_PRINT_PAMATERS

With the data passed in this FM..

Now Suppose you want to Print The User Name Who Executed The program .

Then NEW PAGE PRINT -ON --- OFF

Will create the second Spool instead of writing in the First Spool.

What Ever you want in Second Spool write your code in Between

NEW-PAGE PRINT ON .

WRITE - SY-UNAME ( Write the user name in the second Spool )

PRINT OFF.

I am unable to get the code for the same..Hope it will help you .

Thanks

Praveen

0 Kudos

doesnot solve my pbm.

The thing is my submit program works fine with all the programs including any customised program.

But when i submit Queries (HR) then it sends two output to spool one is empty (cannot open) otherone is correct...Not sure why this is happening and how to avoid it...

Doesnot seem to be anything wrong with my coding, may be any settings?

Well for the time being i am handling this case manually by ignoring the empty spool and reading only the spool with output.

Thanks for your time and suggestion.

But if you find the actualy solution for my pbm, please do share...

Thanks

0 Kudos

praveen,

we have a similar issue.

while creating background job for invoicing in t.code VF06, the system creates one spool request.

This takes all the invoices created in one spool

Our requirement is to get separate spool req per invoice when invoicing using background job.

Any thoughts ?