‎2007 May 23 1:26 PM
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
‎2007 May 24 2:10 PM
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
‎2007 May 23 1:30 PM
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
‎2007 May 23 2:32 PM
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.
‎2007 May 23 2:48 PM
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
‎2007 May 23 1:35 PM
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
‎2007 May 24 2:10 PM
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
‎2007 May 24 2:26 PM
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
‎2007 May 24 2:32 PM
‎2007 May 24 2:46 PM
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
‎2007 Sep 25 12:09 PM
Created the table control again. The first one was a bit messed up
Regards,
Munish