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

when using alv, Optional column in structure

Former Member
0 Likes
600

Hi everyone.

I'm using 'reuse_alv_list_display'.

I'm using structure in 'reuse_alv_list_display'.

STRUCTURE_NAME = 'ZTS001'.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

I_CALLBACK_PROGRAM = PGM

I_CALLBACK_PF_STATUS_SET = 'SET_STATUS'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

I_STRUCTURE_NAME = STRUCTURE_NAME

IS_LAYOUT = LAYOUT

IT_FIELDCAT = FIELDCAT

  • IT_EXCLUDING =

.

.

.

.

Now I want to display not all of structure columns but the structure columns partially.

what should I do..?

4 REPLIES 4
Read only

Former Member
0 Likes
532

Hi,

ALV gives a facility of choosing layout when the report is displayed. The report will list out all the colums, but you can chnage the layout and can choose which ever columns you want to display. So in this way you can manipulate the format of the report by changing the layout.

Sushil.

Read only

Former Member
0 Likes
532
Hi James,

  You can declare an internal table with those fields and pass that internal table name as structure.

data: begin of itab occurs 0,
        bukrs like t001-bukrs,
        ......
      end of itab.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = PGM
I_CALLBACK_PF_STATUS_SET = 'SET_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
<b>I_STRUCTURE_NAME = 'ITAB'</b>
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FIELDCAT
* IT_EXCLUDING =
Read only

Former Member
0 Likes
532

Hi,

In the Fieldcatalog, you will find a field NO_OUT, so when you are building the fieldcatalog, what ever the fields you do not want to show in the output, then FIELDCATALOG-NO_OUT = 'X'. so those fileds will not appear in the output.

Regards

Sudheer

Read only

Former Member
0 Likes
532

Use FM : REUSE_ALV_FIELDCATALOG_MERGE and pass the structure 'ZTS001' and get the fieldcatalog into an internal table T_FIELDCAT.

lets say you dont want to display field 'MATNR' isn ZTS001.

then you can ..

READ TABLE T_FIELDCAT WITH KEY FIELDNAME = 'MATNR'.

if sy-subrc eq 0.

T_FIELDCAT-No_OUT = 'X'.

Now instead of passing Structure name to REUSE_ALV_GRID_DISPLAY, pass the field catalog T_FIELDCAT in the fieldcatalog tables parameter.

modify t_fieldcat index sy-tabix.

endif.

Message was edited by: Sharath kumar R