2008 Aug 02 7:25 AM
How can we loop an internal table without using a workarea of it's line type?
<Has nothing to do with ABAP Objects - moved to ABAP General. Please choose your forums more carefully in future>
Edited by: Mike Pokraka on Aug 4, 2008 9:33 AM
2008 Aug 04 6:38 AM
Hi ,
you can loop an internal table without an workarea by using field-symbols.
FIELD-SYMBOLS: <ls_record> TYPE ANY.
LOOP AT itab ASSIGNING <ls_record>.
...
ENDLOOP.
the field symbol acts an an counter to the internal table. the field symbol can also be declared as the type of the internal table.
Regards ,
Debojyoti.
Hi ,
you can loop an internal table without an workarea by using field-symbols.
FIELD-SYMBOLS: <ls_record> TYPE ANY.
LOOP AT itab ASSIGNING <ls_record>.
...
ENDLOOP.
the field symbol acts an an counter to the internal table. the field symbol can also be declared as the type of the internal table.
Regards ,
Debojyoti.
2008 Aug 02 7:28 AM
to access a internal table you always need a work area whether implicit or explicit that is with header line or without header line.
refer to the link below:
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb36a1358411d1829f0000e829fbfe/content.htm
http://www.sap-img.com/abap/how-loop-works-in-internal-tables.htm
With luck,
Pritam.
2008 Aug 02 7:29 AM
hi,
in case of Loop At to an internal table you need to use work area.
however you may not use Explicit Work area if you work with Internal table with header line.
In that case the syntax will be
LOOP AT itab.
.......
.......
ENDLOOP.here one work area having same as that of the internal table is created inplicitly.
Regards,
anirban
2008 Aug 02 8:09 AM
hi
create an explicit work area like internal table .
loop at itab into wa_area
write: wa_area-fields,
..........
endloop.
2008 Aug 02 9:32 AM
Hello
You can use a field-symbol instead:
FIELD-SYMBOLS: <ls_record> TYPE ANY.
LOOP AT itab ASSIGNING <ls_record>.
...
ENDLOOP.
Regards
Uwe
2008 Aug 02 1:11 PM
Hi.
What you actually want is this:
LOOP AT itab TRANSPORTING NO FIELDS.
.....
ENDLOOP.
This syntax does not require any workarea.
2008 Aug 04 6:38 AM
Hi ,
you can loop an internal table without an workarea by using field-symbols.
FIELD-SYMBOLS: <ls_record> TYPE ANY.
LOOP AT itab ASSIGNING <ls_record>.
...
ENDLOOP.
the field symbol acts an an counter to the internal table. the field symbol can also be declared as the type of the internal table.
Regards ,
Debojyoti.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |