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

internal table

Former Member
0 Likes
275

i have three three function codes.now my requirement is how to declare a internal table with function codes.

2 REPLIES 2
Read only

former_member189059
Active Contributor
0 Likes
257

This is the code to generate a dynamic internal table

DATA : LV_DBTAB1 LIKE DD02L-TABNAME.
DATA : DREF TYPE REF TO DATA.

FIELD-SYMBOLS: <ITAB> TYPE ANY TABLE, " used to store dynamic tables
               <WA>    TYPE ANY,      " used to store record data
                <WA1> TYPE ANY .      " used to store field data

  CREATE DATA DREF TYPE STANDARD TABLE OF (LV_DBTAB1)
                            WITH NON-UNIQUE DEFAULT KEY.
  ASSIGN DREF->* TO <ITAB> .


* selects all data
  SELECT * FROM (LV_DBTAB1) INTO TABLE <ITAB> .
  LOOP AT <ITAB> ASSIGNING <WA>.

"....

  endloop.

Read only

varma_narayana
Active Contributor
0 Likes
257

Hi..

Declare the ITAB using SY-UCOMM as the Data type.

Example:

Data : it_ucomm type Table of SY-UCOMM with header line.

IT_UCOMM = 'ADD'.

APPEND IT_UCOMM.

IT_UCOMM = 'SUB'.

APPEND IT_UCOMM.

SET PF-STATUS 'GUI1' EXCLUDING IT_UCOMM.

reward if Helpful.