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

table population

0 Likes
947

Hi Experts,

How is it can I populate the table on the fly?. The only input available for me is the table name.

5 REPLIES 5
Read only

former_member183519
Contributor
0 Likes
866

Hello Chirag,

You can use program: RSTABLESIZE

Determine SAP Table Size via Program RSTABLESIZE | SAPBASISINFO

Regards,

Hitesh

Read only

0 Likes
866

I think you have misunderstood the problem. I want to fill entries into an internal table of the type mentioned by the user during the execution itself. For eg. if the table entered is 'spfli' then the program should generate an internal table for 'spfli' and fill random details into it.

Read only

0 Likes
866

Some classic code as


DATA: itab TYPE REF TO data.

FIELD-SYMBOLS: <itab> TYPE STANDARD TABLE.

CREATE DATA itab  TYPE TABLE OF (tablename).

ASSIGN  itab->* TO <itab>.

But for "random detail" in the itab, be creative

Hint: for SPLFI, SFLIGHT, and the like, look at report SAPBC_DATA_GENERATOR

Regards,

Raymond

Read only

0 Likes
866

Hi Chirag,

Ok...

you can make use of field symbls as dynamic.

you can use link:-

Create table structure dynamically

Regards,

Hitesh

Read only

0 Likes
866

Dear Chiraz,


For generating the ALV for any table.

parameter table_name type char30.

start-of-selection

data lr_Data type ref to data.

field-symbol <fs> type standard table.

create data lr_data type ref to (table_name)  .   " this is the input table name.

assign lr_data->* to <fs>. " This will create your internal table.

select * from (table_name) into table <fs> up to 20 rows.

Now you can call the FM GRID_DISPLAY.

Thanks and Regards,
Nishant