Application Development 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: 

download spool in pdf format in unix

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

hi

just try this FM RSPO_DOWNLOAD_SPOOLJOB

hope this helps

regards

Aakash Banga

Former Member
0 Kudos

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.

0 Kudos

i think this for Email issue rather download problem.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

Binary mode is still not solving the issue