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: 

Module Pool - Table Control - Data not getting displayed in Control

Former Member
0 Kudos

Hi,

I have a table contol in my module pool program. In my processing I am filling an internal table & then in my PBO I am linking the internal table to table control. The issue is that even though the internal table is getting filled correctly (found through debugging), the data is not getting populated in table control. Nothing is populated on screen. I am writing part of code below

Declaration:

Types: begin of ty_control,

SELECTED TYPE C,

TEXT TYPE DPR_CAUSE_T-TEXT,

end of ty_control.

CONTROLS : TBL_CONT TYPE TABLEVIEW USING SCREEN '9001'.

DATA: lt_table_cont type TABLE OF ty_control with header line.

Fields in TBL_CONT:

TBL_CONT-SELECTED

TBL_CONT-TEXT

PBO Flow Logic:

MODULE STATUS_9001.

MODULE fill_data.

LOOP AT lt_table_cont WITH CONTROL TBL_CONT cursor TBL_CONT-top_line.

ENDLOOP.

PAI Flow Logic:

Loop at lt_table_cont.

MODULE UPDATE_DATA.

endloop.

MODULE USER_COMMAND_9001.

PLZ let me know what might be the problem. I have been trying to figure out but cant.

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Please check, whether the table control column name and the internal table field names are same.

Sharin.

9 REPLIES 9

former_member184551
Contributor
0 Kudos

Hi SOnali

Instead of using

cursor TBL_CONT-top_line

try cursor TBL_CONT-current_line

rgds

Sameer

0 Kudos

Hi Sameer,

I tried as you mentioned but even that has not helped. No data is getting populated.

Regards,

Sonali.

0 Kudos

hi,

try adding the module for fill_data inside the loop in the PBO..

Regards,

Former Member
0 Kudos

Hi,

Please check, whether the table control column name and the internal table field names are same.

Sharin.

Former Member
0 Kudos

Hi Sonali,

When ever you need to do anything with the table control, i mean if u want to display data in table control or you want to validate the data entered in table control Should be done within Loop and Endloop.(PBO or PAI's which ever is appropriate)

Here the data is not bieng displayed in ur table control because you have not used the MODULE fill_data between

LOOP AT lt_table_cont WITH CONTROL TBL_CONT cursor TBL_CONT-top_line.

ENDLOOP.

****************************************

so do it like this

LOOP AT lt_table_cont WITH CONTROL TBL_CONT cursor TBL_CONT-top_line.

MODULE fill_data

ENDLOOP.

*********************************

this will solve your problem.

Regards,

Syed

Former Member
0 Kudos

Hi Sonali,

Replace the PBO MODULE fill_data inside the loop and try. Hope it will work.

Regards,

Santosh

0 Kudos

Hi All,

Thanks for your replies. The module fill_data actually fills the internal table. So before the loop statement the internal table is already filled with the required data.

Now with the loop statement I just want that internal table data to get displayed in the table control. n this is not happening. Any clue as to why??

0 Kudos

u have to fill the values in the internal table to the table control and this has to be done inside the ' loop-endloop' statement. So try adding a new module inside the loop endloop. eg. module read_table..

and in pbo.. module read_table..

add .

if your table control screen field name is the name of your workarea,

read table 'internal-tablename' index tablecontrol-current_line into work-area.

or

if your table control screen field name is the name of your internal table (with header line ),

read table 'internal-tablename' index tablecontrol-current_line .

0 Kudos

Hi Suzie,

Thanks. But it works even if you dont write an explicit readstatement within the loop endloop.

I have finally found out what the issue was.

My field names on Screen were tablecontrolname-fieldname, where as they should have been internaltablename-fieldname.

Thanks,

Sonali.