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: 

How to set a page header and footer of an excel file i'm creating

Former Member
0 Kudos

Hello !

SORRY MY ENGLISH is very BAD.

I tried to set page header and footer in Excel sheet with ABAP ole

......

DATA : BEGIN OF enter,

x(1) TYPE x VALUE '0D',

END OF enter.

DATA : format(255) TYPE c.

.....

FORM set_page_sheet.

CALL METHOD OF excel 'ActiveSheet' = sheet.

CALL METHOD OF sheet 'PageSetup' = pagesetup.

SET PROPERTY OF pagesetup 'Orientation' = xllandscape.

SET PROPERTY OF pagesetup 'PrintTitleRows' = '$9:$12'.

CLEAR format.

ERROR

CONCATENATE 'PAGESHEET' enter-x 'PAGE &P/&N' INTO format.

ERROR

SET PROPERTY OF pagesetup 'RightHeader' = format.

CLEAR format.

CONCATENATE ' Text 1 ' enter-x 'Text 2'

enter-x 'Text 3 ' INTO format.

SET PROPERTY OF pagesetup 'RightFooter' = format.

FREE OBJECT pagesetup.

ENDFORM. " set_page_sheet

Activate report -

ERROR - The enter-x must by data type c or another then data type x

Thanks for answer.

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

Try to define ENTER this way & try


class cl_abap_char_utilities definition load.

DATA : BEGIN OF enter,
x type c value cl_abap_char_utilities=>cr_lf,
END OF enter. 

PS : I am not 100% sure about this.

3 REPLIES 3

former_member194669
Active Contributor
0 Kudos

Try to define ENTER this way & try


class cl_abap_char_utilities definition load.

DATA : BEGIN OF enter,
x type c value cl_abap_char_utilities=>cr_lf,
END OF enter. 

PS : I am not 100% sure about this.

0 Kudos

This reason is right.

Thank for help

Edited by: Radovan Jarkovsky on Feb 27, 2009 8:34 PM

Former Member
0 Kudos

This reason is right