10-06-2007 8:34 AM
Hi,
I have a table with 3 column as shown:
-
ID
First Name
Last Name
-
I have do modification at the backend and create an additional column dynamically with data from the table into a <fs> as shown :
-
ID
First Name
Last Name
Contact "This column was dynamically created with data in it.
-
Now my <fs> is of different from the table. Of cause, the <fs> data is loaded from the table to the correspponding field. I need to show the dynamic <fs> into an ALV list. how do i do that?
Sample Code:
===========================================================
FORM bind_data.
"Initial ALV or refresh ALV
IF container IS INITIAL.
CREATE OBJECT CONTAINER
EXPORTING
CONTAINER_NAME = 'CTAB'.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT ALV_LIST
EXPORTING
I_PARENT = container.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD alv_list->set_table_for_first_display
EXPORTING
i_structure_name = [...what should i put here?...]
CHANGING
it_outtab = <fs_combine>.
ELSE.
CALL METHOD alv_list->refresh_table_display.
ENDIF.
ENDFORM. "bind_data
==========================================================
If i were to enter the table name in i_structure_name , i wont get the extra column show in the ALV. What value should i put in the i_structure_name in order to show the extra column?
Regards,
Rayden
10-06-2007 8:56 AM
HI,
after u modified the table dynamically give committ statement to save.
in the i_structure_name give the table name.
now it will display the field in the alv
10-06-2007 8:56 AM
HI,
after u modified the table dynamically give committ statement to save.
in the i_structure_name give the table name.
now it will display the field in the alv
10-06-2007 9:01 AM
Hi Santiagu Arockiam,
The field symbol is different from the orignal dictionary table which has the extra column created dynamically. I would like to display the <fs> without disrupting the orginal table by modifying it. How to do that? Any other possible solution for this problem?
Regards,
Rayden