‎2010 Jun 22 3:14 PM
I have Internal table having 2000 entries.
Itab has four fields
MATNR werks desc priority.
The four column field priority has values u20181u2019 u20182u2019 and u20183u2019.
In the Internal table i need to check if value u20181u2019 does not exist in the internal table need to show as error.
I am using read table itab into wa_tab where priority NE u20181u2019.
If sy-subrc NE 0.
Write u2018Erroru2019.
Endif.
In the loop can we can use or any method do let me know.
Edited by: Rob Burbank on Jun 22, 2010 10:24 AM
‎2010 Jun 22 3:26 PM
SORT ITAB.
READ TABLE ITAB WITH KEY PRIORITY = '1'
TRANSPORTING NO FIELDS.
IF SY-SUBRC NE 0.
WRITE: / 'Error'.
ENDIF.
‎2010 Jun 22 3:28 PM
You can use:
LOOP AT itab WHERE priority EQ '1'.
IF sy-subrc NE 0.
* error
ENDIF.Rob
But I like Suhas' solution better
Edited by: Rob Burbank on Jun 22, 2010 10:31 AM
‎2010 Jun 22 3:45 PM
Hi, try this.
SORT itab By priority.
READ TABLE itab INDEX 1.
IF itab-priority <> '1'.
MESSAGE ..... TYPE 'E'.
ENDIF.