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: 

exit program after new-page

Former Member
0 Kudos

Hi,

What could be wrong with folowing code (part of longer program) :

FORM print_id.

DATA: valid TYPE c,

params LIKE pri_params.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

destination = 'LOCL'

immediately = 'X' "<<< add this line - immediate print

new_list_id = 'X' "<<< add this line - new spool request

IMPORTING

out_parameters = params

valid = valid.

IF valid <> space.

NEW-PAGE PRINT ON PARAMETERS PARAMS NO DIALOG.

WRITE: 'dsds'.

ENDIF.

ENDFORM.

I result its print a page with 'dsds' text on pritner but then program exit to main sap menu with no any error message.

when I use:

NEW-PAGE.

instead of:

NEW-PAGE PRINT ON PARAMETERS PARAMS NO DIALOG.

new page report is display on screen with text 'dsds' but no exit occurs.

1 REPLY 1

Former Member
0 Kudos

self-solved

I added:

NEW-PAGE PRINT OFF.

at the end of form and it helps.

Without that line after executing a form, controls goes back to other screen that should ('previuos ?')