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 |
can we create views in bdc
WHAT IS FIELD-SYMBOLS?
What are the data types of internal tables?
What is an implementation project?In any job openings they desire people with at least one project with an end to end implementation. Could u give me the details of project implementation and the role of an abapper in the implementation? And what type of questions do the recruiters normally ask for implementation projects? Plz reply me with a suitable answer. Regards, Rahul
What are the differences between transparent tables, pooled tables & cluster tables? : abap data dictionary
What is a maintenance view? : abap data dictionary
how many ways to debug the script and can we debug the smartform if yes how can we debug
what are command are they abap ?
Can you show multiple alvs on a single screen?
In Smartforms or ADOBE Forms Can we get text from standard table in verticle form? if yes, How?
Explain buffering concept usage?
How the at-user command serves mainly in lists?