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

PDF attachment in LANDSCAPE mode

Former Member
0 Likes
1,917

Hi,

I am attaching a PDF to an email and sending it. Currently the attachment is in portrait mode. Some data is missing in it due the length. How can I convert it to LANDSCAPE mode?

FM's:

To convert spool to PDF: CONVERT_ABAPSPOOLJOB_2_PDF

To send email: SO_NEW_DOCUMENT_ATT_SEND_API1

Everything is working perfectly well except the mode of attachment. I checked various posts but couldn't find the solution. Your suggestions are welcome.

Note: I'm not using Smartform/Script to generate the document.

Thanks in advance,

Bhargava

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,176

Hi,

While generating the spool job by using Print Function module, specify the layout for the print.

*Local data declaration

DATA: li_pr_param TYPE pri_params,

l_valid TYPE char1.

CONSTANTS: lc_prtr TYPE sypdest VALUE 'LP01',

lc_layout TYPE sypaart VALUE 'X_65_255', -


> to generate in landscape

lc_lines TYPE sylinsz VALUE '-185',

lc_mode TYPE sycallr VALUE 'CURRENT'.

*Get the print paramters

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

authority = space

destination = lc_prtr

immediately = space

new_list_id = c_x

layout = lc_layout

line_size = lc_lines

mode = lc_mode

no_dialog = c_x

report = sy-repid

user = sy-uname

suppress_shading = c_x

IMPORTING

out_parameters = li_pr_param

valid = l_valid

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

*Generate spool id

IF sy-subrc IS INITIAL AND l_valid EQ c_x.

NEW-PAGE PRINT ON PARAMETERS li_pr_param NO DIALOG.

PERFORM display_alv.

NEW-PAGE PRINT OFF.

ENDIF.

Please let me know if you need any other details

Regards,

Janani

Hi,

I am attaching a PDF to an email and sending it. Currently the attachment is in portrait mode. Some data is missing in it due the length. How can I convert it to LANDSCAPE mode?

FM's:

To convert spool to PDF: CONVERT_ABAPSPOOLJOB_2_PDF

To send email: SO_NEW_DOCUMENT_ATT_SEND_API1

Everything is working perfectly well except the mode of attachment. I checked various posts but couldn't find the solution. Your suggestions are welcome.

Note: I'm not using Smartform/Script to generate the document.

Thanks in advance,

Bhargava

3 REPLIES 3
Read only

Former Member
0 Likes
1,177

Hi,

While generating the spool job by using Print Function module, specify the layout for the print.

*Local data declaration

DATA: li_pr_param TYPE pri_params,

l_valid TYPE char1.

CONSTANTS: lc_prtr TYPE sypdest VALUE 'LP01',

lc_layout TYPE sypaart VALUE 'X_65_255', -


> to generate in landscape

lc_lines TYPE sylinsz VALUE '-185',

lc_mode TYPE sycallr VALUE 'CURRENT'.

*Get the print paramters

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

authority = space

destination = lc_prtr

immediately = space

new_list_id = c_x

layout = lc_layout

line_size = lc_lines

mode = lc_mode

no_dialog = c_x

report = sy-repid

user = sy-uname

suppress_shading = c_x

IMPORTING

out_parameters = li_pr_param

valid = l_valid

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

*Generate spool id

IF sy-subrc IS INITIAL AND l_valid EQ c_x.

NEW-PAGE PRINT ON PARAMETERS li_pr_param NO DIALOG.

PERFORM display_alv.

NEW-PAGE PRINT OFF.

ENDIF.

Please let me know if you need any other details

Regards,

Janani

Read only

0 Likes
1,176

Thanks.

This solves my problem....

Read only

Former Member
0 Likes
1,176

Check the Device type and the Page format in tcode SPAD , Change the page format to Landscape page format for the device type and check it.

Regards,

lakshman.