Application Development and Automation 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: 
Read only

ALV DISPLAY

Former Member
0 Likes
546

Hi all.

I have a issue in alv display.

I am using field catlog for display.

the out put is ok.

in my out put I am getting 20 coloumns(fields).

but I want to display 1o field as default in my out put,but remaining 10 fields data also can I get by filtering or by change the view.

Can any body help me how to solve this issue.

Thanks in advance,

regards,

Eswar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
515

Hi venkat,

1. for those 10 fields, which u don't won't

to display by default,

2. just give

FIELDCAT-NO_OUT = 'X'

3. In this simple example,

the one field is hidden by default.

4. just copy paste

5.

report abc.

*----


TYPE-POOLS : slis.

DATA : alvfc TYPE slis_t_fieldcat_alv.

DATA : alvfcwa TYPE slis_fieldcat_alv.

*----


data : begin of itab occurs 0.

include structure usr02.

data : end of itab.

*----


START-OF-SELECTION.

select * from usr02

into table itab.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'ITAB'

i_inclname = sy-repid

CHANGING

ct_fieldcat = alvfc

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

*----


IMPORTANT

LOOP AT ALVFC INTO ALVFCWA.

IF ALVFCWA-FIELDNAME = 'USTYP'.

<b> alvfcwa-no_out = 'X'.</b>

MODIFY ALVFC FROM ALVFCWA.

ENDIF.

ENDLOOP.

*----


Display

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

it_fieldcat = alvfc

TABLES

t_outtab = itab

EXCEPTIONS

program_error = 1

OTHERS = 2.

regards,

amit m.

Hi venkat,

1. for those 10 fields, which u don't won't

to display by default,

2. just give

FIELDCAT-NO_OUT = 'X'

3. In this simple example,

the one field is hidden by default.

4. just copy paste

5.

report abc.

*----


TYPE-POOLS : slis.

DATA : alvfc TYPE slis_t_fieldcat_alv.

DATA : alvfcwa TYPE slis_fieldcat_alv.

*----


data : begin of itab occurs 0.

include structure usr02.

data : end of itab.

*----


START-OF-SELECTION.

select * from usr02

into table itab.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'ITAB'

i_inclname = sy-repid

CHANGING

ct_fieldcat = alvfc

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

*----


IMPORTANT

LOOP AT ALVFC INTO ALVFCWA.

IF ALVFCWA-FIELDNAME = 'USTYP'.

<b> alvfcwa-no_out = 'X'.</b>

MODIFY ALVFC FROM ALVFCWA.

ENDIF.

ENDLOOP.

*----


Display

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

it_fieldcat = alvfc

TABLES

t_outtab = itab

EXCEPTIONS

program_error = 1

OTHERS = 2.

regards,

amit m.

4 REPLIES 4
Read only

Former Member
0 Likes
515

Hi,

In the ALV toolbar, you have a button called as CHANGE LAYOUT. Click on this and select only those fields which you require. Store this layout.

Whenever required you can change the layout and add/remove the fields.

Best regards,

Prashant

Read only

Former Member
0 Likes
515

Hai,

Create a layout using the required ten fields & set that layout as the default layout so that whenever you execute only that 10 fileds will be visible.

If useful reward the points,

Regards,

Umasankar

Read only

Former Member
0 Likes
516

Hi venkat,

1. for those 10 fields, which u don't won't

to display by default,

2. just give

FIELDCAT-NO_OUT = 'X'

3. In this simple example,

the one field is hidden by default.

4. just copy paste

5.

report abc.

*----


TYPE-POOLS : slis.

DATA : alvfc TYPE slis_t_fieldcat_alv.

DATA : alvfcwa TYPE slis_fieldcat_alv.

*----


data : begin of itab occurs 0.

include structure usr02.

data : end of itab.

*----


START-OF-SELECTION.

select * from usr02

into table itab.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'ITAB'

i_inclname = sy-repid

CHANGING

ct_fieldcat = alvfc

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

*----


IMPORTANT

LOOP AT ALVFC INTO ALVFCWA.

IF ALVFCWA-FIELDNAME = 'USTYP'.

<b> alvfcwa-no_out = 'X'.</b>

MODIFY ALVFC FROM ALVFCWA.

ENDIF.

ENDLOOP.

*----


Display

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

it_fieldcat = alvfc

TABLES

t_outtab = itab

EXCEPTIONS

program_error = 1

OTHERS = 2.

regards,

amit m.

Read only

naimesh_patel
Active Contributor
0 Likes
515

Hello,

User F_CAT-NO_OUT = 'X' for last 10 fields. You can select those fields later on from the Change layout button.

Regards,

Naimesh