2009 Jan 14 6:02 AM
Hi all,
I want to fetch some data from a custom table, for which I have made an internal table taking all those fields which are needed in the correct order and , to avoid data type conflict I have made the non-character fields to character ones i.e.
for DATS(8) :- CHAR(10),
TIMS(6) :-CHAR(8),
QUAN(length-13, dec- 3) :- CHAR(17)
CURR( length-15, dec- 2) :- CHAR(18)
But still program gives Runtime Error.
Could anybody suggest a solution ?
How can we use developer trace ST11 for this ? Any procedure how to use ST11?
thanxxx
2009 Jan 14 6:50 AM
Hi,
In the following code where i am using char(10) for date is giving the error,
TABLES: pa0001.
TYPES: BEGIN OF t_pa0001,
pernr like pa0001-pernr,
begda(10),
endda(10),
END OF t_pa0001.
data: it_pa0001 type STANDARD TABLE OF t_pa0001 WITH HEADER LINE,
wa_it_pa0001 TYPE t_pa0001.
SELECT pernr begda endda from pa0001
into CORRESPONDING FIELDS OF TABLE it_pa0001
WHERE endda = '99991231'.but in the bellow code where i am using sy-datum or like pa0001-begda, pa0001-endda, it is working fine
TABLES: pa0001.
TYPES: BEGIN OF t_pa0001,
pernr like pa0001-pernr,
begda like sy-datum,
endda like pa0001-endda,
END OF t_pa0001.
data: it_pa0001 type STANDARD TABLE OF t_pa0001 WITH HEADER LINE,
wa_it_pa0001 TYPE t_pa0001.
SELECT pernr begda endda from pa0001
into CORRESPONDING FIELDS OF TABLE it_pa0001
WHERE endda = '99991231'.So, Please Change your code Accordingly,
Replay if any Issue,
Kind Regards,
Faisal
Edited by: Faisal Altaf on Jan 14, 2009 11:51 AM
2009 Jan 14 6:06 AM
2009 Jan 14 6:17 AM
Error in ABAP application program.
An exception occurred. This exception is dealt with in more detail below
. The exception, which is assigned to the class 'CX_SY_OPEN_SQL_DB', was
neither
caught nor passed along using a RAISING clause, in the procedure
"GET_DATA_CLOSED_ITEMS" "(FORM)"
The reason for the exception is:
The data read during a SELECT access could not be inserted into the
target field.
Either conversion is not supported for the target field's type or the
target field is too short to accept the value or the data are not in a
form that the target field can accept.
But I hv already checked the fields of int table and those are fine .
Pls revert me...on the same.........
2009 Jan 14 6:19 AM
hi,Ubhaka
Past your code for better understanding about your problem,
Kind Regards,
Faisal
2009 Jan 14 6:25 AM
Hi,
I dont know why u r converting those fields to char type.
Try to do conversion after your select query.
Thanks,
Srilakshmi.
2009 Jan 14 6:32 AM
Hello Ubhaka,
This error occured due to the data type or the length of the data type is insuffeciant or it is not compatable.
IT will be hard to provide any soultion without having a look at your code....
Can you paste your code...so that we can check and suggest what can be done to fix it.
Regards,
Kittu
2009 Jan 14 6:44 AM
Hello,
I want to fetch some data from a custom table, for which I have made an internal table taking all those fields which are needed in the correct order and , to avoid data type conflict I have made the non-character fields to character ones i.e.
for DATS(8) :- CHAR(10),
TIMS(6) :-CHAR(8),
QUAN(length-13, dec- 3) :- CHAR(17)
CURR( length-15, dec- 2) :- CHAR(18)
This is where you have committed the mistake, friend !!!
During data selection you cannot assign DATS, TIMS, QUAN & CURR field to character fields as you have done. It will lead to runtime error.
Please change the declaration of your internal table, it will work.
BR,
Suhas
2009 Jan 14 6:50 AM
Hi,
In the following code where i am using char(10) for date is giving the error,
TABLES: pa0001.
TYPES: BEGIN OF t_pa0001,
pernr like pa0001-pernr,
begda(10),
endda(10),
END OF t_pa0001.
data: it_pa0001 type STANDARD TABLE OF t_pa0001 WITH HEADER LINE,
wa_it_pa0001 TYPE t_pa0001.
SELECT pernr begda endda from pa0001
into CORRESPONDING FIELDS OF TABLE it_pa0001
WHERE endda = '99991231'.but in the bellow code where i am using sy-datum or like pa0001-begda, pa0001-endda, it is working fine
TABLES: pa0001.
TYPES: BEGIN OF t_pa0001,
pernr like pa0001-pernr,
begda like sy-datum,
endda like pa0001-endda,
END OF t_pa0001.
data: it_pa0001 type STANDARD TABLE OF t_pa0001 WITH HEADER LINE,
wa_it_pa0001 TYPE t_pa0001.
SELECT pernr begda endda from pa0001
into CORRESPONDING FIELDS OF TABLE it_pa0001
WHERE endda = '99991231'.So, Please Change your code Accordingly,
Replay if any Issue,
Kind Regards,
Faisal
Edited by: Faisal Altaf on Jan 14, 2009 11:51 AM
2009 Jan 14 7:46 AM
Hi,
Just use the same data types as in your z-table and do your retrieval. Do the conversion within your program.
Regards,
Dev.