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

spool

Former Member
0 Likes
596

how to generate spool requests while doing data manipulations by means of table maintenance generator.

2 REPLIES 2
Read only

Clemenss
Active Contributor
0 Likes
560

sandeep you are the winner.

Name: sandeep G View users Business Card

Registered: 7/15/07

Total Posts: 58

Forum points: 0

Recent Messages:

meaning

ABAP Development » ABAP, General, Jul 29, 2007 1:41 PM

what is the exact meaning of the keyword dataset

differences1

ABAP Development » ABAP, General, Jul 29, 2007 1:40 PM

what is the difference between an internal table and database table

differnces

ABAP Development » ABAP, General, Jul 29, 2007 1:39 PM

what is the difference between a structure and an database table

structure

ABAP Development » ABAP, General, Jul 29, 2007 1:37 PM

what is the difference between a structure and an internal table

itable

ABAP Development » ABAP, General, Jul 29, 2007 1:36 PM

Regarding performance which internal table is faster.

urgent

ABAP Development » ABAP, General, Jul 29, 2007 1:34 PM

I have modified standard layout of script(form) by means of smartforms,now how can i attach it to ...

execute

ABAP Development » ABAP, General, Jul 29, 2007 1:31 PM

I have migrated and modified standard layout and attached it to the print program,now how can execut...

search help

ABAP Development » ABAP, General, Jul 29, 2007 1:29 PM

what is the process for implementing our own search help.

f1 help

ABAP Development » ABAP, General, Jul 29, 2007 1:27 PM

while creating tables how we can maintain our own F1 help for the fields in the tables created by us.

spool

ABAP Development » ABAP, General, Jul 29, 2007 1:25 PM

how to generate spool requests while doing data manipulations by means of table maintenance generat...

Search for all user messages

Read only

Former Member
0 Likes
560

Printing from within the Program

To start the printing process from within the program while creating a list, use the NEW-PAGE statement with the PRINT ONaddition:

Syntax

NEW-PAGE PRINT ON

.

This statement causes all subsequent output to be placed on a new page and the system interprets any subsequent output statements as print statements.

If you use the NEW-SECTIONaddition, reset the pagination (sy-pagno system field) to 1. The other additions determine the print parameters (see below).

If the list created by this point is a screen list, it is buffered. Starting from NEW-PAGE PRINT ON, the system no longer creates the list for display but for the spool system.

If a list has already been created for the spool system, and the NEW-SECTION addition is not used, no new spool request is created: The specified print parameters only apply for the subsequent spool request.

If a list has already been created for the spool system, and the NEW-SECTION addition is used, there are two possibilities:

· If the print parameters specified match the parameters of the current list and the print parameter PRNEW equals SPACE, the system does not create a new spool request.

· If the print parameters specified do not match the parameters of the current list or the print parameter PRNEW is unequal to SPACE, the system closes the current spool request and creates a new spool request.

A statement block started with NEW-PAGE PRINT ON should be finished with the PRINT OFF addition to the NEW-PAGE statement.

Syntax

NEW-PAGE PRINT OFF.

This statement creates a page break and sends the last page to the spool system.

If the preceding list was a screen list, it is retrieved from the buffer and the following output statements are reinserted.

If the preceding list was a print list, a new spool request is created and the following output statements are reinserted into the print list. If print parameters were specified for NEW-PAGE PRINT ON without the NEW-SECTIONaddition, these parameters apply.

The statement blocks NEW-PAGE PRINT ON - NEW-PAGE PRINT OFF must not be nested and should be completed within a processing block.

Setting the Print Parameters

To determine the print parameters for printed output following the NEW- PAGE PRINT ON statement, use the following additions for this statement.

Enter the print parameters using the PARAMETERSaddition instead, and, if required, use the ARCHIVE PARAMETERSaddition for archiving. To create the corresponding arguments pripar and arcpar, use the export parameters of the function module GET_PRINT_PARAMETERS. This serves to guarantee that the print parameters are set in their entirety and that the print request is executable. Since the function module GET_PRINT_PARAMETERS has its own user dialog, always use the NO DIALOG addition in the NEW-PAGE PRINT ONstatement.

REPORT demo_list_new_page_print_on NO STANDARD PAGE HEADING.

DATA: val(1) TYPE c,

pripar TYPE pri_params,

arcpar TYPE arc_params,

lay TYPE pri_params-paart,

lines TYPE pri_params-linct,

rows TYPE pri_params-linsz.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

IMPORTING

out_parameters = pripar

out_archive_parameters = arcpar

valid = val

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

IF val <> space AND sy-subrc = 0.

SET PF-STATUS 'PRINT'.

WRITE ' Select a format!'.

ENDIF.

TOP-OF-PAGE DURING LINE-SELECTION.

WRITE: 'Page', sy-pagno.

ULINE.

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'PORT'.

lay = 'X_65_80'.

lines = 60.

rows = 55.

PERFORM format.

WHEN 'LAND'.

lay = 'X_65_132'.

lines = 60.

rows = 110.

PERFORM format.

ENDCASE.

FORM format.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

in_archive_parameters = arcpar

in_parameters = pripar

layout = lay

line_count = lines

line_size = rows

no_dialog = 'X'

IMPORTING

out_archive_parameters = arcpar

out_parameters = pripar

valid = val

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

IF val <> space AND sy-subrc = 0.

PERFORM list.

ENDIF.

ENDFORM.

FORM list.

NEW-PAGE PRINT ON

NEW-SECTION

PARAMETERS pripar

ARCHIVE PARAMETERS arcpar

NO DIALOG.

DO 440 TIMES.

WRITE (3) sy-index.

ENDDO.

NEW-PAGE PRINT OFF.

ENDFORM.

This program immediately calls the function module GET_PRINT_PARAMETERS. No import parameters are transferred. In the Print List Output dialog box, the user can enter the print and archiving parameters for this program. The system passes these parameters, using the export parameters of the function module, to the structures PRIPAR and ARCPAR. To guarantee that the parameters are complete and consistent, the program runs the user dialog and checks the return value of valid .

After completing the dialog, the system displays the following basic list:

In the status PRINT of the basic list, the function codes PORT and LAND are assigned to the function keys F5 and F6, and to two pushbuttons in the application toolbar. If the user chooses one of these functions, the AT USER-COMMAND event occurs, assigning to the variables lay, lines, and rows the values for portrait or landscape output format and calling the subroutine format.

The subroutine format calls the function module GET_PRINT_PARAMETERS. When this happen, the parameters pripar and arcpar are copied as import parameters. The values from lay, lines, and rows are assigned to the import parameters layout, line_count and line_size respectively. There is no user dialog. The system returns the parameters to the structures pripar and arcpar. The function of the subroutine call is to set the components PAART, LINCT, and LINSZ of the structure pripar with new values.

After checking the parameters for completeness and consistency, the program calls the subroutine list. This subroutine sends a list to the spool system using NEW-PAGE PRINT ON, thereby determining the print and archiving parameters using pripar and arcpar. A user dialog is not necessary, since all settings required were made by GET_PRINT_PARAMETERS.

To view the stored spool requests, the user can choose System ® Services ® Print requests. After choosing PORTRAIT, the spool request may look like this:

After choosing LANDSCAPE, however, the spool request looks like this: