cancel
Showing results for 
Search instead for 
Did you mean: 

declare internal table for smartform

Former Member
0 Kudos

Hi,

Can anyone tell me how to declare an internal table for smartform?

Regards,

Sumedha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

If you need it as global object, you need to declare a type table and then declare your internal table based on that type.

So in the TYPE section:

TYPES: BEGIN OF TY_LINE,
                 FIELD1 TYPE ......,
                 FIELD2 TYPE ......,
                 FIELD3 TYPE ......,
             END OF TY_LINE.

TYPES: TY_TABLE TYPE TABLE OF TY_LINE.

And then in GLOBAL section u can define the internal table based on the tyoe TY_TABLE

Max

Former Member
0 Kudos

In the global section i have declared it as IT_TABLE TYPE TY_TABLE. But this works as a structure. Is there any other way to define it?

Former Member
0 Kudos

???

IT_TABLE has to be an internal table, but without header line, so u need to define a work are to manage IT_TABLE.

So u need to define IT_LINE type TY_LINE too.

Max

Former Member
0 Kudos

I got it. Thanks.

I was missing following statement.

TYPES: TY_TABLE TYPE TABLE OF TY_LINE.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi, you have quite a few areas when you can declare them.

If you want to declare them globally, just declare a custom type in the TYPES area and then declare the variable in the Global Data area (both being in the Global Definitions).

For local internal tables it's just the same as in a normal report.

Best regards,

George

Former Member
0 Kudos

I have to declare it in global area. i have tried the first option you gave but it acts as a structure and not internal table.