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 you do enhancement in a table?
Can we create Secondary Indexes for the Views
Which configuration we have to make first before we want to start Business Workflow with our SAP R/3
Explain read dataset in sap abap?
what is the difference b/w database and data dictionary?
How to find out the no of implementations done for a badi
What is the difference b/w BAPI and Function module
If A is the super class of B. And both the classes have constructor. We create an object of class B. Then which constructor will be called? If both then in which order?
What are control commands in sap scripts?
A field containing quantity amounts (data type quan) must be assigned to a referencetable and a reference field. Explain?
What are the exceptions in function module?
What is PNP-SW-FOUND