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

5) How to rereive text elements in SF and script?

2157


What are the basic components of dialog program?

1233


What does nw 7.4 sp 05/nw 7.5 sp 02 offers in abap?

1091


what is diff between idocs,bdc,rfc and bapi. give real time answer

19595


Setting up a BDC program where you find information from?

1194


What are the value tables?

1079


What is the Process to transfer IDOC from Outbound System to Inbound system.

2161


What is the significance of hide?

997


What is size category?

1012


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

1173


What are screen painter and menu painter? : abap hr

1037


What are the different types of views and their definition?

1110


While sorting field groups we cannot use more than one key field. State true or false. : abap modularization

1051


What is a persistent class?

1444


while implementing badi what are the tables u find??

4137