‎2007 May 31 7:19 AM
plz solve this query:
SELECT ERDAT KUNNR NAME1 NAME2 LAND1 REGIO ORT01 PSTLZ SORTL STRAS TELF1 MCOD1 MCOD2 MCOD3 FROM KNA1
INTO CORRESPONDING FIELDS
OF TABLE IKNA1 .
SELECT CHANGENR CHANGE_IND FROM CDHDR INTO CORRESPONDING FIELDS
OF TABLE ICDHDR for all entries in ikna1 WHERE OBJECTCLAS = 'DEBI' AND
<b>OBJECTID = IKNA1-KUNNR</b> AND UDATE IN S_UDATE.
here the bolded field are showing error as one is of length 90 and other of 10.
please help how to check this.
<b>error</b> - when using "for all entries in itab" the fields OBJECTID and IKNA-KUNNR must have same type and length
‎2007 May 31 8:17 AM
Hi,
While declaring type of ICDHDR
declare kunnr(90) type c.
it will solve your problem.
regards,
Ruchika
Reward if useful.
‎2007 May 31 7:22 AM
change field length of KUNNR in IKNA1 to 90.
Both the queries will work then.
‎2007 May 31 7:25 AM
‎2007 May 31 7:30 AM
then create one more table ikna1_temp, which will have KUNNR length as 90.
LOOP AT IKNA1.
MOVE-CORRESPONDING IKNA1 TO IKNA1_TEMP.
APPEND IKNA1_TEMP.
ENDLOOP.
and use the other table in second query.
Because the field type and length has to be same otherwise it will give an error
SELECT CHANGENR CHANGE_IND FROM CDHDR INTO CORRESPONDING FIELDS
OF TABLE ICDHDR for all entries in ikna1 WHERE OBJECTCLAS = 'DEBI' AND
OBJECTID = <b>IKNA1_TEMP-KUNNR</b> AND UDATE IN S_UDATE.
I had to take similar steps in order to get data from CDHDR table.
Message was edited by:
Darshil Shah
‎2007 May 31 7:35 AM
Hi,
create types,
begin of ty_knai,
kunnr(90) type c,
name1 type knai-name1,
name2 type kna1-name2,
.............
...........
mcod3 type knai-mcod3,
end of ty_knai.
data: iknai type standard table of ty_knai.
now use first select query as
SELECT ERDAT KUNNR NAME1 NAME2 LAND1 REGIO ORT01 PSTLZ SORTL STRAS TELF1 MCOD1 MCOD2 MCOD3 FROM KNA1
INTO TABLE IKNA1 .
regards,
sudha.
reward points if helpful
‎2007 May 31 8:17 AM
Hi,
While declaring type of ICDHDR
declare kunnr(90) type c.
it will solve your problem.
regards,
Ruchika
Reward if useful.
‎2007 May 31 10:09 AM
thanx to alll
for helping especially ruchika ..i did the same thing ...its working now