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: 

How to give a print in background job Urgent

former_member376453
Contributor
0 Kudos

Hi,

I am trying to do a printout from a background by the call transaction F.62. but it's giving the output to the spool. I like to know how I can directly print the output by F.62 in background.

If it is not possible how can I get the spool number from the program and can print the data. Can anyone suggest any function module.

Please suggest.

Thanks,

Kuntal

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Kuntal,

if you start F.62 in background, you have to set the print parameters.

Set TIME OF PRINT with X (Pint out immediately).

The same, when creating a job.

Regards, Dieter

9 REPLIES 9

sourabhshah
Advisor
Advisor
0 Kudos

Hi,

Check if this helps

Sample Program: Declarations, Set Up, and Print Specifications

http://help.sap.com/saphelp_erp2005vp/helpdata/en/fa/096d33543b11d1898e0000e8322d00/frameset.htm

Former Member
0 Kudos

Hi,

v_print = 'X' only for printing else it is space

first setup print parameters..

  • Setup the Print Parmaters

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

AUTHORITY = SPACE

IMMEDIATELY = V_PRINT

NEW_LIST_ID = C_X

NO_DIALOG = C_X

USER = SY-UNAME

IMPORTING

OUT_PARAMETERS = V_PRINT_PARMS

EXCEPTIONS

ARCHIVE_INFO_NOT_FOUND = 1

INVALID_PRINT_PARAMS = 2

INVALID_ARCHIVE_PARAMS = 3

OTHERS = 4.

IF SY-SUBRC NE 0.

CLEAR : V_PRINT_PARMS.

ENDIF.

  • The printer destination has to be set up

IF V_PRINT_PARMS-PDEST = SPACE.

V_PRINT_PARMS-PDEST = LC_LOCL.

ENDIF.

  • Explicitly set line width, and output format so that

  • the PDF conversion comes out OK

V_PRINT_PARMS-LINSZ = C_LINSZ.

V_PRINT_PARMS-PAART = LC_PAART.

then u need to write the below comand..

NEW-PAGE PRINT ON PARAMETERS V_PRINT_PARMS NO DIALOG.

perform output_display.

NEW-PAGE PRINT OFF.

in the perform output_display..

u need to write write statements...thre...

plz mark if u find useful..

Regards

Sudheer

Former Member
0 Kudos

Hi Kuntal,

if you start F.62 in background, you have to set the print parameters.

Set TIME OF PRINT with X (Pint out immediately).

The same, when creating a job.

Regards, Dieter

0 Kudos

HI Dieter,

If possible plz , suggest me how to set the 'Immediate' check box.

Thanks,

Kuntal

0 Kudos

Hi Kuntal,

it depends of the SAP-Release.

which release do you have?

Regards, Dieter

0 Kudos

Hi Dieter,

I am using version 4.7 , actually when I am running the F.62 in background it's running fine. But when running the recording program, at that time it's just creating a entry in spool.

Please suggest.

Thanks

Kuntal

former_member376453
Contributor
0 Kudos

Hi Guys,

Thanx for the quick reply. Actually I have tried the above function Module, but I didn't find any field to pass the spool number in the FM. Can you help me regarding this matter.

Thanks,

Kuntal

former_member404244
Active Contributor
0 Kudos

Hi,

u can get the spool number by the below code.

DATA:

LV_RQ2NAME LIKE TSP01-RQ2NAME.

CONCATENATE SY-REPID+0(8)

SY-UNAME+0(3)

INTO LV_RQ2NAME SEPARATED BY '_'.

  • Get the spool number.

SELECT * FROM TSP01 WHERE RQ2NAME = LV_RQ2NAME

ORDER BY RQCRETIME DESCENDING.

V_RQIDENT = TSP01-RQIDENT.

EXIT.

ENDSELECT.

IF SY-SUBRC NE 0.

CLEAR V_RQIDENT.

ENDIF.

Regards,

nagaraj

former_member376453
Contributor
0 Kudos

Hi Dieter,

Where can I set this Time of execution? I am using a custom varient which is a copy of SAP09. in that varient I have checked the Immediate check box.

When I am running the Transaction in background it's working fine but after recording when I am running the custom program in background it's not printing, just creating a entry in spool.

Please Suggest.

Kuntal

Message was edited by:

Kuntal Nandi