2011 Aug 01 6:40 AM
Hi,
Can any one guide me in printing the PDF Document stored in Application Server (AL11) to the printer connected to SAP.
Thanks,
Vamsee
Hi,
Can any one guide me in printing the PDF Document stored in Application Server (AL11) to the printer connected to SAP.
Thanks,
Vamsee
2011 Aug 01 6:55 AM
Hi,
Before creating PDF file, you should transfer internal table data to Application server using "DATASET".
REPORT ZKUN_DEL1 .
data : begin of warea ,
a type i,
b type c,
m type i,
end of warea.
Data : j type i.
Data itab like table of warea with header line.
j = 5 .
while j > 0.
itab-a = itab-a + 1.
itab-b = 'b'.
itab-m = itab-m + 1.
append itab.
j = j - 1.
endwhile.
OPEN DATASET dsn FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
" opens a file for writing; if the file is not thr in the working direct
"ory it will create one with the same name.
LOOP AT itab.
concatenate itab-fname itab-lname itab-place into rec separated by space
.
TRANSFER rec TO dsn.
rec = ''.
ENDLOOP.
CLOSE DATASET dsn.
rec = ''.
OPEN DATASET dsn FOR INPUT IN TEXT MODE ENCODING DEFAULT.
" opens the file for reading only.
*READ DATASET dsn INTO rec.
IF sy-subrc = 0.
message i005(zmsg_kunal).
ENDIF.
*write rec.
*
WHILE sy-subrc = 0.
WRITE / rec. READ DATASET dsn INTO rec.
ENDWHILE.
EXIT.
CLOSE DATASET dsn.
Ram.
2011 Aug 01 7:26 AM
Hi ,
Thanks for the reply. I am not converting internal table to PDF. I have an PDF in Application Server (AL11) . I want to print that document. I am able to get the data into my program using open dataset for input in binary MODE. But How to print that data to a printer.
Thanks,
Vamsee
2011 Aug 01 8:21 AM