‎2009 Apr 16 8:12 AM
Hi Guys,
When populating data into sorted internal table iam facing runtime errors.
my code is as.......
WA_ITAB-FIELDNAME = 'AAA'.
WA_ITAB-VALUE = C_VAR.
APPEND WA_ITAB TO IT_ITAB.
WA_ITAB-FIELDNAME = 'BBB'.
WA_ITAB-VALUE = C_VAR1.
APPEND WA_ITAB TO IT_ITAB.
WA_ITAB-FIELDNAME = 'CCC'.
WA_ITAB-VALUE = C_VAR2.
APPEND WA_ITAB TO IT_ITAB.
WA_ITAB-FIELDNAME = 'DDD'.
WA_ITAB-VALUE = C_VAR3.
APPEND WA_ITAB TO IT_ITAB.
Iam getting runtime eror "ITAB_ILLEGAL_SORT_ORDER" A line is to be inserted or changed at position 2 in the sorted internal table (type SORTED_TABLE).
Thanks,
Madhu
‎2009 Apr 16 8:18 AM
When you are appending records in a sorted table records should be entered in sorted order based on key fields.if the sort order is disturbed .you will get this runtime error .
What are the key fields of the table.
Instead of APPEND use INSERT statement it will work.
Regards,
Gurpreet
‎2009 Apr 16 8:18 AM
When you are appending records in a sorted table records should be entered in sorted order based on key fields.if the sort order is disturbed .you will get this runtime error .
What are the key fields of the table.
Instead of APPEND use INSERT statement it will work.
Regards,
Gurpreet
‎2009 Apr 16 9:08 AM