‎2008 Feb 05 2:33 AM
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
‎2008 Feb 05 4:23 AM
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.
‎2008 Feb 05 2:42 AM
Do you have the same problem, when you specify the destination/printer name?
Regards
Eswar
‎2008 Feb 05 4:12 AM
‎2008 Feb 05 2:51 AM
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
‎2008 Feb 05 4:13 AM
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.
‎2008 Feb 05 2:52 AM
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
‎2008 Feb 05 4:15 AM
Hi Praveen will be waiting for your code.
May be you can give me more hints so that i too can search
‎2008 Feb 05 4:23 AM
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.
‎2008 Feb 05 5:42 AM
Hi Prashant, how will this print on and print off will help my spool pbm?
‎2008 Feb 05 5:54 AM
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
‎2008 Feb 06 2:00 AM
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
‎2008 Sep 06 1:07 AM
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 ?