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

Dynamic Tables

Former Member
0 Likes
739

Hello everyone,

Guys I have some doubts about this:

1- when you say dymanic programming is all about create dynamic tables? , what does it exactly mean ? what for do you need create data object in run time. ??.

2. what does the symbol ->* means , i saw it in a example :

** Assign the dynamic table reference to a field-symbol
  ASSIGN dy_line->* TO <dyn_wa>.

but is only used for that ?? .

thank very much from someone who really want to understand this stuff.

1 ACCEPTED SOLUTION
Read only

Subhankar
Active Contributor
0 Likes
643

Hi,

1- When you don't know the table name or structure name unless run time at that time you required dynamic tables.

Ex. Suppose you have one selection screen parameter -->table name, and you want to upload the tables from the any file path..

In this case you don't know the exact table name unless run time.

2. Field Symbols: It is a data type which don't have any existence unless run time or alone. It just pointing to the memory address of any other variables.

3. ASSIGN dy_line->* TO <dyn_wa>.

Here dy_line 's data type is DATA. DATA is any one kind of data type which can store any kind values. Sign ->* means transfer properties of one variable to other variable .

Thanks '

Subhankar

3 REPLIES 3
Read only

RemiKaimal
Active Contributor
0 Likes
643

Hi,

Check out the code :


DATA:
  linetype TYPE string,
  itabref TYPE REF TO data,
  lineref TYPE REF TO data.
FIELD-SYMBOLS: 
  <fs> TYPE STANDARD TABLE,
  <fs1> TYPE ANY.
PARAMETER tbl LIKE rsrd1-tbma_val.

linetype = tbl.

CREATE DATA itabref TYPE STANDARD TABLE OF (linetype).
ASSIGN itabref->* TO <fs> .
CREATE DATA lineref LIKE LINE OF <fs>.
ASSIGN lineref->* TO <fs1>.
SELECT * FROM (tbl) INTO <fs1>.
  WRITE <fs1>.
ENDSELECT.
SELECT * FROM (tbl) INTO TABLE <fs>.

Cheers,

Remi

Read only

0 Likes
643

ASSIGN dy_line->* TO <dyn_wa>.

The meaning of the above line that you are assigning all the componants of dy_line to field symbol,

like dy_line may be a structre and structre has componants.....!

for eg. ASSIGN dy_line->field1 TO <dyn_wa>. hear...only field one componant of the line type or structre is assigned to teh field symbol...!

and dynamic programming is not always building internal tables runtime in the the example by Remi Kaimal

you had the DDIC ref. of the table entered by the user...but it may not be the case always...for more complex dynamicity you use RTTS ...ie. runtime type services...just search on SDN

Read only

Subhankar
Active Contributor
0 Likes
644

Hi,

1- When you don't know the table name or structure name unless run time at that time you required dynamic tables.

Ex. Suppose you have one selection screen parameter -->table name, and you want to upload the tables from the any file path..

In this case you don't know the exact table name unless run time.

2. Field Symbols: It is a data type which don't have any existence unless run time or alone. It just pointing to the memory address of any other variables.

3. ASSIGN dy_line->* TO <dyn_wa>.

Here dy_line 's data type is DATA. DATA is any one kind of data type which can store any kind values. Sign ->* means transfer properties of one variable to other variable .

Thanks '

Subhankar