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 programing

0 Kudos

while writing module pool programing by using table controls, we r using loop at and endloop in both pbo and pai.

pls can any one answer why we need this and functionality of loop in both pbo and pai

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Hareesh,

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.

3 REPLIES 3

Former Member
0 Kudos

in PAI we use so that the process will be done record by record and

in PBO we use in order to transfer to multiple records to the table control.

regards,

seenu

<b>reward with necessary points if helpful</b>

Former Member
0 Kudos

Hi Hareesh,

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.

0 Kudos

Hi

In addition to the above post ,

At the PBO event ,

the loop ..endloop , the data/records/fields are populated in the table control

acoording to the select condition/querry.Thus u get multiple rows in the table

control at PBO event .

At PAI event , the records of table control are generally read to monitor /check any changes done to the fields in the table control.In case of the affirmative , these changes are saved in the underlying database tables. for this purpose , the Dbase tables are modified from the internal tables in the ABAP program , which in turn are updated from the table control.

This requires the LOOP..Endlop block to check changes at record level.

During the process , there is the movement of data from the screen fields to the ABAP program fields and vice versa . This is done /performed at PBO/PAI event automatically. However , the flow of data from screen fields to program fields can be controlled using CHAIN...ENDCHAIN block in the Flowlogic of the screen.

i hope this resolves ur query to a certain extent.

Regards

Pankaj