‎2010 Jan 08 9:30 AM
Hi Friends,
I have been working on the Module Pool for the last two weeks. But Iam unable to get the main difference between
the " LOOP WITH CONTROL TABCON " and " LOOP AT ITAB WITH CONTROL TABCON CURSOR TABCON-CURRENT_LINE ".
Please make me clear on this issue.
Thanking you in advance,
Regards,
Murali Krishna
‎2010 Jan 08 7:27 PM
LOOP AT ITAB WITH CONTROL TABCON CURSOR TABCON-CURRENT_LINE means
In PBO the data is moving from internal table to table control
For the ist time when the current_line will be 1.
please check the below example..
When the system encounters
LOOP AT IT_SCARR INTO SCARR WITH CONTROL TC_SCARR
CURSOR TC_SCARR-CURRENT_LINE.
Endloop.The cursor will be on the ist line
The ist record from internal table it_scarr is moved to work area SCARR and is placed in the table control TC_SCARR in the column current_line. An then cursor moves to the second position, it comes back to the internal table it_scarr and picks up the 2nd record and place that in the work area SCARR and will be placed to the 2nd row of the table control.
LOOP WITH CONTROL TABCON means looping the table control..Regards
Satish Boguda
Edited by: Rob Burbank on Jan 8, 2010 4:10 PM
‎2010 Jan 08 7:27 PM
LOOP AT ITAB WITH CONTROL TABCON CURSOR TABCON-CURRENT_LINE means
In PBO the data is moving from internal table to table control
For the ist time when the current_line will be 1.
please check the below example..
When the system encounters
LOOP AT IT_SCARR INTO SCARR WITH CONTROL TC_SCARR
CURSOR TC_SCARR-CURRENT_LINE.
Endloop.The cursor will be on the ist line
The ist record from internal table it_scarr is moved to work area SCARR and is placed in the table control TC_SCARR in the column current_line. An then cursor moves to the second position, it comes back to the internal table it_scarr and picks up the 2nd record and place that in the work area SCARR and will be placed to the 2nd row of the table control.
LOOP WITH CONTROL TABCON means looping the table control..Regards
Satish Boguda
Edited by: Rob Burbank on Jan 8, 2010 4:10 PM
‎2010 Jan 08 8:30 PM
This is copied from sap documentation
link:[Table Controls in the Flow Logic|http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbac5135c111d1829f0000e829fbfe/frameset.htm]
LOOP WITH CONTROL ctrl.
...
ENDLOOP.
These statements create a loop pass through the step loop rows displayed on the screen.
For PAI, they transfer the data of each group into the identically-named fields of the ABAP program or, vice versa,
for PBO from the ABAP program into the step loop fields.
In the LOOP-ENDLOOP loop, you can call modules that process the transferred data and for
PBO read from an internal table, or for PAI import into an internal table.
LOOP AT itab [INTO wa] WITH CONTROL ctrl.
...
ENDLOOP.
This statement assigns an internal table itab of the ABAP program to the table control and
triggers a parallel loop run over the table control rows displayed on the screen and over the internal table itab.
The additions INTO and WITH CONTROL are possible at the time of PBO, but not at PAI.
The assignment of the loop to the table control takes place at PAI through the internal table.
Using the INTO addition, the fields of the internal table itab are written to the work area wa at the time
of PBO and the content of wa is transported, line by line, to the identically-named fields of the table control
on the screen. Without the INTO addition, you must use an internal table with a header line.
Then the content of the header line is transported line by line to the
identically-named fields of the table control on the screen at the time of PBO.
No module is required for filling the table control rows.
Conversely, at the time of PAI, the internal table rows are not automatically
filled with the contents of the table control rows. Instead, you must call a
dialog module within the loop that modifies the table.
‎2010 Jan 08 9:12 PM
Keshav - no need to post both the link and the documentation.
Next time, please just post the link.
Rob
‎2010 Jan 09 7:00 AM
Hi Rob,
Julius Bussche informed me once that posting links without any suggestion is not encouraged and will be deleted.
Here it was hard for me explain the difference in my own words , so just thought of highlighting the part.
Regards,
Keshav
‎2010 Jan 11 3:34 AM
Keshav - there used to be a problem in the forum where a poster would ask a question and some responders would post a large (25 or more) number of links without really bothering to understand what the question was asking. That is what we tried to eliminate - successfully I think.
So a simple "have a look at: whatever link" is not a problem. But posting the content of the link doesn't really add anything.
Rob