Application Development and Automation 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: 
Read only

Save Invoice PDF application server

Former Member
0 Likes
1,945

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

8 REPLIES 8
Read only

Former Member
0 Likes
1,159

Hi,

can any please look into this.

Read only

Former Member
0 Likes
1,159

Hi ,

try -

OPEN DATASET LV_FILE FOR OUTPUT IN TEXT MODE (instead of BINARY MODE).

Narayan

Read only

Former Member
0 Likes
1,159

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.

Read only

0 Likes
1,159

Have you tried to check the contents of file after downloading it from App.Server to desktop ?

Regards, Vinod

Read only

Former Member
0 Likes
1,159

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

Read only

0 Likes
1,159

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

Read only

Former Member
0 Likes
1,159

Hi Vinod,

Thanx for the support. I will try to explain the same to the team.

with rgds

Ranjith Singh

Read only

Former Member
0 Likes
1,159

Thanx for the support