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: 

display one FIELD using ALV?

Former Member
0 Kudos

display one FIELD using ALV?

please explain.

4 REPLIES 4

Former Member
0 Kudos

Hi,

Can you please be a bit more clear on the requirement. This question is very generic.....

kiran_k8
Active Contributor
0 Kudos

Ramana,

Create a fieldcatalog for only that field.

FORM build_fieldcat .

define m_fieldcat.

itfieldcat-fieldname = &1.

itfieldcat-col_pos = &2.

itfieldcat-seltext_l = &3.

append itfieldcat to itfieldcat.

end-of-definition.

m_fieldcat 'WERKS' '' 'Plant'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = sy-repid

I_GRID_TITLE = 'List'

IS_LAYOUT = gd_layout

IT_SORT = itsort[]

IT_FIELDCAT = itfieldcat[]

TABLES

T_OUTTAB = itab[]

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

endform.

K.Kiran.

Former Member
0 Kudos

hi ,

if the requirement is to display only one field using ALV, then you have to make the field(no_out = x) for all the fields expect the field you want to display while building the field catalog .Pass this field catalog to the ALV FM .

reward if helpful.

Former Member
0 Kudos

Hello,

For only one field u ca create a fieldcatalog for only that field and use the FM u can display the ALV.

Otherwise u can display the ALV as usual and can set the Layout variant. Then u can set a particular layout variant for your need.

Reward if helpful,

regards,

LIJO JOHN