Application Development and Automation 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: 
Read only

table control increment lines dynamically

Former Member
0 Likes
1,443

Hi,

i want to increment table control lines dynamically while creation only.i searched in sdn.i hav got the code as below to add in PBO.

tctrl --table control name


DESCRIBE TABLE it_cro_item LINES line.
  line = line + 25.
  tctrl-lines = line.

.

in my table control visible lines are 11 lines.after entering 11 lines for entering into 12th line im scrolling down, as soon as i scrolled down the 11 lines data is disappearing y it is happening like dis..

in my PAI i wrote like dis..

CASE ok_code.

WHEN 'SAV'.

wa_cro_it-mandt = sy-mandt.

wa_cro_it-zenquiry = w_enquiry.

wa_cro_it-zlineno = sy-stepl.

wa_cro_it-zpartno = zcro_item-zpartno.

wa_cro_it-zdesc = zcro_item-zdesc.

wa_cro_it-zcustmatno = zcro_item-zcustmatno.

wa_cro_it-zmake = zcro_item-zmake.

wa_cro_it-zoem = zcro_item-zoem.

wa_cro_it-zapplication = zcro_item-zapplication.

wa_cro_it-zquantity = zcro_item-zquantity.

wa_cro_it-zunit = zcro_item-zunit.

MOVE-CORRESPONDING wa_cro_it TO wa_cro_item.

insert into zcro_item values wa_cro_item.

endcase.

please do need ful.

THX

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
837

Hello,

check if you are moving every line from table control to internal table as it should happen in PAI.

If you have not handled then after you scroll the PAI is triggering and again loading empty internal table.

Thanks,

Augustin.

5 REPLIES 5
Read only

MarcinPciak
Active Contributor
0 Likes
837

DESCRIBE TABLE it_cro_item LINES line.

line = line + 25.

tctrl-lines = line.

With this code you reserve 25 more lines for table control than entries in table IT_CRO_ITEM. This means that these 25 remaining rows will be empty.

As for the scrolling in PAI it will be automatically provided for manual scroll, but if you would like to use PAGE DOWN, UP buttons simply set tab_control-top_line to desired line. This way you can scroll either by one or couple rows, or by entire page.

Regards

Marcin

Read only

Former Member
0 Likes
837

Hi,

If you want to dynamically increase the number of lines in the table control, the you can use the code that you have written. Your code will increase the number of lines in the table control to an additional 25 lines.

Regarding the problem with your scroll bar, whenever you scroll down or scroll up the table control, the PAI is triggered. So, debug whenever you scroll down and check where the table control data vanishes. Once your PAI is triggered after scrolling down, the PBO is triggered for displaying the table control back where I am sure you wouldnt have populated data in the table control. So, try populating data from the internal table or work area onto the table control fields in the PBO as well inside a module within the LOOP...ENDLOOP.

Read only

Former Member
0 Likes
838

Hello,

check if you are moving every line from table control to internal table as it should happen in PAI.

If you have not handled then after you scroll the PAI is triggering and again loading empty internal table.

Thanks,

Augustin.

Read only

Former Member
0 Likes
837

solved thx..

Read only

Former Member
0 Likes
837

solved thx..