‎2007 May 15 4:59 PM
while creating table control why is it requied to write loop at in PAI ,if we are writting loop at in PBO
‎2007 May 15 5:03 PM
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
‎2007 May 15 5:03 PM
Hi,
It is required as any modifications to the table control can be done when it passesthrough this loop.endloop statement.
Regards
Sailaja.
‎2007 May 15 5:04 PM
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
‎2007 May 16 5:04 AM
BOTH THE PLACE WE R USING LOOP STATEMENT IN PAI AFTER THE PBO GETTING DATA.
‎2007 May 16 6:00 AM
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
‎2007 May 16 6:34 AM
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
‎2007 May 18 10:46 AM
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
‎2007 May 16 10:14 AM
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..