Skip to Content
0
Former Member
Nov 24, 2006 at 04:53 PM

on change query

28 Views

Hi all,

loop at itAB.

ON CHANGE OF ITAB-ID.

clear : NEWNO ,id.

call function 'CONVERSION_EXIT_ALPHA_INPUT'

exporting

input = ITAB-ID

importing

output = ID.

select single max( NO ) from zXXX into NEWNO

where id = id AND WERKS = ITAB-werks.

if sy-subrc eq 0.

NEWNO = NEWNO + 1.

else.

NEWNO = 1.

endif.

ENDON.

The select statement is returning a value of 0 even when the record is not found.

I tried deleting all the records in ztable and then also it returns a value of 0.

Thanks

PREETI