‎2006 Dec 19 9:03 AM
hi friends,
why we should use loop statements both in PBO and PAI events for table control in module pool program.
regards,
malleswari.
‎2006 Dec 19 9:09 AM
hi,
kindly chk this.
PROCESS BEFORE OUTPUT.
MODULE status_9010.
LOOP WITH CONTROL tab_control.
"* This is to move the data from the internal table to the table control
MODULE move_data_to_table.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL tab_control.
"To move the data from the table control to internal table
MODULE move_data_from_table.
ENDLOOP.Rgds
anver
‎2006 Dec 19 9:09 AM
Hi Malleshwari,
We need the loop..endloop in both the PBO & PAI events of your screen because the LOOP statement causes the screen fields to be copied back and forth between the ABAP program and the screen field. For this reason, at least an empty LOOP...ENDLOOP must be there.
For more details on this, go to the documentation provided by SAP as under:
<a href="http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/frameset.htm">http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/frameset.htm</a>
Regards,
Chetan.
PS: Reward points if this is helpful.
‎2006 Dec 19 9:31 AM
Hello Malleswari,
The loop..endloop in the PBO is to populate the value into the table control from the program (internal table). The loop...endloop in the PAI is to copy the changes that have been made in the table control on the screen back into the internal table. It is anticipated that some data is passed from the program to the table control and some data is passed back as well. That is why when you dont specify the loop..endloop in PBO/PAI you get an error. This also explains why we write a dummy loop..endloop in PAI in some cases.
Manoj