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: 

Page break in html report

Former Member
0 Kudos

Hi all,

I am sending a report to external user e-mail id from SAP. The user is receiving the report in html format.

The user asks me they need a page break on the report after each customer data. I am wondering is it possible to have a page break in html report? If yes, how it is possible?

16 REPLIES 16

guillaume-hrc
Active Contributor
0 Kudos

I don't think there is a page break in HTML...

Maybe you could insert some kind of special code in order for your user to insert a page break instead of this special code (in Word)

Good luck.

0 Kudos

Hi Guillaume,

Thanks for your reply. I am not sure what you mean. Can you explain in detail please?

Thanks,

Sobhan.

Former Member
0 Kudos

Hai Sobhan,

checkout

<b>CL_ABAP_CHAR_UTILITIES=>CR_LF.</b>

This character will be used in textedit for a carriage return.

May work for u.

regards,

Venkatesh.

0 Kudos

Hello Venkatesh,

I am still with 4.6C. I dont know if I can do that?

Thanks,

Sobhan.

Tammie
Participant
0 Kudos

Hi Sobhan,

Try adding the following code to your HTML between the <HEAD> and </HEAD> tags:

<STYLE TYPE="text/css">
     P.breakhere {page-break-before: always}
</STYLE>

Now add the following line of code wherever you need a new page (e.g. after each customer):

<P CLASS="breakhere">

Hope that helps!

Regards,

Tammie

Former Member
0 Kudos

All,

Thanks for the help. My understanding is in 4.6C, SAP has provided the feature to send any report by e-mail in html format. So I dont think there is any custom code at my site for this. So I dont know how to locate that html and add this code into. Could you please tell me if it is SAP code needs to be changed?. If so how can I add this code?

If it is custom feature can you point me to the documentation to know what are all the steps involved to implement the e-mail feature.

Thanks,

Sobhan.

0 Kudos

Hi Sobhan,

How are you creating the HTML from your report? Are you calling function module WWW_HTML_FROM_LISTOBJECT? If so, you should be able to find the HTML code in the tables parameter "HTML".

You should be able to insert the CSS code into the "HTML" internal table using the examples in the posts above.

Regards,

Tammie

guillaume-hrc
Active Contributor
0 Kudos

Hi,

I insist : it is not possible with HTML to insert Page breaks. BUT, Tammie is right! You can use CSS (Cascade Style Sheet) to insert page breaks thanks to few lines of code in your HTML page.

Follow this link to have a look at a very simple piece of code to illustrate this :

http://www.codeave.com/css/code.asp?u_log=4016

Here it the code if you don't have access to this URL :

<html>
<head>
<title>CodeAve.com/CSS - Page Break</title>
<body bgcolor="#FFFFFF">
<center>
Page 1
<br style="page-break-before:always;">
Page 2
<br style="page-break-after:always;">
Page 3
<p>
Use print preview on your browser to see how<br>
this page would print out to three pages
</center>
</body>
</html>

Hope it helps.

Don't forget to close the post if solved (so that search in the forum is easier), and reward points (so that SDN members are happy !)

0 Kudos

I think the question has been answered.

Could you please close the question and award points ?

Thanks.

Cheers,

Guillaume

guillaume-hrc
Active Contributor
0 Kudos

Hi,

Either you try to modify after its generation like Tammie said, or you may want to modify this routine :

Program : SAPLSURL

Include : LSURLF04

Subroutine : WRITE_LINES

You will find that lines of your report are processed in the "LOOP AT list_lines ... ENDLOOP" part of this routine.

You have to determine from the various fields of the table list_lines which combination indicates that there is a page_break and then insert the CSS code accordingly.

Good luck and get back if necessary.

DOn't forget to award points if answers above are heplful.

Cheers.

Message was edited by: Guillaume Garcia

0 Kudos

Hi Guillaume,

Thank you so much for the detailed reply. I put a berak point to decide where exactly to add the code in the subroutine write_lines. But i didn't get a breakpoint in that subroutine. I am wondering this is the right place to add the CSS code.

Thanks,

Sobhan.

guillaume-hrc
Active Contributor
0 Kudos

<b>Could you explain us how you send your report ?</b>

If you do the operation :

<i>System -> List -> Save -> Local File (HTML)</i>

the breakpoints is working perfectly !

0 Kudos

Hi Guillaume,

Thank you so much for the reply.

I send an e-mail thru html format by the following path.

System>List->Send

And then I enter the recipient ---> e-mail id

recipient type--> internet address

and then i select the check box( expr. mail).

Thanks,

Sobhan.

0 Kudos

Hi All,

Any further ideas?

Thanks,

Sobhan.

guillaume-hrc
Active Contributor
0 Kudos

Well, when you send your report, it is added as a file with type 'ALI'. I assume that there is some conversion going on in order to convert it to HTML format when the recipient is an external address.

Just have to found out where...

Cheers,

0 Kudos

Hi,

A workaround solution would be to Submit your program and then convert the List into HTML and then send it by eMail.

You would have to modify the program I have given above and make indicated modifications.

Here is a blog you may find interesting, especially the part about "ABAP List as HTML" that may fulfill your requirements :

/people/thomas.jung3/blog/2004/09/07/sending-e-mail-from-abap--version-46d-and-lower--api-interface

By the way, it is not impossible that modifying the program would impact also the "Send" functionality as well.

Cheers,