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: 

Table control isnt enough rows

kowong
Participant
0 Kudos

Hi all,

how should i set the height / number of row of a table control....

with the table scroll-able ..

for example, the height is 20, but it contain 50 rows..

this table is empty...'

because my problem is..

the number of rows is limited to be same as the height.'

i cant enter data row more than the table control's height....

what setting should be done to make it unlimited entry.

Thank you

Message was edited by: Kokwei Wong

Message was edited by: Kokwei Wong

Message was edited by: Kokwei Wong

Message was edited by: Kokwei Wong

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

In the PBO of the table control screen you should put the following code:

PROCESS BEFORE OUTPUT.

MODULE initialize.

......

MODULE initialize OUTPUT.

tablecontrol-lines = X. 'Number of lines you want

You must have the table control active for input. If not

tablecontrol-line_sel_mode = 2. 'Activate tablecontrol

Hope it helps,

Mireia

2 REPLIES 2

Former Member
0 Kudos

Hi Kokwei,

use this standard program and go through the code .

<b>demo_dynpro_tabcont_loop</b>

Do have a look on the sample piece of code.

(assume that the name of your table control is T1)

In the screen logic you will have:

Loop with control T1.

module get_Looplines.

Endloop.

Module get_looplines.

Looplines = sy-loopc.

Endmodule.

In the PBO of the screen you will have a module that loads the itab and determines the total number of lines read.

Module load_itab.

. (select database table and

append to itab)

.

describe table itab lines linecount.

Endmodule.

We now have all the values to construct a scroll module.

MODULE SCROLL INPUT.

CASE SAVE_OK_CODE.

WHEN 'P--'.

T1-TOP_LINE = 1.

WHEN 'P-'.

T1-TOP_LINE = T1-TOP_LINE - LOOPLINES.

IF T1-TOP_LINE < 1.

T1-TOP_LINE = 1.

ENDIF.

WHEN 'P+'.

T1-TOP_LINE = T1-TOP_LINE + LOOPLINES.

IF T1-TOP_LINE > LINECOUNT.

T1-TOP_LINE = LINECOUNT - LOOPLINES + 1.

ENDIF.

WHEN 'P++'.

T1-TOP_LINE = LINECOUNT - LOOPLINES + 1.

ENDCASE.

ENDMODULE. " SCROLL INPUT

WHEN 'P--'.

CLEAR SY-UCOMM.

CTR1-TOP_LINE = 1.

WHEN 'P-'.

CLEAR SY-UCOMM.

CTR1-TOP_LINE = CTR1-TOP_LINE - LINECOUNT1.

IF CTR1-TOP_LINE < 1.

CTR1-TOP_LINE = 1.

ENDIF.

WHEN 'P+'.

DESCRIBE TABLE ITAB1 LINES N1.

CTR1-TOP_LINE = CTR1-TOP_LINE + LINECOUNT1.

IF CTR1-TOP_LINE > N1.

CTR1-TOP_LINE = N1.

ENDIF.

CLEAR SY-UCOMM.

WHEN 'P++'.

DESCRIBE TABLE ITAB1 LINES N1.

CLEAR SY-UCOMM.

CTR1-TOP_LINE = N1.

This will enable ur scoll bar with any number of fields.

For More refernce just check the same thread:

Hope this will help you.

Cheers

Sunny

Rewrd points, if found helpful

Former Member
0 Kudos

Hi,

In the PBO of the table control screen you should put the following code:

PROCESS BEFORE OUTPUT.

MODULE initialize.

......

MODULE initialize OUTPUT.

tablecontrol-lines = X. 'Number of lines you want

You must have the table control active for input. If not

tablecontrol-line_sel_mode = 2. 'Activate tablecontrol

Hope it helps,

Mireia