2006 Sep 04 6:35 AM
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".
2006 Sep 04 6:37 AM
2006 Sep 04 6:39 AM
Hi,
We can't use NE operator in the read statement. Pls try with different statement.
Regards,
Ram
2006 Sep 04 6:42 AM
2006 Sep 04 6:50 AM
Hi,
try:
READ TABLE int_kna1 WITH KEY KUNNR = int_intput-paycust.
if int_kna1-KTOKD NE '0012'.
...
else.
...
endif.A.
2006 Sep 04 6:56 AM
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
2006 Sep 04 7:09 AM
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
2006 Sep 04 9:28 AM
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.
2006 Sep 04 7:04 AM
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^
2006 Sep 04 7:22 AM
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..
2006 Sep 04 9:38 AM
Thanks a lot for every one problem is resolved.
i will reward to every one.