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

BSP Programming: HTMLB TableView Iterator->local class

Hi to everybody!

With help of Brian McKellar's excellent Weblog:/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator

i am now able to create an iterator for a tableView. I use the application class. In his weblog he wrote:

"<i>Important: It is unfortunately not possible to implement local classes inside a BSP page. So we must implement the iterator interface somewhere else. For this article, a new class is created to implement the interface. If the HTMLB tableView is used in a view, another idea is to implement the iterator interface in the calling controller. Alternatively, place the iterator inside the application class. However, this approach becomes difficult when more than one iterator is required. The recommendation is to use local classes in such cases.</i>"

I have a BSP-Application with different tableViews on different pages. And if i understand the weblog right, than i should use local classe for each iterator.

And now comes my silly question, where i have to create the local classes? It is not possible to create it in the BSP-Page?!

Thanks for every hint.


Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on Jan 28, 2005 at 01:24 PM

    Hi Thorsten,

    you can of course create multiple local classes in an application class or in the controller class.

    Call se80 -> Select your existing class -> double-click on the class name.

    There are two buttons in the button row, "Types" for the local class definition and "Impl." for the local class implementation. Just click on them and start writing your code for the class.



    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2005 at 10:57 AM

    You have to create various iterators to deal with the logic, Tiest

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2005 at 06:51 PM

    Hi again,

    thanks all for the very helpful hints/messages.


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 30, 2005 at 10:22 AM

    Hallo Thorsten,

    Yes, someone that reads very carefully, and wish to break out of kindergarten. You are at the doorstep to a brave new world. Open the door and go! It changed my life once I realized this small secret about ABAP.

    In a normal programming language, say C++ or Java, you usually use a perfectly good editor, say NotePad, and you edit the code for the class definition (the include file) and the source code (the implementation file).

    But what the SE80 presents is a totally different view onto classes. There you get the class segmented into bits and pieces, with a corset pressing you into exactly this concept of what is an ABAP class. Then realized that ABAP, like any other modern language, is actually just source code, written in Notepad. You can write the class definition, and you can write the class implementation. The SE80 is just one view onto this. (To tell the truth, I also had a meister in the ABAP Language Group that showed me the way.)

    Writing code without SE80 implies that you really learn ABAP at a new level.

    So what are local classes? Same as in C++ or in Java. These are new (sub) classes that are defined within an existing class. They are only visible within the class, and can be completely used there.

    Enough said, let me give you a small example, and then see where we are. Start SE80, load class CL_SBSPEXT_HTMLB_APP. Double click to see it on the right. Now look at methods GET_TABLEVIEW_CONFIGURATION and GET_ITERATOR_GRAPHINLINE. There you see we are creating instances of new classes. But these new classes you not find as global classes in SE80!

    Repeat: start SE80, load class CL_SBSPEXT_HTMLB_APP, and double click to see on the right. Now follow Rainer's instructions. You are interested in the buttons "Types" and "Impl(ementation)" that are listed about the class in SE80. Press then, study the code. Within an hour the light should go on, and you will be launched on your new carreer as ABAP hacker within the company.


    PS: Why we use local classes? It is just a clean and nice technique to pack everything together. We never know when the 30character namespace is going to be filled:). One aspect you should keep in mind, all local classes are in the load of the global. So they do have a memory footprint. Everything is loaded together into PXA (but instantiated separately!).

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hallo Brian,

      thank you very much for your detailed explanation about SAP and classes. It makes live easier to have an example in front of you where you can experiment with.


      PS You should write more often in german 😉)

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.