2005 Nov 15 1:29 PM
Hi,
I have itab data like this.
SEL-ITEMMATERIAL--QTY
X -
10----abcdes-----10
-
20-----xbyen-----20
-
30-----nhbeu-----30
If 'SEL' field having more than one 'X' i want to give message.
ponts guarantedd
kaki
2005 Nov 15 1:33 PM
Hi Kaki,
look at following
count type i value '0'.
loop at itab.
if itab-sel = 'X'.
count = count + 1.
if count gt '1'.
your code.
exit.*(if needed)
endif.
endif.
endloop.
hope it helps,
Regards,
Amit
2005 Nov 15 1:33 PM
Kaki,
loop at iTab into waTab.
<b>if waTab-sel+0(1) = 'X'.
if waTab-sel+1(1) = 'X'.
message ...
endif.
endif.</b>
endloop.
count = 0.
loop at iTab into waTab where sel = 'X'.
count = count + 1.
if count > 1.
message ...
endif.
endloop.
Thanks
Kam
Message was edited by: Kam
2005 Nov 15 1:35 PM
data: v_count.
clear v_count.
Loop at itab.
if itab-sel = 'X'.
v_count = v_count + 1.
if v_count > 2.
message e000 with 'XXXXXXXXXXXXXXXX'.
endif.
endif.
endloop.
2005 Nov 15 1:35 PM
Hi
Take a temp table.
data: v_lines type i.
itab_tmp[] = itab[].
delete itab_tmp where sel = ' '.
describe itab_tmp lines v_lines.
if v_line > 1.
message....
endif.
2005 Nov 15 1:35 PM
Hi Kaki,
How are you displaying this data to the user? Instead of giving this as a checkbox, why not give it as a radiobutton to the user?
Srinivas
2005 Nov 15 1:36 PM
2005 Nov 15 1:39 PM
data: wa like itab,
i type i.
i = 0.
loop at itab into wa.
if wa-sel = 'X'.
i = i + 1.
endif.
if i > 1.
exit.
endif.
endloop.
regards,
Hemendra
2005 Nov 15 1:50 PM
HI
READ TABLE with where condition
or
Put the records in another internal table using where clause.
And then check value of SY-TFILL
SY-TFILL : contains the number of lines in the relevant internal table
If it is greater than 1.Show a message.
MESSAGE eid(MSGCLASS) WITH text.
Or else Use Radio Button.So that user is not able to select two records.
For Sample code or Radio Button.
GO TO SE38:
Program name: <b>DEMO_AT_SELECTION_ON_RADIO</b>
Cheers,
Vijay Raheja