OBJECT(TASK):
In real time or in ABAP we name a task as object.
Manually Filling the Internal Tables.
Steps to create the program.
>>Execute S38(IN Cmd prompt).
>> Provide the program name starts with Y or Z
eg: zdemo_ internal_table
note: the name program does not allow extra characters or space, it allows only underscore.
>> Click on create.
>> Provide the Title(any thing for your understanding.)
>> Select the Type is Executable program.
>> Click on Save/enter.
>> Click on Local Object.
>> A new screen opens start writing the program.
program:
>> * declaring work area.(comment).
DATA : Begin of emp,
eid(10) Type C,
ename(25) Type C,
eadd(35) Type C,
End of emp.
*syntax of internal table declaration.(you can write in upper case or lower case since abap is case sensitive).
DATA emp1 LIKE TABLE OF emp.
* writing to work area and appending to internal table.
emp-eid = ' 1 '.
emp-ename = 'ALEX'.
emp-eadd = 'TEXAS'.
APPEND emp TO emp1.
emp-eid = ' 2 '.
emp-ename = 'KALLIS'.
emp-eadd = 'MEXICO'.
APPEND emp TO emp1.
emp-eid = ' 3 '.
emp-ename = 'DEVILERS'.
emp-eadd = 'DULLAS'.
APPEND emp TO emp1.
simallary this three fields are appended.
*loop for printing the data from internal table to work area.
*since we can write or read data from internal table through work area .
LOOP AT emp1 TO emp.
WRITE : / emp-eid, (/ is used for new line)
emp-ename,
emp-eadd.
ENDLOOP.
>> save ,check, activate the program and test it.(see above figure for this icons.)
>>Then output is displayed.








Comments
Post a Comment