‎2010 Jun 28 12:29 PM
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
‎2010 Jun 28 12:58 PM
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
‎2010 Jun 28 12:34 PM
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
‎2010 Jun 28 1:00 PM
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
‎2010 Jun 28 12:58 PM
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
‎2012 Jan 05 12:07 PM
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.