‎2007 Jul 30 5:15 AM
If data types of 2 fields are different how to compare???????????
Please let me know the solution and do needful
SELECT exnum
exdat
remtime
lifnr
rdoc
budat
FROM j_1iexchdr INTO CORRESPONDING FIELDS OF TABLE it_j_1iexchdr
FOR ALL ENTRIES IN it_mseg
WHERE rdoc = it_mseg-mblnr
AND ryear = it_mseg-mjahr.
Displayed message while developing a report
When you use the addition "FOR ALL ENTRIES IN itab", the fields "RYEAR"
and "IT_MSEG-MJAHR" must have the same type and the same length.
‎2007 Jul 30 5:25 AM
Hi,
U can assign the value of 'IT_MSEG-MJAHR' to a Temporary Variable of type rdoc.
Like,
<b>data : temp like j_1iexchdr-rdoc.</b>
.....
.....
<b>temp = IT_MSEG-MJAHR.</b>
SELECT exnum
exdat
remtime
lifnr
rdoc
budat
FROM j_1iexchdr INTO CORRESPONDING FIELDS OF TABLE it_j_1iexchdr
FOR ALL ENTRIES IN it_mseg
WHERE <b>rdoc = temp</b>
AND ryear = it_mseg-mjahr.
Regards,
Padmam.
‎2007 Jul 30 5:27 AM
data: begin of ty_db.
v_mjahr(length) type c. " type c
end of
SELECT exnum
exdat
remtime
lifnr
rdoc
budat
FROM j_1iexchdr INTO CORRESPONDING FIELDS OF TABLE it_j_1iexchdr
FOR ALL ENTRIES IN it_mseg
WHERE rdoc = it_mseg-mblnr
AND ryear = it_mseg-mjahr
‎2007 Jul 30 5:31 AM
Hi,
Usually this error will occur when we are using the FOR ALL ENTRIES option.
For this you can declare a temporary variable in your first internal table as the type of RYEAR.loop at that table and move the value to that temporary variable.
Now you can use that variable in the where condition.
reward will be helpful.
rgds
harris
‎2007 Jul 30 5:33 AM
Dear Ray,
data element of j_1iexchdr -ryear is J_1IRYEAR1 --> <b>CHAR (data type) 4(data length)</b>
datalement of mseg-mjahr is MJAHR --> <b>NUMC (data type) 4 (data length)</b>
You have to define internal table it_j_1iexchdr with MJAHR as below:
<b>data: begin of it_j_1iexchdr occurs 0,
.......
mjahr(4) type c,
.......
end of it_j_1iexchdr.</b>
<b>Reward Points for useful answers....
Regards,
Moqeeth.</b>