‎2007 Oct 23 4:09 AM
Hi all
I gt this internal table. Wad is the syntax to display all the data in the internal table. Below is my code for the internal table. I know i need to use a loop, however i do not know the loop statement. any help?
DATA: line(256) TYPE c,
text_tab LIKE STANDARD TABLE OF line,
field LIKE line.
START-OF-SELECTION.
line = 'Hello'.
APPEND line TO text_tab.
line = 'World'
APPEND line TO text_tab.
‎2007 Oct 23 4:10 AM
Hi,
LOOP AT text_tab INTO line.
Write:/ line.
ENDLOOP.
Regards,
Atish
‎2007 Oct 23 4:10 AM
check link how to write report
Reports
http://www.sapgenie.com/abap/reports.htm
http://www.allsaplinks.com/material.html
http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
DATA: line(256) TYPE c,
text_tab LIKE STANDARD TABLE OF line,
field LIKE line.
START-OF-SELECTION.
loop at text_tab.
line = 'Hello'.
APPEND line TO text_tab.
line = 'World'
APPEND line TO text_tab.
endloop.
here Hello and World will be get stored one below the others so you will get total records double than internal table size.
Minal Nampalliwar
null
‎2007 Oct 23 4:11 AM
You can use this syntax.
SORT TEXT_TAB.
LOOP AT TEXT_tAB.
WRITE:/ TEXT_TAB-LINE.
ENDLOOP.
For more details for WRITE and LOOP command check this link -
http://www.geocities.com/rmtiwari/Resources/Utilities/ABAPReference/ABAPReference.html
ashish
‎2007 Oct 23 4:20 AM
hi gary,
DATA: line(256) TYPE c,
text_tab LIKE STANDARD TABLE OF line,
field LIKE line.
START-OF-SELECTION.
line = 'Hello'.
APPEND line TO text_tab.
line = 'World'.
APPEND line TO text_tab.
<b>LOOP AT text_tab INTO field.
write : / field.
ENDLOOP.</b>
Reward me if useful,
Harimanjesh AN
‎2007 Oct 23 4:25 AM
Thank!
Instead of having a write statement, i want the record go into my database table. how can i achieve it. I need a insert statement. What is the syntax for this insert?
‎2007 Oct 23 4:26 AM
Hi,
This depend on the structure of your DB table.
Regards,
Atish
‎2007 Oct 23 4:33 AM
See my link which i mentioned earlier -
http://www.geocities.com/rmtiwari/Resources/Utilities/ABAPReference/ABAPReference.html
It contains syntax for all basic ABAP commands with example.
ashish
‎2007 Oct 23 4:33 AM
Hi gary,
Instead of write line:
============================
LOOP AT text_tab.
WRITE 😕 text_tab-line.
ENDLOOP.
==============================
You can append to another itab if your itab have similar datatype. you can do a loop to append to the itab like this:
=================================
LOOP AT text_tab.
APPEND text_tab-line TO itab.
ENDLOOP.
=========================
Regards,
Rayden
‎2007 Oct 23 11:29 AM
Hi
You can use modify or insert statement.For getting all syntax just type insert or modify in abap editor and place the cursor on that and press f1 you will get all the documentation for that.
Reward if useful.
Regards
Shibin
‎2007 Oct 23 4:21 AM
Check this sample code
DATA : BEGIN OF text_tab OCCURS 0,
line(50) TYPE c,
END OF text_tab.
START-OF-SELECTION.
text_tab-line = 'Hello'.
APPEND text_tab.
text_tab-line = 'World'.
APPEND text_tab.
LOOP AT text_tab.
WRITE :/ text_tab-line.
ENDLOOP.Regards
Gopi
‎2007 Oct 23 5:06 AM
Hi,
LOOP AT text_tab INTO field.
Write:/ field-line.
ENDLOOP.
<b>reward points if helpful.</b>
regards,
Vinod Samuel.