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

Error in select - dynamic table

Former Member
0 Likes
1,157

HI

Im creating a dynamic internal table and fetching values and displaying.

select * from (p_table) into corresponding fields of table <dyn_table>.

This statement works well for small tables as PRHI , PRPS , PROJ etc

when i trying exceuting the same for EKKO,BSEG and other bigger tables it gives short dump whereas small tables it works fine.

Why is this happening

can you suggest some way to rectify it ?

Thanks in advance

Swarna

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,106

Why are you using INTO CORRESPONDING FIELDS??? If your dynamic table holds the structure of the table, you should do it like this...


  SELECT *
  INTO TABLE <ROW>
  FROM (MY_TAB).

Also, refer to my weblog...It might help you out...

[Taking good care of Z Data|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3340] [original link is broken] [original link is broken] [original link is broken];

Greetings,

Blag.

7 REPLIES 7
Read only

Former Member
0 Likes
1,106

Can you tell what is the dump saying?

Regards,

Atish

Read only

0 Likes
1,106

The dump says

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

Read only

0 Likes
1,106

HI,

I think there is something wrong in your code for dynamic table creation. just see in the debugging if dynamic internal table is of same type of DB table.

Regards,

Atish

Read only

Former Member
0 Likes
1,106

well since you dont get a overflow of your tablespaces, the problem got to be at the declaration of your table <dyn_table>. seems like he wants to move a value into a field which is not big enough to take the value.

Read only

Former Member
0 Likes
1,106

When i debug im getting the fields in my dynamic internal table for all tables.

Also only for tables with lots of columns asLIPS, EKKO ,EKPO it is throwing error.

The same code works fine for tables like t001,t005,prhi,prps,proj tables which have a fewer columns compared to the previous mentioned tables.

Is there any fix on the max number of columns ?

Read only

Former Member
0 Likes
1,107

Why are you using INTO CORRESPONDING FIELDS??? If your dynamic table holds the structure of the table, you should do it like this...


  SELECT *
  INTO TABLE <ROW>
  FROM (MY_TAB).

Also, refer to my weblog...It might help you out...

[Taking good care of Z Data|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3340] [original link is broken] [original link is broken] [original link is broken];

Greetings,

Blag.

Read only

0 Likes
1,106

Thank you so much. I took a bit of help from your blog ..Taking good care of the Z data and found out i missed out in the declaration part (I committed a stupid Careless mistake).

Thanks

Swarna