Can you create an internal table dynamically?(at run time)
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / narasareddy
Hi,
can you please clarify how can we create..
Is This Answer Correct ? | 0 Yes | 0 No |
What are the different types of data dictionary objects?
Dear Experts pls answer the folowing qs that i have faced in the recent intvws: a) Can we execute the script individually? If yes How? Else what we need to do so? b) Are Layout sets Client independent? c) How do you assign a print program to a script? d) Can we call a subroutine in a script? If so, how? e) What are the steps to print SAP script form?
How can we create Search Help, without using table field? for example I have two fields in one table and I required one more field in search help how?
1 Answers Accenture, Maples, Patni, TCS,
while implementing badi what are the tables u find??
Identify the servers of which only one can exist in an R/2 System?
how many types of windows are there in SMARTFORMS?not in scripts?
what is the difference table type and structure?
8 Answers IBM, Reliance, Tech Mahindra,
hi experts, "move 'I' to s_ktokd-sign. move 'EQ' to s_ktokd-option." Can any one please explain me meaning of two lines? actually we use this move key word to move a value from one field variable to another field variable? i didn't understand the meaning of these statements?
can we add fields to SAP Standard tables. ? Do SAP tables have indexes. ?
how to make split command reusable?
What does an exec sql statement do in abap?
What is For-period and In-period