Skip to Content
0
Former Member
Aug 27, 2010 at 11:16 AM

PDF Download Problem

39 Views

Hi,

I have one report using Reuse_Alv_List_Display as output. After that I have to download the output to PDF.

By using the following code I can able to download, But the Problem is I have 54 fields( total length to 900 characters) in the out put and while downloading through Spool I am getting only 17 fields in one row and remaining fields are getting in 2nd and 3rd rows and are getting overlap.

So is there any Possibility to download to 54 Fields in PDF.If so, Please help me...

&----


*& Form USER_COMMAND

&----


  • Form for user-command for providing Pdf Functionlity.

----


  • --> No Import / Export Parameters.

----


FORM user_command USING l_okcode LIKE sy-ucomm

l_selfield TYPE slis_selfield .

CASE l_okcode.

WHEN '&PDF'.

g_flag = 'X'.

PERFORM pdf_download.

ENDCASE.

ENDFORM. " USER_COMMAND

&----


*& Form PDF_DOWNLOAD

&----


  • Form for Pdf functionalty

----


  • --> No Import / Export Parameters

----


FORM pdf_download .

DATA l_spoolid TYPE tsp01-rqident.

  • Without archiving

DATA: params LIKE pri_params,

days(1) TYPE n VALUE 2,

count(3) TYPE n VALUE 1, p_file TYPE rlgrap-filename,

valid TYPE c.

CLEAR l_spoolid.

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

destination = 'LOCA'

copies = count

list_name = 'TEST'

list_text = 'SUBMIT ... TO SAP-SPOOL'

immediately = 'X'

release = 'X'

new_list_id = 'X'

expiration = days

line_size = 132

line_count = 25

layout = 'X'

sap_cover_page = 'X'

cover_page = 'X'

receiver = 'SAP*'

department = 'System'

no_dialog = ' '

IMPORTING

out_parameters = params

valid = valid.

IF valid <> space.

EXPORT g_flag TO MEMORY ID 'M1'.

SUBMIT z_fi_exec_customercollection WITH s_kunnr IN s_kunnr

WITH s_bukrs IN s_bukrs

WITH s_budat IN s_budat

TO SAP-SPOOL

SPOOL PARAMETERS params

WITHOUT SPOOL DYNPRO

AND RETURN.

ENDIF.

DATA: lt_spooltab TYPE STANDARD TABLE OF rsporq WITH HEADER LINE ,

lc_rq2name LIKE tsp01-rq2name.

CONCATENATE sy-repid+0(8)

sy-uname+0(3)

INTO lc_rq2name SEPARATED BY '_'.

CALL FUNCTION 'RSPO_FIND_SPOOL_REQUESTS'

EXPORTING

rq2name = lc_rq2name

rqowner = sy-uname

TABLES

spoolrequests = lt_spooltab

EXCEPTIONS

no_permission = 1

OTHERS = 2.

IF sy-subrc <> 0.

WRITE:/ 'Error in Find Spool request '.

ENDIF.

SORT lt_spooltab DESCENDING BY rqcretime.

READ TABLE lt_spooltab INDEX 1.

l_spoolid = lt_spooltab-rqident.

SUBMIT rstxpdft4 WITH spoolno EQ l_spoolid

WITH download EQ 'X'

WITH p_file EQ p_file

AND RETURN.

ENDFORM. " PDF_DOWNLOAD

&----


*& Form SET_PF_STATUS

&----


  • Setting Modified Pf-Status to our program.

----


  • --> No Import / Export Parameters.

----


FORM set_pf_status USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'ZSTANDARD_ALV_C'.

ENDFORM. " SET_PF_STATUS