12-10-2008 8:40 AM
hi,
i have to download a spool the pdf into app server and finally give the upload the file and again show it.
the problem is when i am downloading the internal table it is showing generated from fm CONVERT_ABAPSPOOLJOB_2_PDF it contains junk charaters.when i try to move this file from app server to pc it the file could not be opened in PDF.
help me out
12-10-2008 9:20 AM
Use logic in program RSTXPDFT4. (You can make copy of this program in custom program).
Change download to presentation logic (GUI_DOWNLOAD) to download data in table PDF.
OPEN DATASET p_file FOR OUTPUT IN BINARY MODE.
IF sy-subrc = 0.
LOOP AT pdf.
TRANSFER pdf TO p_file.
IF sy-subrc <> 0.
WRITE : / 'Cannot write to file ', 23 p_file.
EXIT.
ENDIF.
ENDLOOP.
ELSE.
WRITE : / 'Cannot Open file ', 18 p_file.
CONTINUE.
ENDIF.
CLOSE DATASET p_file.
Regards,
Mohaiyuddin
12-10-2008 8:48 AM
hi
just try this FM RSPO_DOWNLOAD_SPOOLJOB
hope this helps
regards
Aakash Banga
12-10-2008 8:51 AM
You have to make the file 255 characters long.
You can refer this sample code.
LOOP AT pdf.
* TRANSLATE pdf USING ' ~'.
CONCATENATE wa_buffer pdf INTO wa_buffer RESPECTING BLANKS.
ENDLOOP.
* TRANSLATE wa_buffer USING '~ '.
DO.
t_contents_bin = wa_buffer.
APPEND t_contents_bin.
SHIFT wa_buffer LEFT BY 255 PLACES.
IF wa_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
12-11-2008 7:24 AM
12-10-2008 8:57 AM
Hi ,
Use the following fm
CONVERT_OTFSPOOLJOB_2_PDF, - Script or Smartforms
CONVERT_ABAPSPOOLJOB_2_PDF - ABAP Report
and use the following pgm to download them in to pdf file.
rstxpdft
Regards
Sathis
12-10-2008 9:20 AM
Use logic in program RSTXPDFT4. (You can make copy of this program in custom program).
Change download to presentation logic (GUI_DOWNLOAD) to download data in table PDF.
OPEN DATASET p_file FOR OUTPUT IN BINARY MODE.
IF sy-subrc = 0.
LOOP AT pdf.
TRANSFER pdf TO p_file.
IF sy-subrc <> 0.
WRITE : / 'Cannot write to file ', 23 p_file.
EXIT.
ENDIF.
ENDLOOP.
ELSE.
WRITE : / 'Cannot Open file ', 18 p_file.
CONTINUE.
ENDIF.
CLOSE DATASET p_file.
Regards,
Mohaiyuddin
12-11-2008 7:25 AM