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

How to declare workarea?

Former Member
0 Likes
25,820

I declared this dynamic internal table as shown:


field-symbols: <tab> type standard table.

What code should I write to declare workarea of my internal table that i declared?

I declared this dynamic internal table as shown:


field-symbols: <tab> type standard table.

What code should I write to declare workarea of my internal table that i declared?

9 REPLIES 9
Read only

Former Member
7,444

DATA <work area> LIKE LINE OF <tab>.

OR

DATA <work area> TYPE <standard table>.

Regards,

Atish

Read only

0 Likes
7,444

I tried this code.


field-symbols: <tab> type standard table.
DATA wa LIKE LINE OF <tab>.

But I got this error http://img230.imageshack.us/img230/6861/screenog1.png

How do i solve this problem or should I use other codes?

Read only

0 Likes
7,444

Hi,

Sorry for my earlier reply. But the table which you defined using field-symbols you must need to assign.

i.e. for eg.

ASSIGN <internal table> TO <tab>.

only after this declaration <tab> become specific table type.

You can define generic work area like below.

FIELD-SYMBOLS <work area> TYPE any.

and now you can use as a work area of the internal table using ASSIGN keyword.

Regards,

Atish

Read only

0 Likes
7,444

Hi Atish,

can you give me example of the code you explain? as I am still sort of not sure.

Read only

0 Likes
7,444

Hi,

Can you tell me as why you are using field symbols then I can give you an example.

Regards,

Atish

Read only

0 Likes
7,444

I have this input field called IO_TABLE and a button. When the user key in the database name into IO_TABLE and press the button, the records/data in the database will be written out.

So i need to dynamically create an internal table to store the database entered in my IO_TABLE.

Read only

0 Likes
7,444

Hi,

So you can use the same table name to dynamically create a work area as I shown above.

Define

FIELD-SYMBOLS <work area> type any.

Now use this to dynamically create the work area.

Regards,

Atish

Read only

0 Likes
7,444

Yes I tried that. But I can't call this workarea when I tried create a table control using wizard. So what other method should I use to display the record of the table I enter at my IO_INPUT?

Read only

Former Member
0 Likes
7,444

Hi

Check Below..

TYPES DECLARATION..

BEGIN OF g_ty_conditions,

knumh TYPE konh-knumh,

vakey TYPE konh-vakey,

kbetr TYPE konp-kbetr,

kopos TYPE konp-kopos,

END OF g_ty_conditions .

INTERNAL TABLE

DATA g_t_conditions TYPE TABLE OF g_ty_conditions WITH HEADER LINE .

WORK AREA

DATA g_r_conditions LIKE g_t_conditions .

Hope It Helps.

Praveen