on 04-20-2012 5:44 AM
Dear Freinds,
Please help me , <removed by moderator>, My Pdf is not printed in sap on linux operating system
I am puting here some coding also .
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = numbytes
FILENAME = 'tmp/CHEQUE.pdf'
FILETYPE = 'BIN'
TABLES
DATA_TAB = pdf
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
application = 'acroread.exe'
parameter = file
minimized = 'X'
synchronous = ' '
operation = 'PRINT'
when I am giving print then error occurs that pdf is not opened , I am opening pdf in background and print automatically
I tried to slove the error but then I am not getting print exactly , That is printing some garbage value.
some one suggest me to use open data set method , Please you can provide me the coding that how can I solve this issue
there is no issue to generate the pdf , Pdf is generating but I am not getting print in background .
Pls help me friends,
Rihan
SAP-abaper
Message was edited by: Thomas Zloch
'acroread.exe'
My Dear linux doesn't has .exe files( unless and and untill wine or other windows immulators are installed). Check if acrobot reader is intalled in the frontend and get the commnad which is used to launch it( Normally in /usr/bin but may vary with different destros ) . call that command in the method
Try this in your program
cl_gui_frontend_services=>execute accordingly.
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
application = 'acroread'
parameter = file
minimized = 'X'
synchronous = ' '
operation = 'PRINT'
This is man page for acroread
Note : Arey u sure you want your code dependent on frontends OS?
IF not the use the method GET_PLATFORM of the same class do determine which platform the user is running.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try giving only usr/bin/acroread tmp/CHEQUE.pdf for execution.
DATA : v_string TYPE string.
v_string = 'usr/bin/acroread tmp/CHEQUE.pdf'.
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
document = v_string
* APPLICATION =
* PARAMETER =
* DEFAULT_DIRECTORY =
* MAXIMIZED =
* MINIMIZED =
* SYNCHRONOUS =
operation = 'PRINT'
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
synchronous_failed = 8
not_supported_by_gui = 9
OTHERS = 10.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks & Regards
Bala Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi bala ji and Gaurav ji
I have applied your code , error is not coming but
printer is printing some garbage value like %%page: 1 pritmode simples[/deviceRGB]
and bala bala...
pls tell me tha anoter ways pls.
I have applied another code like.
DATA: file TYPE string .
*
*file = 'tmp/CHEQUE.pdf'.
*
*OPEN DATASET file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
*IF sy-subrc <> 0.
* WRITE: 'Error opening :', file.
* ENDIF.
*TRANSFER `1234567890` TO file.
*
.
*
*DATA: file TYPE string .
*
*file = 'usr/bin/acroread tmp/CHEQUE.pdf'.
*
*OPEN DATASET file FOR OUTPUT IN BINARY MODE.
*IF sy-subrc <> 0.
* WRITE: 'Error opening :', file.
* ENDIF.
*TRANSFER `1234567890` TO file.
*CLOSE DATASET file.
*
*
*CALL METHOD cl_gui_frontend_services=>execute
* EXPORTING
* DOCUMENT = file
* application = 'acroread'
* parameter = file
* minimized = 'X'
* synchronous = ' '
* operation = 'PRINT'
* EXCEPTIONS
* cntl_error = 1
* error_no_gui = 2
* bad_parameter = 3
* file_not_found = 4
* path_not_found = 5
* file_extension_unknown = 6
* error_execute_failed = 7
* synchronous_failed = 8
* not_supported_by_gui = 9l
* OTHERS = 10.
then it is showing file is not opened , According to me the Linux is not opening
the pdf file in background ,
Please suggest that is a very urgent issue
Thank
Rihan
SAP-abaper
Hi,
The file will be case sensitive, instead of Print option first try to open the file from SAP.
Try this code
DATA : v_document TYPE string,
v_application TYPE string.
v_document = '/tmp/CHEQUE.pdf'. " give the file name correctly.
v_application = '/usr/bin/acroread'. " just check in Linux where the acroread application is installed
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
document = v_document
application = v_application
* PARAMETER =
* DEFAULT_DIRECTORY =
* MAXIMIZED =
* MINIMIZED =
* SYNCHRONOUS =
operation = 'OPEN'
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
synchronous_failed = 8
not_supported_by_gui = 9
OTHERS = 10.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks & Regards
Bala Krishna
Dear Bala ji,
I have applied your coding and the pdf file is opened perfectly if I am testing for another
file it's also opening , Bur when I gave 'PRINT' opeartion in place of 'OPEN' the
printing is not done of any file ,And the printer is intalled perfectly,what to do now
please suggest , Is there something missing in Linus O.S because earilear in windows
there was primo pdf, so is there anything missing in Linux O.S, Please suggest
Thanks a lot for your co-operation
Regards
Rihan
sap-abaper
Googling I found this . If it works, then below should work too. Please check.
l_v_command = '-toPostScript'
concatinate L_v_command v_file into L_v_command separated by space.
cl_gui_frontend_services=>execute accordingly.
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
application = 'acroread'
parameter = l_v_command
minimized = 'X'
synchronous = ' '
operation = 'OPEN'
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.