Skip to Content
author's profile photo Former Member
Former Member

Reducing the amount of code in htm pages :-)

Hi, I recently had to reduce the amount of abap business logic in a view.

The view was in a large multifunctional bsp that someone else had written, and to which I needed to add some code.

That view consisted of many htm includes, each include having an enormous amount of business logic determining the choice and parameters of htmlb expressions that were to be rendered by that view.

Thus I had view1 with many such includes: <%@include file="page_or_fragment.htm" %> and the includes would include further includes.

All this meant that the bsp was at its limit: adding 10 lines of htmlb code caused a dump : too much abap, branch offset limit reached.

End of project? 😔

The solution was simple, once found with the help of discussions in this forum and the online documentation:

1) Set the main controller lifetime to session.

2) In the view called by that controller, replace the biggest include statement:

<%@include file="biggest.htm" %> with the statement:

controller_for_biggest.do" >

3) Do not code comp_id on that call (it is prefixed to code later if you do, and the bsp has not been written that way).

4) Define a new view with the same content as the previous include, 'biggest.htm', let's call it 'biggest_view'.

5) Take out the begin and end tags for the htmlb content, page, and form extension elements from 'biggest_view'.

6) Define the new controller 'controller_for_biggest.do'

7) The new controller creates and then calls the new view in the normal way in via call_view( 'biggest_view' ).

So the project could restart.

I hope this is useful.

Kind regards David Lawn

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2004 at 11:20 AM

    Hey thanks for the insight!! Always nice to have post like this so I can do searching later.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 24, 2004 at 02:19 AM

    This is sound advice.

    I have an application that suffered from these "growing pains" and so I redesigned much of it with your advice.

    Good stuff.

    Add comment
    10|10000 characters needed characters exceeded