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

Former Member
0 Likes
659

1.suppose my internal table contains 10 fields, and in ALV fieldcat also contains 10fields. if i want only 6 files not 10 in my fieldcat how can i do that?

2. can i call one window from another window in scripts /smartfors.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
637

Hi Madhav,

you can remove the 4 fields from the field catalog

or you can mark ls_fcat-no_out = 'X' for the fields for which you do not want to show in the ALV

Hope this helps

Regards,

Kinshuk

1.suppose my internal table contains 10 fields, and in ALV fieldcat also contains 10fields. if i want only 6 files not 10 in my fieldcat how can i do that?

2. can i call one window from another window in scripts /smartfors.

3 REPLIES 3
Read only

Former Member
0 Likes
638

Hi Madhav,

you can remove the 4 fields from the field catalog

or you can mark ls_fcat-no_out = 'X' for the fields for which you do not want to show in the ALV

Hope this helps

Regards,

Kinshuk

Read only

Former Member
0 Likes
637

You can make them to invisible mode while displaying

loop at it_fieldcat into wa_fieldcat.

   if wa_fieldcat-fieldname = 'FIELD1' or 
     wa_fieldcat-fieldname = 'FIELD2' or 
     wa_fieldcat-fieldname = 'FIELD3' or 
     wa_fieldcat-fieldname = 'FIELD4' .
 
  wa_fieldcat-no_out = 'X'.
  modify it_fieldcat from wa_fieldcat.

endif.
endloop.

Read only

Former Member
0 Likes
637

For <b>Q1</b>, you need to build field catalog to display 6 fields.

data wf_fieldcat type slis_t_fieldcat_alv.

****

****

****

perform f_fieldcat_init using wf_fieldcat[].

****

****

****

&----


*& Form f_fieldcat_init

&----


  • Fill Field Values for ALV

----


  • -->P_WF_FIELDCAT[] text

----


form f_fieldcat_init using lt_fieldcat type slis_t_fieldcat_alv.

data ls_fieldcat type slis_fieldcat_alv.

ls_fieldcat-fieldname = 'OBJID'.

ls_fieldcat-seltext_m = 'Object ID.

append ls_fieldcat to lt_fieldcat.

clear ls_fieldcat.

PS: like above you need to build it for another 5 fields.

endform. "f_fieldcat_init

<b>Note: OBJID should be part of your internal table.</b>

***

***

***

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = sy-repid

i_callback_user_command =

is_layout =

it_fieldcat = <b>wf_fieldcat[]</b>

it_excluding =

it_sort =

it_events =

tables

t_outtab = int_output

exceptions

program_error = 1

others = 2.

if sy-subrc <> 0.

endif.

Regards,

Ramki.