Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Runtime error while data retrieval

Former Member
0 Likes
1,289

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

1 ACCEPTED SOLUTION
Read only

faisalatsap
Active Contributor
0 Likes
1,157

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

8 REPLIES 8
Read only

Former Member
0 Likes
1,157

Hi,

Can u tell me what error u got?

Thanks,

Srilakshmi.

Read only

0 Likes
1,157

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.........

Read only

0 Likes
1,157

hi,Ubhaka

Past your code for better understanding about your problem,

Kind Regards,

Faisal

Read only

0 Likes
1,157

Hi,

I dont know why u r converting those fields to char type.

Try to do conversion after your select query.

Thanks,

Srilakshmi.

Read only

Former Member
0 Likes
1,157

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

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,157

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

Read only

faisalatsap
Active Contributor
0 Likes
1,158

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

Read only

dev_parbutteea
Active Contributor
0 Likes
1,157

Hi,

Just use the same data types as in your z-table and do your retrieval. Do the conversion within your program.

Regards,

Dev.