Old School Programming Techniques

Part 1 – Multiple Tab Selection Screen in Module Pool Programming

For the past few years much of my time has been spent working on the newer and funkier programming techniques within SAP, such as WDA and ABAP OO, so when I was recently asked to do some dialog programming it dawned on me that I had not done done such programming in a long time.  And needed to get my head around the whole concept again.

It was likely that I wasn’t alone so why not blog about it. For two reasons, one, it gave me a chance to write down what I had done for future reference and two, share my experiences with others.

What

A tab is a useful way breaking up screens into separate sections. For example breaking a selection screen into Ticket and Contract Data.

contract_tab

tickets_tab

Why

Using tabs on busy, over crowded selection screen is a great way of making the selection screen tidier and aesthetically more pleasing to the user.

How

OK, so now we have see what is it and why we use it. Now we need to learn how to build it.

1) create a control for the tabstrip. This should always be created in the Top Include of the program. The type will always be of type TABSTRIP.

control_declaration

2) Create the tabstrip control on the screen via transaction SE51.

Click on icon tabstrip icon then size the Tabstrip control to the required size. The default number of tabs is always defaulted to two.

tabstrip_ctrl

Give the tabstrips a meaningful name and double click on the first tabstrip.

The screen painter attributes box will pop up.

screen_painter_attributes

Enter a function code and a Ref Field. The Red Field needs to be the same for all tabs.

Repeat this for all the tabs making sure a different function code is used for each tab.

3) In the PBO (Process Before Output) module set the default tab. This will depend on the tab selected by the user. This is why we maintain the Function Code.

How this is done is by setting the field ACTIVETAB of the tabstrip control to the Function code selected by the user.

set_tasb

4) In the PBO (Process Before Output) we call the Subscreen including the current screen number and program name.

call_subscreen

5) In the PAI (Process After Input) event we need to also declare the tabstrip control.

pai

That’s it’s. You should now have a working selection screen with multiple tabs.

Have fun.

Advertisement

Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.