2008 Jan 18 5:47 AM
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
2008 Jan 18 6:10 AM
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.
2008 Jan 18 5:51 AM
no u cant....
u have to gv any one of the data type its mandatory.
2008 Jan 18 6:10 AM
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.
2008 Jan 22 1:51 AM