‎2007 Apr 21 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.
‎2007 Apr 21 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
‎2007 Apr 21 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
‎2007 Apr 23 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.
‎2007 Apr 23 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
‎2007 Apr 23 7:11 AM
thanks to solve my problem. hope we keep on going in future also