‎2007 Apr 17 2:47 PM
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?
‎2007 Apr 17 2:54 PM
‎2007 Apr 17 3:12 PM
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>.
‎2007 Apr 17 3:14 PM
Try the first example in this link:
http://www.saptechnical.com/Tutorials/ABAP/DynamicInternaltable/DynamicInternalTable.htm
Regards,
Ravi
‎2007 Apr 17 5:26 PM
‎2007 Apr 17 5:29 PM
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.
‎2007 Apr 17 5:52 PM
Did u check the code? Have you got any idea about how to solve this problem?
I would be very greatfull.