on 04-03-2007 11:29 AM
hai.how to increase the fields of internal tabl edynamically?plz help me on this.
Hi
Create the fieldcatalog thru the FM
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = in_tabname
CHANGING
ct_fieldcat = it_fcat
EXCEPTIONS
OTHERS = 1.
then append the number of dynamic fields you want to into the Fieldcatalog and then call on the following class
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fcat
IMPORTING
ep_table = it_content.
IF sy-subrc = 0.
ASSIGN it_content->* TO <itab>.
ELSE.
WRITE: 'Error creating internal table'.
STOP.
ENDIF.
This will return you a table whose fields will increase decrease dynamically.
Hope that Helps
Anirban M.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Create the fieldcatalog thru the FM
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = in_tabname
CHANGING
ct_fieldcat = it_fcat
EXCEPTIONS
OTHERS = 1.
then append the number of dynamic fields you want to into the Fieldcatalog and then call on the following class
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fcat
IMPORTING
ep_table = it_content.
IF sy-subrc = 0.
ASSIGN it_content->* TO <itab>.
ELSE.
WRITE: 'Error creating internal table'.
STOP.
ENDIF.
This will return you a table whose fields will increase decrease dynamically.
Hope that Helps
Anirban M.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Create the fieldcatalog thru the FM
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = in_tabname
CHANGING
ct_fieldcat = it_fcat
EXCEPTIONS
OTHERS = 1.
then append the number of dynamic fields you want to into the Fieldcatalog and then call on the following class
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fcat
IMPORTING
ep_table = it_content.
IF sy-subrc = 0.
ASSIGN it_content->* TO <itab>.
ELSE.
WRITE: 'Error creating internal table'.
STOP.
ENDIF.
This will return you a table whose fields will increase decrease dynamically.
Hope that Helps
Anirban M.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mrudula,
Check this code.
DATA: BEGIN OF str_itab OCCURS 0,
var1 TYPE i,
var2 TYPE i,
END OF str_itab.
CREATE DATA itab TYPE STANDARD TABLE OF itab.
By using 'create data' statement you can create internal table dynamically.
regards,
Rajesh.
Message was edited by:
RK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mrudula,
In order to increase the size of the internal table , i.e. fields dynamically , you need to include or append structures to the respective internal table.
Hope this resolves your query.
Reward all the helpful answers.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.