‎2007 Jun 08 10:49 PM
BEGIN OF t_ve,
AUFNR type zownerpost-AUFNR,
zzpool type zownerpost-zzpool,
ZZOWNER type zownerpost-ZZOWNER,
zzvalid_fr type zownerpost-zzvalid_fr,
zzvalid_to type zownerpost-zzvalid_to,
starttot type p decimals 2,
endtot type p decimals 2,
variation type p decimals 2,
discrepancy(10) type c,
END OF t_ve.
data : i_ve1 type standard table of t_ve.
data : wa_i_ve1 type t_ve.
loop at itab_s into wa_itab_s.
SELECT zzpool zzvalid_fr AUFNR zzOWNER FROM zownerpost
INTO table i_ve1
FOR ALL ENTRIES IN Itab_s
WHERE
zzPOOL EQ Itab_s-ZZPOOL
AND zzVALID_FR EQ Itab_s-ZZVALID_FR.
endloop.
it got activated, but when i tried to execute it,
it was giving the following error:
The following reason caused a runtime error:
In a select access, the read file could not be placed in the target field.
But as the above code i do not see any discrepancy.
can some one help.
‎2007 Jun 08 11:45 PM
hi ferry,
thanks for the reply,
but the error didnot change,
it still says the same error:
'in the select access the read file could not be placed in the target field provided.
Either the conversion is not supported for the type of target field,
the target field is too small to include the value '
‎2007 Jun 08 10:53 PM
Hi,
Please try this.
BEGIN OF t_ve,
AUFNR type zownerpost-AUFNR,
zzpool type zownerpost-zzpool,
ZZOWNER type zownerpost-ZZOWNER,
zzvalid_fr type zownerpost-zzvalid_fr,
zzvalid_to type zownerpost-zzvalid_to,
starttot type p decimals 2,
endtot type p decimals 2,
variation type p decimals 2,
discrepancy(10) type c,
END OF t_ve.
data : i_ve1 type standard table of t_ve.
data : wa_i_ve1 type t_ve.
IF NOT Itab_s[] IS INITIAL.
SELECT zzpool zzvalid_fr AUFNR zzOWNER
FROM zownerpost
INTO table i_ve1
FOR ALL ENTRIES IN Itab_s
WHERE zzPOOL EQ Itab_s-ZZPOOL
AND zzVALID_FR EQ Itab_s-ZZVALID_FR.
ENDIF.
Regards,
Ferry Lianto
‎2007 Jun 08 11:45 PM
hi ferry,
thanks for the reply,
but the error didnot change,
it still says the same error:
'in the select access the read file could not be placed in the target field provided.
Either the conversion is not supported for the type of target field,
the target field is too small to include the value '
‎2007 Jun 08 11:57 PM
Hi Saritha ,
Could you please try like this ?
SELECT AUFNR zzpool zzowner zzvalid_fr zzvalid_to
FROM zownerpost
INTO table i_ve1
FOR ALL ENTRIES IN Itab_s
WHERE zzPOOL EQ Itab_s-ZZPOOL
AND zzVALID_FR EQ Itab_s-ZZVALID_FR.
Hope this helps
Regards
Caglar
‎2007 Jun 09 12:21 AM
Change the SELECT to
SELECT zzpool zzvalid_fr AUFNR zzOWNER
FROM zownerpost
INTO corresponding fields of table i_ve1
FOR ALL ENTRIES IN Itab_s
WHERE zzPOOL EQ Itab_s-ZZPOOL
AND zzVALID_FR EQ Itab_s-ZZVALID_FR.
~Suresh
‎2007 Jun 09 1:01 AM
Hi Saritha change the query as
loop at itab_s into wa_itab_s.
SELECT zzpool zzvalid_fr AUFNR zzOWNER FROM zownerpost
INTO <b>CORRESPONDING FIELDS OF</b> table i_ve1
FOR ALL ENTRIES IN Itab_s
WHERE
zzPOOL EQ Itab_s-ZZPOOL
AND zzVALID_FR EQ Itab_s-ZZVALID_FR.
endloop.
Reward points if useful.
Regards,
Atish
‎2007 Jun 09 3:18 AM
Sarita,
A couple of errors in your approach. You are looping at itab_s yet you are using FOR ALL ENTRIES in your SELECT statement which is unnecessary. You either use the LOOP or the FOR ALL ENTRIES.
You are selecting the fields ZZPOOL ZZVALID_FR AUFNR ZZOWNER from the ZOWNERPOST table but you are moving them INTO TABLE i_ve1 which has the fields in different order. You cannot use INTO when the target fields are not of same type. Instead use INTO CORRESPONDING FIELDS OF TABLE or change the order you fields of the itab to match your SELECT statement.
If you are using LOOP instead of FOR ALL ENTRIES remember that your INTO TABLE will replace the contents of I_VE1 in every pass of the LOOP. In such cases you will have to use APPENDING TABLE or APPENDING CORRESPONDING FIELDS OF option.
Once you make these changes, the error should go away.
‎2007 Jun 09 3:26 AM
Hello Saritha,
either you arrange internal table properly ( I mean when you select the data what ever order is in internal table ,use same order in select query ) or into corresponding fields option.
Note : Into corresponding fields option is performance issue ,so use internal table order always.
‎2007 Jun 09 3:55 AM
HI saritha
Better to use the same field order in internal table as well as select statement.
Instead of using select in Loop, try to use for all entries. Because performance is faster in For all entries.
Regadrs
Ravi