Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error

Former Member
0 Likes
1,632

Guys,

iam getting error with the following simple code please help on this.

IF NOT INT_INPUT-paycust IS INITIAL.

READ TABLE int_kna1 WITH KEY KUNNR = int_intput-paycust

KTOKD NE '0012'.

endif.

-


error message is "=.." expected after "KTOKD".

10 REPLIES 10
Read only

Former Member
0 Likes
1,600

In the read statement you cannot use the operator NE .

Read only

Former Member
0 Likes
1,600

Hi,

We can't use NE operator in the read statement. Pls try with different statement.

Regards,

Ram

Read only

0 Likes
1,600

Even i used <> it is giving same error boss.

Read only

andreas_mann3
Active Contributor
0 Likes
1,600

Hi,

try:

READ TABLE int_kna1 WITH KEY KUNNR = int_intput-paycust.
if int_kna1-KTOKD NE '0012'.
 ...
else.
 ...
endif.

A.

Read only

Former Member
0 Likes
1,600

Guys,

I want to write code for this requirement.

-


loop at int_input.

Validate Customer Number

Read KNA1

Must be found.

If Account Group <> “0012” then

Read KNVH Where KUNNR = Customer Number

If found – move HKUNNR to output Customer Nbr.

Else move “Missing”.

endloop.

please help on this.

regards,

vijay

Read only

0 Likes
1,600

hi,

READ TABLE ITAB.... can RETURN ONLY 1 RECORD. if you use <> or > or any other operator other than = ,there is a possibility that it can match more than 1 record which READ TABLE can NOT process.

Thats why you can use only = in READ TABLE.

here is the logic,

IF NOT INT_INPUT-paycust IS INITIAL.
READ TABLE int_kna1 WITH KEY KUNNR = int_intput-paycust.
 if int_kna1-KTOKD NE '0012'.
   read table KNVH with key KUNNR = Int_kna1-kunnr.
   if sy-subrc = 0.
     move HKUNNR to <variable>.
   endif.
 else.
   write 'missing'.
 endif.
endif.

regards

srikanth

Message was edited by: Srikanth Kidambi

Read only

0 Likes
1,600

Vijay,

There are many ways to resolve the below..one of them is as indicated.

Loop at int_input.

clear int_kna1.

loop at int_kna1 where kunnr = int_input-kunnr and

acctgr <> '0012'.

Select hkunnr into outkunnr from knvh where kunnr =

int_input-kunnr.

endloop.

if sy-subrc <> 0.

outkunnr = 'Missing'.

endif.

endloop.

Read only

Former Member
0 Likes
1,600

hi

good

wrong->

IF NOT INT_INPUT-paycust IS INITIAL.

READ TABLE int_kna1 WITH KEY KUNNR = int_intput-paycust

KTOKD NE '0012'.

right->

IF NOT INT_INPUT-paycust IS INITIAL.

READ TABLE int_kna1 WITH KEY KUNNR = int_intput-paycust

where KTOKD NE '0012'.

try this out .

thanks

mrutyun^

Read only

Former Member
0 Likes
1,600

if KTOKD is common field to INT_INPUT and int_kna1.

Please try using the following code:

IF NOT INT_INPUT-paycust IS INITIAL

and INT_INPUT-KTOKD NE '0012'.

READ TABLE int_kna1 WITH KEY KUNNR = int_intput-paycust

KTOKD = INT_INPUT-KTOKD.

endif.

If if KTOKD is a field of int_kna1 only ,

try the following:

READ TABLE int_kna1 WITH KEY KUNNR = int_intput-paycust.

if int_kna1-KTOKD NE '0012'.

....

....

endif.

Hope it helps... pls don't forget to reward pts..

Read only

Former Member
0 Likes
1,600

Thanks a lot for every one problem is resolved.

i will reward to every one.