Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can you create an internal table dynamically?(at run time)

Answer Posted / ganesh sawant

REPORT Dynmic Table .

PARAMETERS: table(20),
rows TYPE i DEFAULT 100.

* Declare the variable for holding your internal table
DATA: itab TYPE REF TO data.

* Three field symbols requried 1. for acessing table data..second work area and third individual fields.
FIELD-SYMBOLS: <fs_table> TYPE ANY TABLE,
<fs_wa> TYPE ANY,
<field> TYPE ANY.
TRY.
* Create internal table
CREATE DATA itab TYPE STANDARD TABLE OF (table).
* Let our Field Symbol point to it so we can acess its data afterwords.
ASSIGN itab->* TO <fs_table>.

* put data into internal table
SELECT * FROM (table) UP TO rows ROWS INTO TABLE <fs_table>.

* Loop over internal tabel with the help of field symbol pointing to its data
LOOP AT <fs_table> ASSIGNING <fs_wa>.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_wa> TO <field>.
IF sy-subrc EQ 0.
WRITE: <field>.
ELSE.
EXIT.
ENDIF.
ENDDO.
ULINE.
ENDLOOP.
CATCH cx_sy_create_data_error.
WRITE 'Wrong Database!'.
ENDTRY.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When is the top-of-page event triggered? : abap data dictionary

1186


What is a data element?

901


What is the use of f4if_shlp_exit_example function module ? : sap abap data dictionary

1824


Difference between select option and ranges ?

1053


What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it?

1245


What are the components in sap application server?

1084


What is pretty printer?

990


Difference between Read and Get cursor?

2015


How can the standard tables of sap be modified?

1087


What is occurs in internal table?

1019


how to see the tables of 200 in client 100?

1844


What is evaluation path, where do we do it and why? : sap abap hr

1119


What is an update type with reference to a match code id? : abap data dictionary

950


What is the use of 'table index'?

1059


How do you get the number of lines in an internal table? How to use a specific number occurs statement?

913