‎2007 Jan 19 2:01 PM
I am working on a report.
The execution is getting aborted coz printer is not found.
I have user profile default set to LOCL.
Also I am using ht efollowing code to set up printer and spool
=======
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
copies = 1
department = 'SYSTEM'
destination = 'LOCL'
expiration = 2
immediately = ' '
in_archive_parameters = ' '
in_parameters = ' '
layout = 'X_65_255'
line_count = 65
line_size = 255
list_name = 'TEST'
list_text = 'TEST'
mode = ' '
new_list_id = 'X'
no_dialog = 'X'
receiver = 'SAP*'
release = 'X'
sap_cover_page = 'X'
user = sy-uname
IMPORTING
out_parameters = l_params
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc = 0 AND NOT l_params IS INITIAL.
IF NOT sy-batch IS INITIAL.
NEW-PAGE PRINT ON PARAMETERS l_params NO DIALOG NEW-SECTION.
endif.
endif.
=======
If I check the details in SM37, job log says " Printer name "" not defined"
The printer is not getting set to LOCL.
Any idea??
Solution would definitely be rewarded.
regards
‎2007 Jan 19 2:13 PM
Hi Sachin123,
is 'LOCL' the normal or short name?
You have to use the shortname, look with SPAD for the correct name.
Regards, Dieter
‎2007 Jan 19 2:25 PM
Hi Sachin123,
i have tried your code like this:
DATA: PARAMS LIKE PRI_PARAMS.
*
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
COPIES = 1
DEPARTMENT = 'SYSTEM'
<b> DESTINATION = 'LOCA'</b>
EXPIRATION = 2
LAYOUT = 'X_65_255'
LINE_COUNT = 65
LINE_SIZE = 255
LIST_NAME = 'TEST'
LIST_TEXT = 'TEST'
MODE = ' '
NEW_LIST_ID = 'X'
NO_DIALOG = 'X'
RECEIVER = 'SAP*'
RELEASE = 'X'
SAP_COVER_PAGE = 'X'
USER = SY-UNAME
IMPORTING
OUT_PARAMETERS = PARAMS
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
*
IF SY-SUBRC = 0.
BREAK-POINT.
ELSE.
WRITE: / SY-SUBRC.
ENDIF.
it works, i have only changed the destination to the short name.
Regards, Dieter
‎2007 Jan 19 2:35 PM
hi
1.can u please check the LOCL is configured or not.
2. if yes... goto SPAD..chek all the parameters have given correctly.
‎2007 Jan 22 8:21 AM
It works when I run the program in foreground and also in the background via : Program - > Execute - > background.
But my program is scheduled to run in background by some other person.
And I think he has not maintained "LOCL" in System -> User Profile -> Own data.
so when the program runs at the scheduled time, its throwing error.
I want to know if htere is any method using which I force the printer to "LOCL" irrespective of what is maintained in the enduser's user profile.
regards,
‎2007 Jan 22 8:24 AM
use this code to get the user defined printer
select single spld into usr01-spld from usr01 where bname eq sy-uname .
if sy-subrc eq 0 .
move: usr01-spld to loc_dest .
endif .
now pass loc_dest to destination
Raja
‎2007 Jan 22 9:44 AM
But my problem is the entry is not in usr01thus have to force LOCL there....