04-21-2007 10:16 AM
I want to know concept of table(array). i want to take name of 5 student from user and display on screen.how can i increment variable.
04-21-2007 10:22 AM
hi
you use internal table to fetch the data from database and use it for further processing. this will help you decrease hitting the Database frequently and hence improve your performance.
in ur case:
REPORT ZM1 .
DATA: BEGIN OF ITAB OCCURS 0, " Internal table
NAME(30), " Char type
END OF ITAB.
SELECTION-SCREEN BEGIN OF BLOCK B1.
PARAMETER: P_NAME LIKE ITAB-NAME.
SELECTION-SCREEN END OF BLOCK B1.
START-OF-SELECTION.
SELECT <field>
FROM <table>
INTO TABLE ITAB
WHERE <condition>.
IF SY-SUBRC = 0.
LOOP AT ITAB.
WRITE:/ ITAB-NAME.
ENDLOOP.
ENDIF.
**reward if helpful
regards,
madhu
04-21-2007 10:22 AM
hi
you use internal table to fetch the data from database and use it for further processing. this will help you decrease hitting the Database frequently and hence improve your performance.
in ur case:
REPORT ZM1 .
DATA: BEGIN OF ITAB OCCURS 0, " Internal table
NAME(30), " Char type
END OF ITAB.
SELECTION-SCREEN BEGIN OF BLOCK B1.
PARAMETER: P_NAME LIKE ITAB-NAME.
SELECTION-SCREEN END OF BLOCK B1.
START-OF-SELECTION.
SELECT <field>
FROM <table>
INTO TABLE ITAB
WHERE <condition>.
IF SY-SUBRC = 0.
LOOP AT ITAB.
WRITE:/ ITAB-NAME.
ENDLOOP.
ENDIF.
**reward if helpful
regards,
madhu
04-23-2007 6:27 AM
no , i do not want to fetch data from database. i just want to save date in a internal table temporarly and want to display it on screen using write statement.
04-23-2007 6:47 AM
Hi Mohit,
you can create an internal table and append data to that table. using the write statement you can display data what you have appended.
DATA: BEGIN OF ITAB OCCURS 5, " Internal table
NAME(20) type 20,
END OF ITAB.
itab-name = 'mohit'.
append itab.
itab-name = 'abc'.
append itab.
. .. . .
. . . .
. . . .
IF SY-SUBRC = 0.
LOOP AT ITAB.
WRITE:/ ITAB-NAME.
ENDLOOP.
ENDIF.
this code will display the data inserted by you.
reward all the helpful answers.
regards
vivek
04-23-2007 7:11 AM