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

Dynamic internal table with problem

venkat_o
Active Contributor
0 Likes
478

Hi,

I have developed a program to update standard table. I am using dynamic internal table creation concept. But my dynamic internal table is having width only 1200 bytes. But many standard tables have more than that width. Do you have any input create dynamic internal table with more than 1200 bytes width..

Have a look at the error.

[http://3.bp.blogspot.com/_O5f8iAlgdNQ/SjYXTBpO92I/AAAAAAAAErI/Fs996_APHbE/s1600-h/error-792463.JPG|http://3.bp.blogspot.com/_O5f8iAlgdNQ/SjYXTBpO92I/AAAAAAAAErI/Fs996_APHbE/s1600-h/error-792463.JPG]

Expecting reply

Thanks

Venkat

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
436

Create dynamic internal table as follows.

Data: gv_tabname TYPE w_tabname.

Data: gv_dref TYPE REF TO data.

gv_tabname = 'required table name may be u can take this value from selection screen or any other method'.

FIELD-SYMBOLS: <gf_itab> TYPE STANDARD TABLE,

<wa> type any

CREATE DATA gv_dref TYPE TABLE OF (gv_tabname).

ASSIGN gv_dref->* TO <gf_itab>.

select * from (gv_tabname) into table <gf_itab>

where condition.

looo at <gf_itab> assigning to <wa>.

endloop.

may be this will help you.

3 REPLIES 3
Read only

Former Member
0 Likes
437

Create dynamic internal table as follows.

Data: gv_tabname TYPE w_tabname.

Data: gv_dref TYPE REF TO data.

gv_tabname = 'required table name may be u can take this value from selection screen or any other method'.

FIELD-SYMBOLS: <gf_itab> TYPE STANDARD TABLE,

<wa> type any

CREATE DATA gv_dref TYPE TABLE OF (gv_tabname).

ASSIGN gv_dref->* TO <gf_itab>.

select * from (gv_tabname) into table <gf_itab>

where condition.

looo at <gf_itab> assigning to <wa>.

endloop.

may be this will help you.

Read only

Former Member
0 Likes
436

Hi,

DATA: IT_TABSTRUC TYPE STANDARD TABLE OF DFIES INITIAL SIZE 0,

V_REF TYPE REF TO DATA,

V_I_AVL_CAT TYPE TABLE OF LVC_S_FCAT.

FIELD-SYMBOLS : <F_FS_DATA> TYPE STANDARD TABLE.

SELECTION-SCREEN:BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001

NO INTERVALS.

PARAMETERS: P_TABNAM TYPE X_TABNAME.

SELECTION-SCREEN:END OF BLOCK B1.

CALL FUNCTION 'DDIF_FIELDINFO_GET'

EXPORTING

TABNAME = p_tabnam

LANGU = SY-LANGU

TABLES

DFIES_TAB = IT_TABSTRUC

EXCEPTIONS

NOT_FOUND = 1

INTERNAL_ERROR = 2

OTHERS = 3.

LOOP AT IT_TABSTRUC .

V_LS_AVL_CAT-FIELDNAME = IT_TABSTRUC -FIELDNAME.

V_LS_AVL_CAT-REF_TABLE = P_TABNAM.

V_LS_AVL_CAT-REF_FIELD = IT_TABSTRUC -FIELDNAME.

APPEND V_LS_AVL_CAT TO V_I_AVL_CAT.

ENDLOOP.

CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE

EXPORTING

IT_FIELDCATALOG = V_I_AVL_CAT

IMPORTING

EP_TABLE = V_REF.

ASSIGN V_REF->* TO <F_FS_DATA>.

FREE V_REF.

SELECT * FROM (P_TABNAM) INTO CORRESPONDING

FIELDS OF TABLE <F_FS_DATA> .

Hope this resolves ur probs....

Read only

venkat_o
Active Contributor
0 Likes
436

Hi Sheelesh, Thanks for the input. It helped me a lot.