Have you worked with field groups? Have you used Import/Export statements?

Showing Answers 1 - 2 of 2 Answers

sreenivas.B

  • Aug 28th, 2005
 

Internal tables are used to hold the records which have the fixed line structures.Where as Extract Datasets are used to hold the records which have different line structures. 
These records are defined by FieldGroups. 
FieldGroups are used to combine several fields under one name.But FieldGroup does not reserve memory to the fields but holds a pointer to the fields.

Field symbols can be created either with or without type specifications. If the type is not assigned to a field symbol, it inherits all the technical attributes of the field assigned to it. If the type is specified, the SAP system checks whether a match exists between the assigned field and the field symbol. The following syntax is used to declare a field symbol:
FIELD-SYMBOLS [typing].

DATA: BEGIN OF LINE,
COLA TYPE I,
COLB TYPE I,
END OF LINE.
DATA MyTable LIKE Hashed TABLE OF LINE WITH UNIQUE KEY
COLA.
*/Declaring a field symbol
FIELD-SYMBOLS LIKE LINE OF MyTable.
DO 4 TIMES.
LINE-COLA = SY-INDEX.
LINE-COLB = SY-INDEX ** 2.
INSERT LINE INTO TABLE MyTable.
ENDDO.
*/Reading a table with field symbol
READ TABLE MyTable WITH TABLE KEY COLA = 3 ASSIGNING
.
DATA: BEGIN OF LINE,
COLA TYPE I,
COLB TYPE I,
END OF LINE.
DATA MyTable LIKE Hashed TABLE OF LINE WITH UNIQUE KEY
COLA.
*/Declaring a field symbol
FIELD-SYMBOLS LIKE LINE OF MyTable.
DO 4 TIMES.
LINE-COLA = SY-INDEX.
LINE-COLB = SY-INDEX ** 2.
INSERT LINE INTO TABLE MyTable.
ENDDO.
*/Reading a table with field symbol
READ TABLE MyTable WITH TABLE KEY COLA = 3 ASSIGNING
.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions