Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to set ALV for dynamic <fs>?

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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

0 Kudos

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