Skip to Content
author's profile photo
Former Member

Page break in html report

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?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • author's profile photo
    Former Member
    Sep 15, 2005 at 01:10 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • author's profile photo
    Former Member
    Sep 14, 2005 at 04:54 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 14, 2005 at 05:08 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 15, 2005 at 07:28 AM

    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 !) 😉

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 16, 2005 at 04:14 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo
    Former Member
    Sep 22, 2005 at 07:43 AM

    <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 !

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Sep 27, 2005 at 02:40 PM

    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,

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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,