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: 

table control

Former Member
0 Kudos
99

while creating table control why is it requied to write loop at in PAI ,if we are writting loop at in PBO

8 REPLIES 8

Former Member
0 Kudos
75

Hi,

Yes..LOOP AT is required both in PAI and in PBO..

LOOP AT ...is required in PAI to get the values changed in the table control..

Thanks,

Naren

Former Member
0 Kudos
75

Hi,

It is required as any modifications to the table control can be done when it passesthrough this loop.endloop statement.

Regards

Sailaja.

Former Member
0 Kudos
75

Hi

U need to write the same loop you've written in PBO

LOOP AT ITAB.

ENDLOOP.

If it's allowed to change the data in the table control, you need to insert a module to transfer the modification from table control to internal table:

LOOP AT ITAB.
  MODULE MODIFY_ITAB.
ENDLOOP.

MODULE MODIFY_ITAB.
  MODIFY ITAB INDEX <TABLE CONTROL>-CURRENT_LINE.
ENDMODULE.

Max

Former Member
0 Kudos
75

BOTH THE PLACE WE R USING LOOP STATEMENT IN PAI AFTER THE PBO GETTING DATA.

former_member196299
Active Contributor
0 Kudos
75

Hi Amit,

In module pool programs every time you click something on the screen PAI and PBO events gets triggered. In PAI we loop at the table control to collect the data present in it and this data is kept in a local buffer in your program . these values are then filled back to the table control screen fields in the PBO event from the buffer storage and the changes are then shown in your table control .

we do loop at in PAI especially for collecting the changes made in the table control values by the user .

Hope this explains you properly ..

Regards,

Ranjita

Former Member
0 Kudos
75

To get the records from the table control to ur internal table if u have done any modifications.

there are two kinds of loops, u can go through the below statements.

Table Control with LOOP - ENDLOOP - demo_dynpro_tabcont_loop

PBO.

flights-lines = fill. "DESCRIBE TABLE itab LINES fill.

LOOP WITH CONTROL FLIGHTS.

READ TABLE itab INTO demo_conn INDEX flights-current_line.

ENDLOOP.

PAI.

LOOP WITH CONTROL FLIGHTS.

lines = sy-loopc.

MODIFY itab FROM demo_conn INDEX flights-current_line.

ENDLOOP.

Table Control with LOOP AT ITAB - demo_dynpro_tabcont_loop_at

Table Control Modificatinos

PBO.

flights-lines = fill. "DESCRIBE TABLE itab LINES fill.

LOOP AT ITAB INTO DEMO_CONN WITH CONTROL FLIGHTS.

ENDLOOP.

PAI.

LOOP AT ITAB.

MODIFY itab FROM demo_conn INDEX flights-current_line.

ENDLOOP.

Hope this will solve ur problem..

<b><u>Dont forget to reward all the useful replies</u></b>

Sudheer

0 Kudos
75

U need to <b><u>award points for all the useful replies</u></b>, and also u nees to <b><u>mark it as Answered if ur problem is solved</u></b>.

Regards

Sudheer

Former Member
0 Kudos
75

Hi amit..

When we give loop in PBO it will process the steps and go to output..

To bring back to the input we are providing loop in PAI..

Reward if it's useful,

Reg'

Zeemaaaa..