Application Development and Automation 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: 
Read only

Basic of Table Control

Former Member
0 Likes
1,111

Hi friends,

I have searched the forum several times but didnot get the answer to my question.

Pls. answer my qus : -

When we use Table Control in dialog programs, we use LOOP...ENDLOOP statements in order to exchange data between our program and Table Control UI elements.

In the SAP F1 Documentation, it is mentioned that "The Addition WITH CONTROL must be specified both at PBO and PAI" because we have to link the Internal Table (of our program) to Table Control (of the Screen).

But when i am adding that addition "WITH CONTROL" in the PAI event then it id=s giving me error stating that "In the event Process After Input, no additions are allowed with LOOP AT".

Regards,

Debi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
752

He Debi,

Please read the documentation carefully:

A copy is as below:

************************

Variant 1.

LOOP WITH CONTROL contrl.

...

ENDLOOP.

Effect

If the addition AT itab is not specified, during a loop pass the contents of the screen fields of the current row of table control contrl are transported from (at event PBO) or to (at event PAI) the data objects with the same names of the ABAP program. During PBO processing, the transport is done at the end of, during PAI processing at the beginning of the loop pass. The addition WITH CONTROL must be specified both at PBO and PAI.

Variant 2 .

LOOP AT itab CURSOR cur [INTO wa]

[CURSOR top_line] [FROM n1] [TO n2]

WITH CONTROL contrl.

...

ENDLOOP.

Effect

If you specify addition AT itab, during loop processing of the table control the internal table itab of the corresponding ABAP program is processed sequentially in parallel. For each row of the table control, one row of the internal table is processed. The internal table itab must be an index table. You can specify the additions INTO, CURSOR, FROM, TO and WITH CONTROL only at PBO, but not at PAI. At PAI, the internal table is used for reference to the table control.

************************

What you have said, is the case Variant 1 and it is correct. Second case (Variant 2) it is mentioned as u2018You can specify the additions INTO, CURSOR, FROM, TO and WITH CONTROL only at PBO, but not at PAI. At PAI, the internal table is used for reference to the table control.u2019

Regards,

Selva K

4 REPLIES 4
Read only

Former Member
0 Likes
752

Hi Debbidutta,

if the SAP documentation states what you say, then it is in error: WITH CONTROL must be defined only at PBO, not at PAI. I I think what the documentation means is that what must be defined at both PBO and PAI is the LOOP...ENDLOOP.

Roy

Read only

0 Likes
752

Hi Robb,

In the SAP Documentation it is mentioned clearly : - "The addition WITH CONTROL must be specified both at PBO and PAI. "

For your ref. pls. check :-

LOOP WITH CONTROL contrl.

...

ENDLOOP.

Effect

If the addition AT itab is not specified, during a loop pass the contents of the screen fields of the current row of table control contrl are transported from (at event PBO) or to (at event PAI) the data objects with the same names of the ABAP program. During PBO processing, the transport is done at the end of, during PAI processing at the beginning of the loop pass. The addition WITH CONTROL must be specified both at PBO and PAI.

Regards,

Debi

Read only

Former Member
0 Likes
753

He Debi,

Please read the documentation carefully:

A copy is as below:

************************

Variant 1.

LOOP WITH CONTROL contrl.

...

ENDLOOP.

Effect

If the addition AT itab is not specified, during a loop pass the contents of the screen fields of the current row of table control contrl are transported from (at event PBO) or to (at event PAI) the data objects with the same names of the ABAP program. During PBO processing, the transport is done at the end of, during PAI processing at the beginning of the loop pass. The addition WITH CONTROL must be specified both at PBO and PAI.

Variant 2 .

LOOP AT itab CURSOR cur [INTO wa]

[CURSOR top_line] [FROM n1] [TO n2]

WITH CONTROL contrl.

...

ENDLOOP.

Effect

If you specify addition AT itab, during loop processing of the table control the internal table itab of the corresponding ABAP program is processed sequentially in parallel. For each row of the table control, one row of the internal table is processed. The internal table itab must be an index table. You can specify the additions INTO, CURSOR, FROM, TO and WITH CONTROL only at PBO, but not at PAI. At PAI, the internal table is used for reference to the table control.

************************

What you have said, is the case Variant 1 and it is correct. Second case (Variant 2) it is mentioned as u2018You can specify the additions INTO, CURSOR, FROM, TO and WITH CONTROL only at PBO, but not at PAI. At PAI, the internal table is used for reference to the table control.u2019

Regards,

Selva K

Read only

Former Member
0 Likes
752

To sum up:

Option 1

PBO

LOOP WITH CONTROL tc...

PAI

LOOP WITH CONTROL tc...

Option 2

PBO

LOOP AT iTab WITH CONTROL tc...

PAI

LOOP AT iTab.