‎2011 Jul 11 9:24 AM
Hi,
I was able to store the Invoice PDF on the application server using the below code
CONCATENATE '/usr/sap/tmp/' '<' xxxxx'>' '_' '.pdf' INTO LV_FILE.
OPEN DATASET LV_FILE FOR OUTPUT IN BINARY MODE.
IF SY-SUBRC EQ 0.
LOOP AT OUT_TAB.
TRANSFER OUT_TAB TO LV_FILE.
ENDLOOP.
CLOSE DATASET LV_FILE.
ENDIF.
but when i try to open the same from the above path i can see a lot a junk characters.
But i wan to store that in PDF format , can anybody help me in this regard.
with rgds
Ranjith Singh
‎2011 Jul 11 10:41 AM
‎2011 Jul 11 11:16 AM
Hi ,
try -
OPEN DATASET LV_FILE FOR OUTPUT IN TEXT MODE (instead of BINARY MODE).
Narayan
‎2011 Jul 11 11:43 AM
hi,
Thanx for the reply, my code looks like this
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = I_ITCPP-TDSPOOLID
NO_DIALOG = SPACE
dst_device = out_parms-pdest
IMPORTING
PDF_BYTECOUNT = BYTECOUNT
PDF_SPOOLID = PDFSPOOLID
BTC_JOBNAME = JOBNAME
BTC_JOBCOUNT = JOBCOUNT
TABLES
PDF = OUT_TAB
EXCEPTIONS
ERR_NO_OTF_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DSTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11.
CONCATENATE '/usr/sap/tmp/' <' NAST-OBJKY '>' '.pdf' INTO LV_FILE1.
OPEN DATASET LV_FILE1 FOR OUTPUT IN BINARY MODE.
IF SY-SUBRC EQ 0.
LOOP AT OUT_TAB.
TRANSFER OUT_TAB TO LV_FILE1.
ENDLOOP.
CLOSE DATASET LV_FILE1.
ENDIF.
when checked on the Application server i see a lot of junk characters, where in my requirement is to store the PDF file itself.
‎2011 Jul 11 11:51 AM
Have you tried to check the contents of file after downloading it from App.Server to desktop ?
Regards, Vinod
‎2011 Jul 11 12:22 PM
Hi Vinod,
I checked the same using the Tr Code CG3Y . It is perfect and it is in PDF format.
But i want to see the same in PDF format on the application server.
with rgds
Ranjith Singh
‎2011 Jul 11 12:38 PM
AFAIK, it will not be visible (PDF form) in Application server. You need an associated software ( in this case Acrobat reader )to view the file contents. Download the file into presentation server to view the contents.
Regards, Vinod
‎2011 Jul 11 1:23 PM
Hi Vinod,
Thanx for the support. I will try to explain the same to the team.
with rgds
Ranjith Singh
‎2011 Jul 11 1:23 PM