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: 

why loop in pbo and pai

Former Member
0 Kudos

Hi,

Can anybody tell me we have to write loop

-


endloop

in both pbo and pai.

is loop in pai is mandatory.

what is its purpose in pai ? ?

regards,

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Phaneendra Punukollu,

While using table control, in PBO, we want to pass the data to

the table control. For that only following syntax used in PBO:


  LOOP AT ITAN INTO WA WITH CONTROL ZTC CURSOR ZTC-CURRENT_LINE.
    ....
  ENDLOOP.

In PAI, we want back in the internal table whatever changes made on the data in the table control. For that the follwing syntax used in PAI:


  LOOP AT ITAB.
    ....
  ENDLOOP.

The screen fields in table contol are not necessarily to have the

same field names as in internal table. In this case, the MOVE staement inside the LOOP used in PBO and PAI.

In PAI, MODIFY statement is used within a MODULE to update the internal table.

Regards,

R.Nagarajan.

-


We can -


2 REPLIES 2

former_member188685
Active Contributor
0 Kudos

it is mandatory only incase of Tablecontrol. the loop is responsible for adding/reading the entries of a table control line by line. PBO is for adding, PAI is for reading.

Former Member
0 Kudos

Hi Phaneendra Punukollu,

While using table control, in PBO, we want to pass the data to

the table control. For that only following syntax used in PBO:


  LOOP AT ITAN INTO WA WITH CONTROL ZTC CURSOR ZTC-CURRENT_LINE.
    ....
  ENDLOOP.

In PAI, we want back in the internal table whatever changes made on the data in the table control. For that the follwing syntax used in PAI:


  LOOP AT ITAB.
    ....
  ENDLOOP.

The screen fields in table contol are not necessarily to have the

same field names as in internal table. In this case, the MOVE staement inside the LOOP used in PBO and PAI.

In PAI, MODIFY statement is used within a MODULE to update the internal table.

Regards,

R.Nagarajan.

-


We can -