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

Populate internal table values into table control screen in change mode

Former Member
0 Likes
1,222

Hi,

I need to paas internal table values into table control.

I am giving the below code, here

I_STOCK2 - Internal table having 2 records

I_STOCK - Internal Table which is mapped to screen.(STOCKNO, WEIGHT, 2 columns table)

STOCKNO1- Table control name.

LOOP AT i_stock2 INTO I_STOCK WITH CONTROL STOCKNO1 CURSOR

stockno1-current_line.

ENDLOOP.

But I am getting the below syntax error.

"LOOP" cannot be assigned to any field.

Please let me guide what's is the main issue here and how to come up with the solution approach.

Thanks for your responce.

Mahesh RG

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
975

Hi

Try this out.

in PBO

are you having same columns STOCKNO, WEIGHT in both I_STOCK2 and I_STOCK

else you need explicitly move them in the MOVE module as mentioned below

LOOP AT i_stock2 with CONTROL STOCKNO1.

module move.

endloop.

in program

module move.

move-corresponding i_stock2 to I_STOCK

endmodule.

Best Regards

Ramchander Rao.K

Edited by: Ramchander Krishnamraju on Dec 24, 2008 10:15 AM

Hi,

I need to paas internal table values into table control.

I am giving the below code, here

I_STOCK2 - Internal table having 2 records

I_STOCK - Internal Table which is mapped to screen.(STOCKNO, WEIGHT, 2 columns table)

STOCKNO1- Table control name.

LOOP AT i_stock2 INTO I_STOCK WITH CONTROL STOCKNO1 CURSOR

stockno1-current_line.

ENDLOOP.

But I am getting the below syntax error.

"LOOP" cannot be assigned to any field.

Please let me guide what's is the main issue here and how to come up with the solution approach.

Thanks for your responce.

Mahesh RG

5 REPLIES 5
Read only

Former Member
0 Likes
976

Hi

Try this out.

in PBO

are you having same columns STOCKNO, WEIGHT in both I_STOCK2 and I_STOCK

else you need explicitly move them in the MOVE module as mentioned below

LOOP AT i_stock2 with CONTROL STOCKNO1.

module move.

endloop.

in program

module move.

move-corresponding i_stock2 to I_STOCK

endmodule.

Best Regards

Ramchander Rao.K

Edited by: Ramchander Krishnamraju on Dec 24, 2008 10:15 AM

Read only

0 Likes
975

Hi ,

Both the tables are having the same fields as these two tables refering to same data base table.

But I am unable to pass the values since I am getting the erro as I mentioned above

"LOOP" cannot be assigned to any field. I am unable to find why this error is occuring.

Do you have any idea?...

Thanks for responding so quickly.

Regards,

Mahesh

Read only

0 Likes
975

Hi

Just check the spelling of your Table Control name in screen painter.

or do you have only one table control or more than one.

if you have more than one

then you need to write the loop statements both in PAI and PBO aswell for all the table controls that you mentioned on the screen.

and try to activate the whole program at once.I mean just double click on the main program and activate the entire program at once rather activating the flow logic alone. hope this is clear to you.

Regards

Ramchander Rao.k

Edited by: Ramchander Krishnamraju on Dec 24, 2008 10:36 AM

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
975

Hi,

In the flow logic of the screen, write the following code.

PROCESS BEFORE OUTPUT.

MODULE get_t_ctrl_lines.

LOOP AT itab WITH CONTROL t_ctrl CURSOR t_ctrl-current_line.

....

ENDLOOP.

In program, write the following code.

MODULE get_t_ctrl_lines OUTPUT.

SELECT * from db into table itab.

DESCRIBE TABLE itab LINES ln.

  • To make the vertical scroll bar to come on runtime

t_ctrl-lines = ln + 100.

ENDMODULE. " get_T_CTRL_lines OUTPUT

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
975

Hi,

Declare the table in program and activate the program.Then in screen, get from the program.Then use as below.

LOOP AT i_stock2 WITH CONTROL STOCKNO1 CURSOR..

..