Skip to Content
0
Former Member
Apr 25, 2007 at 07:30 PM

read table binary search

810 Views

Hi all ,

This is my code .some how my read statement is not workng . Can any one tell me what will be the issue with read statement?

FORM delete_entries.

DATA:v_indx LIKE sy-tabix.

*Get delete materials from zwplccrimsr table

SORT t_split BY matnr zwatctgp.

LOOP AT t_zwplccrimsr_hash.

READ TABLE t_split WITH KEY matnr = t_zwplccrimsr_hash-matnr

zwatctgp = t_zwplccrimsr_hash-zwatctgp

BINARY SEARCH.

v_indx = sy-tabix .

IF sy-subrc <> 0.

MOVE-CORRESPONDING t_zwplccrimsr_hash TO t_split.

t_split-xloek = 'X'.

APPEND t_split.

CLEAR t_split.

ELSE.

IF t_split-zwstdt = t_zwplccrimsr_hash-zwstdt AND

t_split-zweddt = t_zwplccrimsr_hash-zweddt AND

t_split-xloek = ' '.

DELETE t_split INDEX v_indx .

ELSE.

t_split-zwcrus = t_zwplccrimsr_hash-zwcrus. "V001

t_split-zwcrdt = t_zwplccrimsr_hash-zwcrdt.

t_split-zwcrtm = t_zwplccrimsr_hash-zwcrtm.

t_split-zwchus = 'CREST'.

t_split-zwchdt = sy-datum.

t_split-zwchtm = sy-uzeit.

MODIFY t_split INDEX v_indx.

ENDIF.

ENDIF.

ENDLOOP.

ENDFORM. "delete_entries

LINE