Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to set ALV for dynamic <fs>?

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

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question