2010 Jan 12 12:21 PM
PARAMETERS: p_table LIKE dd02t-tabname OBLIGATORY.
SELECT *
FROM (p_table) CLIENT SPECIFIED
INTO CORRESPONDING FIELDS OF TABLE <dyn_table>
WHERE mandt = '800'.
mandt is the system client number as 800.
dyn_table: dynamic internal table
p_table = mara.
runtime error occurs at this statement.
SQL error in the database when accessing a table.
Kindly guide.
2010 Jan 12 1:33 PM
Hello
It is Basis Related Error.
Your code written without errors. It working fine for me (I have tested).
Hello
It is Basis Related Error.
Your code written without errors. It working fine for me (I have tested).
2010 Jan 12 12:26 PM
Dump details:
Database error text........: "CLI0111E Numeric value out of range.
SQLSTATE=22003 row=1 col=30"
Internal call code.........: "[RSQL/FTCH/MARA ]"
"DBIF_RSQL_SQL_ERROR" "CX_SY_OPEN_SQL_DB"
2010 Jan 12 12:38 PM
Hi,
can You also post a code for creation of <dyn_table>. There is probably an error in this internal table.
Regards,
Adrian
2010 Jan 12 12:41 PM
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table ).
idetails[] = ref_table_des->components[].
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa>,
<dyn_field>.
DATA: dy_table TYPE REF TO data,
dy_line TYPE REF TO data,
xfc TYPE lvc_s_fcat,
ifc TYPE lvc_t_fcat.
DATA : idetails TYPE abap_compdescr_tab,
xdetails TYPE abap_compdescr.
DATA : ref_table_des TYPE REF TO cl_abap_structdescr.
LOOP AT idetails INTO xdetails.
CLEAR xfc.
xfc-fieldname = xdetails-name .
xfc-datatype = xdetails-type_kind.
xfc-inttype = xdetails-type_kind.
xfc-intlen = xdetails-length.
xfc-decimals = xdetails-decimals.
APPEND xfc TO ifc.
ENDLOOP.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = ifc
IMPORTING
ep_table = dy_table.
ASSIGN dy_table->* TO <dyn_table>.
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.
2010 Jan 12 1:22 PM
Try
CASE xdetails-type_kind.
WHEN 'C'.
xfc-datatype = 'CHAR'.
WHEN 'N'.
xfc-datatype = 'NUMC'.
WHEN 'D'.
xfc-datatype = 'DATE'.
WHEN 'P'.
xfc-datatype = 'PACK'.
WHEN OTHERS.
xfc-datatype = xdetails-type_kind.
ENDCASE.instead of
xfc-datatype = xdetails-type_kind.You can also check this link:
http://wiki.sdn.sap.com/wiki/display/ABAP/DynamicInternaltable
Or try to do it like this:
http://wiki.sdn.sap.com/wiki/display/Snippets/Howtocreateadinamicinternaltable
It means to use FM REUSE_ALV_FIELDCATALOG_MERGE instead of using cl_abap_typedescr.
Adrian
2010 Jan 12 1:33 PM
Hello
It is Basis Related Error.
Your code written without errors. It working fine for me (I have tested).
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |