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

Exception using dynamic tables

Former Member
0 Likes
783

I'm using a dynamic table, but when i try to load data of pa0006 i got the following exception

In an SQL array select, the internal table used to hold the

selected records must be at least as wide as the database table

from which the records are being read.

In this particular case, the database table is 733 bytes wide,

but the internal table is only 727 bytes wide.

Any ideas?

6 REPLIES 6
Read only

Former Member
0 Likes
757

Can you show your code?

Regards,

Ravi

Read only

Former Member
0 Likes
757

data: gt_fieldcat type LVC_T_FCAT,

gt_table type ref to data.

data: ls_fieldcat type lvc_s_fcat.

DATA: MODIFICAR VALUE ''.

field-symbols: <gt_table> type table,

<wa_table> type any,

<dyn_PERNR>,

<DYN_SUBTY>,

<Dyn_objps>,

<dyn_sprps>,

<dyn_endda>,

<dyn_begda>,

<dyn_itxex>,

<dyn_seqnr>.

data: it_dfies type standard table of dfies,

wa_dfies type dfies,

lv_table type ddobjname value 'PA0016'.

*select single kotab from t681 into lv_table

  • where kvewe = 'A' and kotabnr = '005' and kappl = 'V'.

CALL FUNCTION 'DDIF_NAMETAB_GET'

EXPORTING

TABNAME = lv_table

TABLES

DFIES_TAB = it_dfies

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

ENDIF.

loop at it_dfies into wa_dfies.

ls_fieldcat-fieldname = wa_dfies-fieldname.

ls_fieldcat-inttype = wa_dfies-inttype.

ls_fieldcat-outputlen = wa_dfies-outputlen.

append ls_fieldcat to gt_fieldcat.

clear: wa_dfies.

endloop.

CALL METHOD cl_alv_table_create=>create_dynamic_table

EXPORTING

it_fieldcatalog = gt_fieldcat

IMPORTING

ep_table = gt_table.

ASSIGN gt_table->* TO <gt_table>.

SELECT *

FROM (lv_table)

into table <gt_table>.

Read only

0 Likes
757
Read only

Former Member
0 Likes
757

I couldn't make it work. Has anyone checked the code???

Read only

Former Member
0 Likes
757

the dynamic internal table created has x no of fields length.

when ur selecting data from table, the no of fields are exceeding than the x no of fields due to which it is unable to hold data.

Read only

0 Likes
757

Did u check the code? Have you got any idea about how to solve this problem?

I would be very greatfull.