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: 

Scrolling in table control

Former Member
0 Kudos
2,129

Hi all,

I am stuck in a problem related to scrolling in table control.

In the table control ( named TBCL ) there is a field that is mandatory. i.e. it needs to be filled.

Problems comes up when without filling all the values for all the ( 16 ) rows of the table control, I try to scroll down.

As soon as I try to scroll, PAI is trigerred and I am forced to enter row by row.

The field is an important one and should be made mandatory.

Can I set the length of the table control ? or provide scrolling down from 1st page to next? <b>PLEASE HELP</b>

My code is :

=========

PROCESS BEFORE OUTPUT.

MODULE status_1332.

LOOP AT it_zresb INTO wa_zresb WITH CONTROL tbcl.

MODULE get_data.

ENDLOOP.

PROCESS AFTER INPUT.

LOOP AT it_zresb .

MODULE put_data.

ENDLOOP.

MODULE user_command_1332.

whereas the declarations are:

=====================

CONTROLS : tbcl TYPE TABLEVIEW USING SCREEN '1332'.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
333

Hai Srivastava

Check the following Document

1) Screen tables

A table can be created in transaction. These tables, when designed on the screen are called as SCREEN TABLES.

These are of two types.

Table Controls and Step loops

These tables are treated as Loops.

2)Features of Table Controls

Data is displayed in the form of table.

Table control gives user the feeling of an actual table.

You can scroll through the table vertically as well as horizontally.

You can select rows and columns.

You can resize the with of columns.

You can have separator lines between rows and columns.

Automatic resizing of the table when the user resizes the window.

You can update information in the table control and it can be updated in the database table by writing code for it.

3)Steps for creating table control

Declaration of table control in module pool program.

Designing of table controls on the screen.

Passing data to table control in flow logic.

4)Declaration of TC in MPP

syntax:

controls <name of table control> type tableview using screen <escreen no.f>.

5)Designing Table control on screen

Click on Table in Control bar and place it on the screen. You can adjust the length and width of the Table Control.

Name the table control.(same name as given in data declaration).

From dictionary object OR from program fields select the fields and place them in the table control

6)Passing data to table control

Usually transfer of data from program to screen is automatic.

In case of TC, you need to explicitly transfer the data to table control.

ABAP/4 provides Loop statement, which is associated with flow logic to transfer the data.

7)Passing of data contd.

PBO.

Loop at <name of internal table> with control <name of table control> cursor <scroll variable>.

modulecc.

Endloop.

PAI.

Loop at < name of internal table>.Endloop.

<b>8)Scroll variables

Top_line : the row of table where the screen display starts.

Current_line : the row currently being processed inside a loop.</b>

9)Transfer of data from prg to TC.

With eLoop at cf statement, the first row is placed in the header of internal table.

If any module is specified between Loop and End loop, it will be executed. In this module, generally we will be assigning this internal table fields to table control screen fields.

The row in internal table is transferred to the TC as stated in the eLoop atc..f statement.

The system encounters the eEndloopf statement and control is passed back to the next line of internal table.

In the same way all the records of the internal table are passed to the TC.

Regards

Sreeni

5 REPLIES 5

Former Member
0 Kudos
334

Hai Srivastava

Check the following Document

1) Screen tables

A table can be created in transaction. These tables, when designed on the screen are called as SCREEN TABLES.

These are of two types.

Table Controls and Step loops

These tables are treated as Loops.

2)Features of Table Controls

Data is displayed in the form of table.

Table control gives user the feeling of an actual table.

You can scroll through the table vertically as well as horizontally.

You can select rows and columns.

You can resize the with of columns.

You can have separator lines between rows and columns.

Automatic resizing of the table when the user resizes the window.

You can update information in the table control and it can be updated in the database table by writing code for it.

3)Steps for creating table control

Declaration of table control in module pool program.

Designing of table controls on the screen.

Passing data to table control in flow logic.

4)Declaration of TC in MPP

syntax:

controls <name of table control> type tableview using screen <escreen no.f>.

5)Designing Table control on screen

Click on Table in Control bar and place it on the screen. You can adjust the length and width of the Table Control.

Name the table control.(same name as given in data declaration).

From dictionary object OR from program fields select the fields and place them in the table control

6)Passing data to table control

Usually transfer of data from program to screen is automatic.

In case of TC, you need to explicitly transfer the data to table control.

ABAP/4 provides Loop statement, which is associated with flow logic to transfer the data.

7)Passing of data contd.

PBO.

Loop at <name of internal table> with control <name of table control> cursor <scroll variable>.

modulecc.

Endloop.

PAI.

Loop at < name of internal table>.Endloop.

<b>8)Scroll variables

Top_line : the row of table where the screen display starts.

Current_line : the row currently being processed inside a loop.</b>

9)Transfer of data from prg to TC.

With eLoop at cf statement, the first row is placed in the header of internal table.

If any module is specified between Loop and End loop, it will be executed. In this module, generally we will be assigning this internal table fields to table control screen fields.

The row in internal table is transferred to the TC as stated in the eLoop atc..f statement.

The system encounters the eEndloopf statement and control is passed back to the next line of internal table.

In the same way all the records of the internal table are passed to the TC.

Regards

Sreeni

0 Kudos
333

hi Mr.

if u say that one of the feature of table ctrl is

'You can scroll through the table vertically as well as horizontally", why is my table ctrl cannot be scrolled vertically. I have 24 records in db, only 22 appear and i tried to scroll to 2 the other 2, but the scroll has no response. how can i make the scroll functioning. do i need to add additional code? i used table ctrl wizard to create the tc and my current version is 4.6c

Former Member
0 Kudos
333

HI,

have a look at this link ..

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac4435c111d1829f0000e829fbfe/content.htm

http://sts1.sts.tu-harburg.de/teaching/sap_r3/ABAP4/contro02.htm

also look at the sample program <b>demo_dynpro_tabcont_loop</b>

Regards

Sudheer

gopi_narendra
Active Contributor
0 Kudos
333

in the PBO of the Table control module wirte these statements

TABCTRL is the table control name

and itab is the internal table being passed to the table control.

describe table itab lines N.
tabctrl-lines = N.

Regards

Gopi

0 Kudos
333

Mr Gopi Narendra ,

I've done what u suggested above but still no response from the vartical scrollbar.

this is in my PBO:

PROCESS BEFORE OUTPUT.

module status_1000." declrare of pf-status

*&spwizard: pbo flow logic for tablecontrol 'TC001'

module TC001_init. "created by wizard

*&spwizard: module TC001_change_tc_attr.

*&spwizard: module TC001_change_col_attr.

loop at g_TC001_itab

into g_TC001_wa

with control TC001

cursor TC001-current_line.

*&spwizard: module TC001_change_field_attr

module TC001_move. "created by wizard

module TC001_get_lines. "created by wizard

module row.

endloop.