Skip to Content
0
Former Member
Aug 08, 2007 at 07:21 AM

Q: LIKE or = in WHERE and READ...

14 Views

Hi,

I have a problem with my code below. The problem is either in my SELECT-statement or in my READ-statement. I am having problems debugging so I cannot narrow it down. I have the following code:

SELECT DISTINCT MAT_SALES

FROM /BI0/PMAT_SALES

INTO TABLE i_mat_sales

WHERE /BIC/ZACCASGRP IS NULL

OR /BIC/ZACCASGRP LIKE ' '

OR /BIC/ZACCASGRP LIKE 'A1'

OR /BIC/ZACCASGRP LIKE 'C3'.

LOOP AT SOURCE_PACKAGE into source_wa.

T_INDEX = SY-TABIX.

READ TABLE I_MAT_SALES WITH KEY MSALE =

source_wa-MAT_SALES TRANSPORTING NO FIELDS.

IF SY-SUBRC NE 0.

DELETE SOURCE_PACKAGE INDEX T_INDEX.

ENDIF.

The MAT_SALES field and the ZACCASGRP fields are both of type CHAR, and I have changed my where to LIKE instead of = but for the READ is not possible to use LIKE.

Does anybody have any idea about what can be wrong in this code?

Thank you in advance,

Mikael