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

so_document_send_api1 mail pdf output problem

Former Member
0 Likes
874

Hi,

I am displaying clasical report with 8 cloumns and line size of output is 170 ( line size 170)

when i execute the program in background it is creating spool correctly means with out truncating the columns ( it is displaying all the eight columns in spool). i am covertng spool to pdf by using CONVERT_ABAPSPOOLJOB_2_PDF function module and sending mail by using SO_DOCUMENT_SEND_API1 function mdoule.

But when i opend the pdf attachement in mail, i am able to see only two columns in pdf document. i am not able to see all the out put 8 columns in pdf attachment .

how to convert all the coulmns to pdf and how i can able to see entire output in pdf document

please help me in this issue

Thanks in advance

raju

1 ACCEPTED SOLUTION
Read only

venkat_o
Active Contributor
0 Likes
699

Hi Raju, <li> After converting PDF itab using CONVERT_ABAPSPOOLJOB_2_PDF, use SX_TABLE_LINE_WIDTH_CHANGE function module. It increases the PDF width.

     CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
       EXPORTING
         src_spoolid              = g_spool_no
         no_dialog                = ' '
       IMPORTING
         pdf_bytecount            = l_no_of_bytes
         pdf_spoolid              = l_pdf_spoolid
         btc_jobname              = l_jobname
         btc_jobcount             = l_jobcount
       TABLES
         pdf                      = i_pdf
       EXCEPTIONS
         err_no_abap_spooljob     = 1
         err_no_spooljob          = 2
         err_no_permission        = 3
         err_conv_not_possible    = 4
         err_bad_destdevice       = 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
         OTHERS                   = 12.

     CASE sy-subrc.
       WHEN 0.
       WHEN 1.
         MESSAGE s000(0k) WITH 'No ABAP Spool Job'.
         EXIT.
       WHEN 2.
         MESSAGE s000(0k) WITH 'Spool Number does not exist'.
         EXIT.
       WHEN 3.
         MESSAGE s000(0k) WITH 'No permission for spool'.
         EXIT.
       WHEN OTHERS.
         MESSAGE s000(0k)
            WITH 'Error in Function CONVERT_ABAPSPOOLJOB_2_PDF'.
         EXIT.
     ENDCASE.

     CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
       EXPORTING
         line_width_src              = 134
         line_width_dst              = 255
       TABLES
         content_in                  = i_pdf
         content_out                 = l_attachment
       EXCEPTIONS
         err_line_width_src_too_long = 1
         err_line_width_dst_too_long = 2
         err_conv_failed             = 3
         OTHERS                      = 4.
     IF sy-subrc NE 0.
       MESSAGE s000(0k) WITH 'Conversion Failed'.
       EXIT.
     ENDIF.
Thanks Venkat.O

4 REPLIES 4
Read only

Former Member
0 Likes
699

Refer:

Read only

Former Member
0 Likes
699

Hi,

First Test converting the Spool to PDf using this program RSTXPDFT4. If it working fine then check you logic.

Read only

0 Likes
699

raju,

please check your internal table after converting spool job to pdf.(make a gui_download) to check if your are correctly getting the data.

Read only

venkat_o
Active Contributor
0 Likes
700

Hi Raju, <li> After converting PDF itab using CONVERT_ABAPSPOOLJOB_2_PDF, use SX_TABLE_LINE_WIDTH_CHANGE function module. It increases the PDF width.

     CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
       EXPORTING
         src_spoolid              = g_spool_no
         no_dialog                = ' '
       IMPORTING
         pdf_bytecount            = l_no_of_bytes
         pdf_spoolid              = l_pdf_spoolid
         btc_jobname              = l_jobname
         btc_jobcount             = l_jobcount
       TABLES
         pdf                      = i_pdf
       EXCEPTIONS
         err_no_abap_spooljob     = 1
         err_no_spooljob          = 2
         err_no_permission        = 3
         err_conv_not_possible    = 4
         err_bad_destdevice       = 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
         OTHERS                   = 12.

     CASE sy-subrc.
       WHEN 0.
       WHEN 1.
         MESSAGE s000(0k) WITH 'No ABAP Spool Job'.
         EXIT.
       WHEN 2.
         MESSAGE s000(0k) WITH 'Spool Number does not exist'.
         EXIT.
       WHEN 3.
         MESSAGE s000(0k) WITH 'No permission for spool'.
         EXIT.
       WHEN OTHERS.
         MESSAGE s000(0k)
            WITH 'Error in Function CONVERT_ABAPSPOOLJOB_2_PDF'.
         EXIT.
     ENDCASE.

     CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
       EXPORTING
         line_width_src              = 134
         line_width_dst              = 255
       TABLES
         content_in                  = i_pdf
         content_out                 = l_attachment
       EXCEPTIONS
         err_line_width_src_too_long = 1
         err_line_width_dst_too_long = 2
         err_conv_failed             = 3
         OTHERS                      = 4.
     IF sy-subrc NE 0.
       MESSAGE s000(0k) WITH 'Conversion Failed'.
       EXIT.
     ENDIF.
Thanks Venkat.O