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 - Values not displayed

Former Member
0 Likes
4,636

Hi Folks,

We are using a table control to display data from an internal table. Table has proper data(say 5 rows in our case). All the calculations are proper which are based on these 5 rows only. But while displaying only first row is displayed. Also, data is stored properly in the database after we pass the table control screen.

What do you think could be the reasons?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,707

Hey Guys,

Thanks a lot for all your replies!!

My problem was (and still is) that first row is displayed on the first page. Then remaining lines on this page are blank & input disabled. Rest of the 3 rows are displayed on the next page. By making use of navigation buttons I am able to get to that.

Any thoughts on how can I fix it? I want all the rows to be displayed on first page only.

Thanks,

Munish

9 REPLIES 9
Read only

Former Member
0 Likes
2,707

Hi

U should past your code used to manage the PBO, probably the data aren't correctly transfer from internal table and table control.

How to transfer the data depends on which fields you have used to design the table control.

Max

Read only

0 Likes
2,707

In the PBO:

loop with control inst_plan.

module display_data_0300.

endloop.

Module is:

READ TABLE t_inst_plan INDEX inst_plan-current_line. (tab containing data)

IF sy-subrc NE 0.

EXIT FROM STEP-LOOP.

ENDIF.

fkkop-betrh = t_inst_plan-betrh. (Screen fields)

fkkop-faedn = t_inst_plan-faedn.

Read only

0 Likes
2,707

Hi

It should be ok, but the code you're using it's used for the STEP-LOOP, it's older way than TABLE CONTROL to display the data of a table.

Anyway it usually works for table control too.

U can try to replace it with:

loop at t_inst_plan  with control inst_plan cursor t_inst_plan-current_line.
module display_data_0300.
endloop.

module display_data_0300.
fkkop-betrh = t_inst_plan-betrh. 
fkkop-faedn = t_inst_plan-faedn. 
endmodule.

Before the LOOP of PBO try to check the values of field LINES of table control, it should have the number of records of internal table, you can force it by a module:

module set_lines.
loop at t_inst_plan  with control inst_plan cursor t_inst_plan-curren_line.
module display_data_0300.
endloop.

module set_lines.
describe table t_inst_plan lines t_inst_plan-lines.
endmodule.

module display_data_0300.
fkkop-betrh = t_inst_plan-betrh. 
fkkop-faedn = t_inst_plan-faedn. 
endmodule.

Max

Read only

Former Member
0 Likes
2,707

Hi Munish,

It is coming due to write statement. Are you writing the statement like this:

Write itab.

If yes then it will show only last record. You need to use like this:

WRITE:/ itab.

Ashven

Read only

Former Member
0 Likes
2,708

Hey Guys,

Thanks a lot for all your replies!!

My problem was (and still is) that first row is displayed on the first page. Then remaining lines on this page are blank & input disabled. Rest of the 3 rows are displayed on the next page. By making use of navigation buttons I am able to get to that.

Any thoughts on how can I fix it? I want all the rows to be displayed on first page only.

Thanks,

Munish

Read only

0 Likes
2,707

Hi

Before looping the table control try to check the value of t_inst_plan-lines, its values should be the number of the record of the internal table.

Max

Read only

0 Likes
2,707

checked that... thst correct number

Read only

0 Likes
2,707

Hi

Try to write:

READ TABLE t_inst_plan INDEX inst_plan-current_line.
IF sy-subrc = 0.
*EXIT FROM STEP-LOOP.
  fkkop-betrh = t_inst_plan-betrh. (Screen fields)
  fkkop-faedn = t_inst_plan-faedn. 
ELSE.
  CLEAR fkkop.
ENDIF.

Max

Read only

0 Likes
2,707

Created the table control again. The first one was a bit messed up

Regards,

Munish