2006 Aug 29 11:07 AM
DATA: itab TYPE SORTED TABLE OF rec_type WITH UNIQUE KEY field1
WITH HEADER LINE.
itab-field1 = 'Company'. itab-field2 = '1234'. INSERT TABLE itab.
itab-field1 = 'Bank'. itab-field2 = 'ABC'. INSERT TABLE itab.
SORT itab.
LOOP AT itab.
write: /1 itab-field1, itab-field2.
ENDLOOP.
SELECT fld1 fld2 FROM tab1 WHERE fld3 = pfld3.
WRITE: /1 tab1-fld1, tab1-fld2.
ENDSELECT.
Message was edited by: kiran machavarapu
2006 Aug 29 11:12 AM
HI,
your are trying to sort sorted table which is wrong.
you can't sort a sorted table because it is already sorted.
<b>yes it give a syntax error.</b>
delete the following line.
<b> SORT itab.</b>
REgards,
2006 Aug 29 11:14 AM
What is your question?
REC_TYPE does not have a component called field1.
2006 Aug 29 11:16 AM
Hi,
In your prgram field1 is not there in rec_type.
DATA: itab TYPE SORTED TABLE OF rec_type WITH UNIQUE KEY <b>field1</b>
WITH HEADER LINE.
itab-field1 = 'Company'. itab-field2 = '1234'. INSERT TABLE itab.
itab-field1 = 'Bank'. itab-field2 = 'ABC'. INSERT TABLE itab.
SORT itab.
LOOP AT itab.
write: /1 itab-field1, itab-field2.
ENDLOOP.
Thank you,
Ramu N
2006 Aug 29 11:17 AM
for a sorted table,you no need to give SORT explicitly.by default all the records will be sorted based on the KEY you mention in the Definition.
i guess, you will get a syntax error if you SORT for a SORTED table.
Regards
srikanth
2006 Aug 29 11:27 AM
HI,
REC_TYPE is a structure with fields RECESC TYPE.
So, it is throwing a syntax error.
Regards,
Sailaja.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |