2008 Jul 16 6:41 PM
Hi Experts,
Am filling the my_itab(which does hv 1 filed of Order), by doing some processing.
Always, the Order # shuld b the same.
If in any case, there r multiple Orders in this itab of DIFFERENT, I need throw ERROR message.
So, instead of looping the itab, checking each entry explicitly, Is there any Statement, Clause, sytax?
thanq
Edited by: Srinivas on Jul 16, 2008 1:46 PM
2008 Jul 16 6:47 PM
Hi,
Try this..
SORT MY_ITAB BY ORDER_NO.
DELETE ADJACENT DUPLICATES FROM MY_ITAB COMPARING ORDER_NO.
* get the number of entries.
DESCRIBE TABLE MY_ITAB.
IF SY-TFILL > 1.
* Raise an error message if the number of entries is greater than 1.
message e208(00) with 'More than one order number'.
ENDIF.
Thanks
naren
2008 Jul 16 6:47 PM
Hi,
Try this..
SORT MY_ITAB BY ORDER_NO.
DELETE ADJACENT DUPLICATES FROM MY_ITAB COMPARING ORDER_NO.
* get the number of entries.
DESCRIBE TABLE MY_ITAB.
IF SY-TFILL > 1.
* Raise an error message if the number of entries is greater than 1.
message e208(00) with 'More than one order number'.
ENDIF.
Thanks
naren
2008 Jul 16 6:48 PM
Hi,
Declare another varialbe of the Order type and assign the value to it.
w_order = itab-order.
Loop itab where itab-order = w_order.
if w_order eq itab-order.
message 'Same order number' type 'E'.
endif.
w_order = itab-order.
endloop.
Reward if helpful.
Regards
Chandralekha