Application Development 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: 

Issue with dynamic internal table in 4.6c....

Former Member
0 Kudos

Hello Gurus,

I am using dynamic internal tables in 4.6C version as follows:

DATA: DREF TYPE REF TO DATA.
FIELD-SYMBOLS: <DYN_tables> TYPE STANDARD TABLE.

CREATE DATA DREF TYPE TABLE OF (COMP).

ASSIGN dref->* TO <dyn_tables>.

ABAP gives a error message warning saying that "type specification of "TABLE" is incomplete. Please help.

Regards,

Jainam.

Edited by: Jainam Shah on Mar 23, 2009 7:52 PM

1 ACCEPTED SOLUTION

former_member194669
Active Contributor
0 Kudos

I think is not accepted by CREATE DATA in 4.6c version

You need to use


  call method cl_alv_table_create=>create_dynamic_table
    exporting
      it_fieldcatalog = i_fcat
    importing
      ep_table        = i_content.
  if sy-subrc = 0.
    assign i_content->* to <ptab>.
  else.
    write: 'Error creating internal table'.
    stop.
  endif.

Regarding this above class you can find lot of example in this forum using search

4 REPLIES 4

former_member194669
Active Contributor
0 Kudos

I think is not accepted by CREATE DATA in 4.6c version

You need to use


  call method cl_alv_table_create=>create_dynamic_table
    exporting
      it_fieldcatalog = i_fcat
    importing
      ep_table        = i_content.
  if sy-subrc = 0.
    assign i_content->* to <ptab>.
  else.
    write: 'Error creating internal table'.
    stop.
  endif.

Regarding this above class you can find lot of example in this forum using search

0 Kudos

Hello Gurus,

I have written following code to fetch data in internal table <i_records>. I can see the data in the dynamic internal table during debug nut now I want to access the data of dynamic internal table and pass it to variable. How can access the data of dynamic internal table ?

DATA: DREF TYPE REF TO DATA.
  DATA: DREF_WA TYPE REF TO DATA.
  DATA: comp type DBOBJ_NAME.

  FIELD-SYMBOLS: <i_records> TYPE ANY.
  FIELD-SYMBOLS: <DYN_WA> TYPE ANY.



  SELECT SINGLE CONNECTION FROM TOAOM INTO V_LINKTABLE
         WHERE SAP_OBJECT = l_conct-sap_object    and
               AR_OBJECT  =  l_conct-ar_object.

  COMP = V_LINKTABLE.


  CREATE DATA DREF TYPE (COMP).
  CREATE DATA dref_WA TYPE (COMP).

  ASSIGN dref_WA->* TO <DYN_WA>.
  ASSIGN dref->* TO <i_records>.


  SELECT * FROM (COMP) INTO <i_RECORDS>
        WHERE SAP_OBJECT = L_CONCT-SAP_OBJECT
        AND   ARCHIV_ID  = L_CONCT-ARCHIV_ID
        AND   ARC_DOC_ID = L_CONCT-ARC_DOC_ID
        AND   AR_OBJECT  = L_CONCT-AR_OBJECT
        AND   AR_DATE    = SY-DATUM.

0 Kudos

HI,

Refer to this link..[Access dynamic internal table|]

Former Member
0 Kudos

hello ,

can you please tell me how did you finally correct your error,i have same problem but i dont know how to solve it