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

Can i create a ztable with Field Data type 'ANY'?

Former Member
0 Kudos
168

Hi,

Can i create a ztable with Data type 'ANY'? if yes, How?

Would you able to point out and any standard table with Field Data type 'ANY'?

I need to create ztable with field data type 'ANY'. i tried but i can't.

i appreciate your help.

...Naddy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Kudos
137

Hi

I think you can't. But you can use the type ANY in programs to declare varaibles to accept any type:

Example

REPORT demo_field_symbols_stat_assign .

FIELD-SYMBOLS: <f1> TYPE ANY, <f2> TYPE i.

DATA: text(20) TYPE c VALUE 'Hello, how are you?',

num TYPE i VALUE 5,

BEGIN OF line1,

col1 TYPE f VALUE '1.1e+10',

col2 TYPE i VALUE '1234',

END OF line1,

line2 LIKE line1.

ASSIGN text TO <f1>.

ASSIGN num TO <f2>.

DESCRIBE FIELD <f1> LENGTH <f2>.

WRITE: / <f1>, 'has length', num.

ASSIGN line1 TO <f1>.

ASSIGN line2-col2 TO <f2>.

MOVE <f1> TO line2.

ASSIGN 'LINE2-COL2 =' TO <f1>.

WRITE: / <f1>, <f2>.

The output is:

Hello, how are you? has length 20

LINE-COL2 = 1,234

The example declares two field symbols <F1> and <F2>. <F2> has the type I, which means that only type I fields may be assigned to it. <F1> and <F2> both point to different fields during the program.

Regards,

Renjith Michael.

3 REPLIES 3
Read only

Former Member
0 Kudos
137

no u cant....

u have to gv any one of the data type its mandatory.

Read only

Former Member
0 Kudos
138

Hi

I think you can't. But you can use the type ANY in programs to declare varaibles to accept any type:

Example

REPORT demo_field_symbols_stat_assign .

FIELD-SYMBOLS: <f1> TYPE ANY, <f2> TYPE i.

DATA: text(20) TYPE c VALUE 'Hello, how are you?',

num TYPE i VALUE 5,

BEGIN OF line1,

col1 TYPE f VALUE '1.1e+10',

col2 TYPE i VALUE '1234',

END OF line1,

line2 LIKE line1.

ASSIGN text TO <f1>.

ASSIGN num TO <f2>.

DESCRIBE FIELD <f1> LENGTH <f2>.

WRITE: / <f1>, 'has length', num.

ASSIGN line1 TO <f1>.

ASSIGN line2-col2 TO <f2>.

MOVE <f1> TO line2.

ASSIGN 'LINE2-COL2 =' TO <f1>.

WRITE: / <f1>, <f2>.

The output is:

Hello, how are you? has length 20

LINE-COL2 = 1,234

The example declares two field symbols <F1> and <F2>. <F2> has the type I, which means that only type I fields may be assigned to it. <F1> and <F2> both point to different fields during the program.

Regards,

Renjith Michael.

Read only

Former Member
0 Kudos
137

Use string data type for the same.