cancel
Showing results for 
Search instead for 
Did you mean: 

how to add colour in alv

Former Member
0 Kudos

HI guru,

WA_HEAD-TYP = 'S'.

WA_HEAD-KEY = 'ON SPEC PRODUCTION' .

CONCATENATE ON_SPEC '%' INTO LV_ONSPEC.

WA_HEAD-INFO = LV_ONSPEC.

APPEND WA_HEAD TO TS_HEAD.

CLEAR WA_HEAD.

here i want add colour for onspec production.

how to do this???

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You have color option in layout IS_LAYOUT. When you pass the fikeld name then pass the color field also

Regards,

Nageswar

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

for coloring a col in alv report plz go through the code below which has both row coloring and cell coloring based on condition

type-pools : slis.

types : begin of t_mat,

matnr type matnr,

werks type werks_d,

lgort type lgort_d,

labst type labst,

meins type meins,

maktx type maktx,

name1 type name1,

lgobe type lgobe,

msehl type msehl,

v_lights type c,

v_row type c length 4, "FOR ROW COLOR

v_col type slis_t_specialcol_alv,

end of t_mat,

begin of t_makt,

matnr type matnr,

maktx type maktx,

end of t_makt,

begin of t_marc,

matnr type matnr,

werks type werks_d,

end of t_marc,

begin of t_mard,

matnr type matnr,

werks type werks_d,

lgort type lgort_d,

labst type labst,

end of t_mard,

begin of t_t001l,

werks type werks_d,

lgort type lgort_d,

lgobe type lgobe,

end of t_t001l,

begin of t_t001w,

werks type werks_d,

name1 type name1,

end of t_t001w.

types : begin of wa_mat,

werks type werks,

end of wa_mat.

data : flag type i value 0.

******VARIABLE DECLARATION********

data:v_prog_name type sy-repid, "VARIABLE FOR PROG NAME

v_grid_title type lvc_title. "VARIABLE FOR GRID TITLE

*****INTERNAL TABLE DECLARATION***

data: it_mat type standard table of t_mat,

it_marc type standard table of t_marc,

it_mard type standard table of t_mard,

it_t001l type standard table of t_t001l,

it_t001w type standard table of t_t001w,

it_makt type standard table of t_makt,

it_fieldcat type slis_t_fieldcat_alv,

it_sortinfo type slis_t_sortinfo_alv,

it_eventcat type slis_t_event,

it_listheader type slis_t_listheader,

t_color type slis_specialcol_alv.

data : it_werks type standard table of wa_mat.

*****WORK AREA DECLARATION*********

data: wa_mat type t_mat,

wa_mard type t_mard,

wa_t001l type t_t001l,

wa_t001w type t_t001w,

wa_makt type t_makt,

wa_layout type slis_layout_alv.

data : wa_werks type wa_mat.

data : wa_variant1 like disvariant,

wa_variant2 like disvariant.

******************************************************

  • Selection-Screen *

******************************************************

selection-screen begin of block plant with frame title text-001.

select-options: s_plant for wa_mat-werks,

s_stor for wa_mat-lgort.

parameters : p_var like disvariant-variant.

selection-screen end of block plant.

selection-screen begin of block output with frame title text-002.

parameter: p_rb_01 radiobutton group rd1 default 'X', " list

p_rb_02 radiobutton group rd1. " grid

selection-screen end of block output.

******************************************************

  • Initialization *

******************************************************

perform zf_initialization.

******************************************************

  • At Selection Screen *

******************************************************

at selection-screen on value-request for p_var.

wa_variant1-report = sy-repid.

call function 'REUSE_ALV_VARIANT_F4'

exporting

is_variant = wa_variant1

  • I_TABNAME_HEADER =

  • I_TABNAME_ITEM =

  • IT_DEFAULT_FIELDCAT =

i_save = 'A'

i_display_via_grid = 'X'

importing

  • e_exit = v_exit

es_variant = wa_variant2

exceptions

not_found = 1

program_error = 2

others = 3

.

if sy-subrc = 0.

p_var = wa_variant2-variant.

else.

clear wa_variant2.

endif.

at selection-screen.

perform zf_validate_sel_screen.

******************************************************

  • Start of Selection *

******************************************************

start-of-selection.

perform zf_get_data.

******************************************************

  • End of Selection *

******************************************************

end-of-selection.

perform zf_display_data.

&----


*& Form zf_initialization

&----


  • This will intialize all the variables, work area & subroutines

----


  • --> p1 text

  • <-- p2 text

----


form zf_initialization .

clear : wa_mat,

wa_mard,

wa_t001l,

wa_t001w,

wa_makt,

wa_layout.

refresh : it_mat,

it_marc,

it_mard,

it_t001l,

it_t001w,

it_makt,

it_fieldcat,

it_sortinfo,

it_eventcat,

it_listheader.

v_prog_name = sy-repid.

wa_variant2-report = sy-repid.

call function 'REUSE_ALV_VARIANT_DEFAULT_GET'

exporting

i_save = 'A'

changing

cs_variant = wa_variant2

exceptions

wrong_input = 1

not_found = 2

program_error = 3

others = 4.

if sy-subrc = 0.

p_var = wa_variant2-variant.

else.

p_var = '/DEFAULT'.

endif.

endform. " zf_initialization

&----


*& Form zf_validate_sel_screen

&----


  • This is to validate the inputs on the selction screen

----


  • --> p1 text

  • <-- p2 text

----


form zf_validate_sel_screen .

if not p_var is initial.

wa_variant1-report = sy-repid.

wa_variant1-variant = p_var.

call function 'REUSE_ALV_VARIANT_EXISTENCE'

exporting

i_save = 'A'

changing

cs_variant = wa_variant1

exceptions

wrong_input = 1

not_found = 2

program_error = 3

others = 4.

if sy-subrc = 0.

clear wa_variant2.

move p_var to wa_variant2-variant.

move sy-repid to wa_variant2-report.

else.

message e006. "No such variant exists

endif.

else.

clear wa_variant1.

endif.

select werks from marc into wa_mat-werks where werks in s_plant.

exit.

endselect.

if sy-subrc <> 0.

message e002.

clear wa_mat.

endif.

select lgort from mard into wa_mat-lgort where lgort in s_stor.

exit.

endselect.

if sy-subrc <> 0.

message e003.

clear wa_mat.

endif.

endform. " zf_validate_sel_screen

&----


*& Form zf_get_data

&----


  • This will fetch data from the database tables & finally merge them

  • into a single internal table, to pass it to alv

----


  • --> p1 text

  • <-- p2 text

----


form zf_get_data .

select matnr werks into table it_marc from marc where werks in s_plant

.

if sy-subrc = 0.

sort it_marc by matnr werks.

endif.

if it_marc[] is not initial.

select matnr maktx into table it_makt from makt

for all entries in it_marc

where matnr = it_marc-matnr

and spras = sy-langu.

if sy-subrc = 0.

sort it_makt by matnr.

endif.

select matnr werks lgort labst into table it_mard from mard

for all entries in it_marc

where matnr = it_marc-matnr

and werks = it_marc-werks

and lgort in s_stor.

if sy-subrc = 0.

sort it_mard by matnr werks lgort.

endif.

select werks name1 into table it_t001w from t001w

for all entries in it_marc

where werks = it_marc-werks.

if sy-subrc = 0.

sort it_t001w by werks.

endif.

endif.

if it_mard[] is not initial.

select werks lgort lgobe into table it_t001l from t001l

for all entries in it_mard

where werks = it_mard-werks

and lgort = it_mard-lgort.

if sy-subrc = 0.

sort it_t001l by werks lgort.

endif.

endif.

clear : wa_mat,

wa_mard,

wa_t001l,

wa_t001w,

wa_makt.

loop at it_mard into wa_mard.

wa_mat-matnr = wa_mard-matnr.

wa_mat-werks = wa_mard-werks.

wa_mat-lgort = wa_mard-lgort.

wa_mat-labst = wa_mard-labst.

read table it_makt into wa_makt with key matnr = wa_mard-matnr

binary search.

if sy-subrc = 0.

wa_mat-maktx = wa_makt-maktx.

endif.

read table it_t001l into wa_t001l with key werks = wa_mard-werks

lgort = wa_mard-lgort binary search.

if sy-subrc = 0.

wa_mat-lgobe = wa_t001l-lgobe.

endif.

read table it_t001w into wa_t001w with key werks = wa_mard-werks

binary search.

if sy-subrc = 0.

wa_mat-name1 = wa_t001w-name1.

endif.

append wa_mat to it_mat.

endloop.

sort it_mat by matnr werks lgort.

loop at it_mat into wa_mat.

clear t_color.

if wa_mat-labst < 100.

wa_mat-v_lights = '1'.

t_color-fieldname = 'LABST'.

t_color-color-col = 6.

append t_color to wa_mat-v_col.

wa_mat-v_row = 'C610'.

modify it_mat from wa_mat.

elseif wa_mat-labst < 1000.

wa_mat-v_lights = '2'.

t_color-fieldname = 'LABST'.

t_color-color-col = 3.

append t_color to wa_mat-v_col.

wa_mat-v_row = 'C510'.

modify it_mat from wa_mat.

else.

wa_mat-v_lights = '3'.

t_color-fieldname = 'LABST'.

t_color-color-col = 5.

append t_color to wa_mat-v_col.

wa_mat-v_row = 'C210'.

modify it_mat from wa_mat.

endif.

clear wa_mat.

endloop.

endform. " zf_get_data

&----


*& Form zf_display_data

&----


*

----


  • --> p1 text

  • <-- p2 text

----


form zf_display_data .

*If Internal Table Is Populated Then Only Display Alv Report.

if not it_mat[] is initial.

  • &---Prepare fieldcatalog .

perform zf_build_fieldcat using it_fieldcat.

  • &---Build event catalog.

perform zf_eventcat using it_eventcat.

  • &---Build Listheader for TOP OF PAGE EVENT.

perform zf_build_listheader using it_listheader.

  • &---Build layout.

perform zf_layout.

  • &---Build sorting.

perform zf_sorting using it_sortinfo.

  • &---Initializating Grid Title

perform zf_build_grid_title.

  • IF GRID RADIO button (ALV GRID) IS selected .

if p_rb_02 is not initial.

  • DISPLAY ALV GRID.

perform zf_display_alv_grid.

else.

  • DISPLAY ALV LIST.

perform zf_display_alv_list.

endif.

else.

*&---If Table is not Populated ie Records Does not exist

message s001.

endif.

endform. " zf_display_data

&----


*& Form ZF_BUILD_FIELDCAT

&----


  • text

----


  • -->P_IT_FIELDCAT text

----


form zf_build_fieldcat using p_it_fieldcat type slis_t_fieldcat_alv.

*Declaring Local Variable

data: l_fieldcat type slis_fieldcat_alv.

clear l_fieldcat.

  • for First field

l_fieldcat-col_pos = '1'. "POSITION OF THE COLUMN.

l_fieldcat-fieldname = 'WERKS'. "FIELD FOR WHICH CATALOG

l_fieldcat-tabname = 'IT_MAT'. "NAME OF INTERNAL TABLE

l_fieldcat-ref_tabname = 'MARC'. "FOR F1 & F4 HELP AS REFERNCED

l_fieldcat-key = 'X'. "MAKING FIELD AS KEY FIELD

l_fieldcat-outputlen = 4. "SET THE OUTPUT LENGTH.

l_fieldcat-seltext_l = text-003. "Long text for header.

l_fieldcat-seltext_m = text-003. "Medium text for header.

l_fieldcat-seltext_s = text-003. "Short text for header.

append l_fieldcat to p_it_fieldcat.

clear l_fieldcat.

  • for Second field

l_fieldcat-col_pos = '2'. "POSITION OF THE COLUMN.

l_fieldcat-fieldname = 'LGORT'. "FIELD FOR WHICH CATALOG

l_fieldcat-tabname = 'IT_MAT'. "NAME OF INTERNAL TABLE

l_fieldcat-ref_tabname = 'MARD'. "FOR F1 & F4 HELP AS REFERNCED

l_fieldcat-key = 'X'. "MAKING FIELD AS KEY FIELD

l_fieldcat-outputlen = 4. "SET THE OUTPUT LENGTH.

l_fieldcat-seltext_l = text-004. "Long text for header.

l_fieldcat-seltext_m = text-005. "Medium text for header.

l_fieldcat-seltext_s = text-006. "Short text for header.

append l_fieldcat to p_it_fieldcat.

clear l_fieldcat.

  • for third field

l_fieldcat-col_pos = '3'. "POSITION OF THE COLUMN.

l_fieldcat-fieldname = 'MATNR'. "FIELD FOR WHICH CATALOG

l_fieldcat-tabname = 'IT_MAT'. "NAME OF INTERNAL TABLE

l_fieldcat-ref_tabname = 'MARA'. "FOR F1 & F4 HELP AS REFERNCED

  • l_fieldcat-key = 'X'. "MAKING FIELD AS KEY FIELD

l_fieldcat-outputlen = 18. "SET THE OUTPUT LENGTH.

l_fieldcat-seltext_l = text-007. "Long text for header.

l_fieldcat-seltext_m = text-008. "Medium text for header.

l_fieldcat-seltext_s = text-009. "Short text for header.

append l_fieldcat to p_it_fieldcat.

clear l_fieldcat.

  • for fourth field

l_fieldcat-col_pos = '4'. "POSITION OF THE COLUMN.

l_fieldcat-fieldname = 'LABST'. "FIELD FOR WHICH CATALOG

l_fieldcat-tabname = 'IT_MAT'. "NAME OF INTERNAL TABLE

l_fieldcat-ref_tabname = 'MARD'. "FOR F1 & F4 HELP AS REFERNCED

l_fieldcat-outputlen = 16. "SET THE OUTPUT LENGTH.

l_fieldcat-seltext_l = text-010. "Long text for header.

l_fieldcat-seltext_m = text-011. "Medium text for header.

l_fieldcat-seltext_s = text-012. "Short text for header.

l_fieldcat-do_sum = 'X'.

l_fieldcat-input = 'X'. "Making the field editable

l_fieldcat-edit = 'X'.

append l_fieldcat to p_it_fieldcat.

clear l_fieldcat.

endform. " ZF_BUILD_FIELDCAT

&----


*& Form zf_eventcat

&----


  • text

----


  • -->P_IT_EVENTCAT text

----


form zf_eventcat using p_it_eventcat type slis_t_event.

data l_eventcat type slis_alv_event.

clear l_eventcat.

*Get all the events.

call function 'REUSE_ALV_EVENTS_GET'

exporting

i_list_type = 0

importing

et_events = p_it_eventcat

exceptions

list_type_wrong = 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.

  • TOP-OF-PAGE FORM

clear l_eventcat.

read table p_it_eventcat into l_eventcat with key

name = slis_ev_top_of_page.

if sy-subrc = 0.

move 'ZF_TOP_OF_PAGE' to l_eventcat-form.

modify p_it_eventcat from l_eventcat index sy-tabix

transporting form.

endif.

  • PF_STATUS_SET FORM

clear l_eventcat.

read table p_it_eventcat into l_eventcat with key

name = slis_ev_pf_status_set.

if sy-subrc = 0.

move 'ZF_PF_STATUS_SET' to l_eventcat-form.

modify p_it_eventcat from l_eventcat index sy-tabix

transporting form.

endif.

  • USER_COMMAND FORM

clear l_eventcat.

read table p_it_eventcat into l_eventcat with key

name = slis_ev_user_command.

if sy-subrc = 0.

move 'ZF_USER_COMMAND' to l_eventcat-form.

modify p_it_eventcat from l_eventcat index sy-tabix

transporting form.

endif.

endform. " zf_eventcat

&----


*& Form ZF_BUILD_LISTHEADER

&----


  • text

----


  • -->P_IT_LISTHEADER text

----


form zf_build_listheader using p_it_listheader type slis_t_listheader.

data: l_listheader type slis_listheader.

refresh p_it_listheader.

clear l_listheader.

l_listheader-typ = 'H'. "Header

    • l_listheader-key = 'FCIL,INDIA'. "Ignored for "Header" Type

l_listheader-info = text-013.

append l_listheader to p_it_listheader.

clear l_listheader.

data : lv_date(10) type c .

write sy-datum to lv_date .

l_listheader-typ = 'S'.

l_listheader-key = 'DATE'.

l_listheader-info = lv_date.

append l_listheader to p_it_listheader.

clear l_listheader.

l_listheader-typ = 'A'.

    • l_listheader-key = 'COMMENT'. " key is ignored

l_listheader-info = text-014.

append l_listheader to p_it_listheader.

clear l_listheader.

l_listheader-typ = 'S'.

l_listheader-key = text-016.

  • l_listheader-info = 'Input Plant'.

append l_listheader to p_it_listheader.

clear l_listheader.

l_listheader-typ = 'S'.

l_listheader-key = text-017.

  • l_listheader-info = 'Plant'.

append l_listheader to p_it_listheader.

select werks from marc into table it_werks where werks in s_plant.

sort it_werks by werks.

delete adjacent duplicates from it_werks comparing werks.

loop at it_werks into wa_werks.

clear l_listheader.

l_listheader-typ = 'S'.

  • l_listheader-key = 'X'.

l_listheader-info = wa_werks-werks.

append l_listheader to p_it_listheader.

endloop.

endform. " ZF_BUILD_LISTHEADER

&----


*& Form ZF_LAYOUT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form zf_layout .

clear wa_layout.

wa_layout-zebra = 'X'.

wa_layout-lights_fieldname = 'V_LIGHTS'.

wa_layout-lights_tabname = 'IT_MAT'.

wa_layout-info_fieldname = 'V_ROW'. " infofield for listoutput

wa_layout-coltab_fieldname = 'V_COL'. " colors

endform. " ZF_LAYOUT

&----


*& Form ZF_SORTING

&----


  • text

----


  • -->P_IT_SORTINFO text

----


form zf_sorting using p_it_sortinfo type slis_t_sortinfo_alv.

data l_sortinfo type slis_sortinfo_alv.

clear l_sortinfo.

l_sortinfo-spos = '1'.

l_sortinfo-fieldname = 'WERKS'.

l_sortinfo-tabname = 'IT_MAT'.

l_sortinfo-up = 'X'.

l_sortinfo-group = 'UL'. "UNDERLINE AFTER EVERY GROUP

l_sortinfo-subtot = 'X'.

append l_sortinfo to p_it_sortinfo.

endform. " ZF_SORTING

&----


*& Form ZF_BUILD_GRID_TITLE

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form zf_build_grid_title .

v_grid_title = text-015.

endform. " ZF_BUILD_GRID_TITLE

&----


*& Form ZF_DISPLAY_ALV_GRID

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form zf_display_alv_grid .

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = v_prog_name

i_callback_pf_status_set = 'ZF_PF_STATUS_SET'

i_callback_user_command = 'ZF_USER_COMMAND'

i_callback_top_of_page = 'ZF_TOP_OF_PAGE'

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

i_grid_title = v_grid_title

  • I_GRID_SETTINGS =

is_layout = wa_layout

it_fieldcat = it_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

it_sort = it_sortinfo

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

i_save = 'A'

is_variant = wa_variant2

it_events = it_eventcat

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = it_mat

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. " ZF_DISPLAY_ALV_GRID

&----


*& Form zf_display_alv_list

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form zf_display_alv_list .

call function 'REUSE_ALV_LIST_DISPLAY'

exporting

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE = ' '

i_callback_program = v_prog_name

i_callback_pf_status_set = 'ZF_PF_STATUS_SET'

i_callback_user_command = 'ZF_USER_COMMAND'

  • I_STRUCTURE_NAME =

is_layout = wa_layout

it_fieldcat = it_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

it_sort = it_sortinfo

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = 'A'

  • IS_VARIANT = WA_VARIANT2

it_events = it_eventcat

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = it_mat

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. " zf_display_alv_list

&----


*& Form zf_top_of_page

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form zf_top_of_page .

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = it_listheader

i_logo = 'ENJOYSAP_LOGO'

  • I_END_OF_LIST_GRID =

.

endform. " zf_top_of_page

&----


*& Form zf_pf_status_set

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form zf_pf_status_set using rt_extab type slis_t_extab.

set pf-status 'ALV_MENU_MAT' excluding 'BACK'.

case sy-ucomm.

when 'SAVE'.

  • IF flag <> 0.

set pf-status 'ALV_MENU_MAT' .

  • ENDIF.

endcase.

endform. " zf_pf_status_set

&----


*& Form zf_user_command

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form zf_user_command using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

  • sy-ucomm = r_ucomm.

case r_ucomm.

when 'SAVE'.

flag = flag + 1.

read table it_mat index rs_selfield-tabindex into wa_mat.

wa_mat-labst = rs_selfield-value.

if rs_selfield-value < 100.

wa_mat-v_lights = '1'.

t_color-fieldname = 'LABST'.

t_color-color-col = 6.

wa_mat-v_row = 'C610'.

clear wa_mat-v_col.

append t_color to wa_mat-v_col.

elseif rs_selfield-value < 1000.

wa_mat-v_lights = '2'.

t_color-fieldname = 'LABST'.

t_color-color-col = 3.

wa_mat-v_row = 'C510'.

clear wa_mat-v_col.

append t_color to wa_mat-v_col.

else.

wa_mat-v_lights = '3'.

t_color-fieldname = 'LABST'.

t_color-color-col = 5.

wa_mat-v_row = 'C210'.

clear wa_mat-v_col.

append t_color to wa_mat-v_col.

endif.

modify it_mat from wa_mat index rs_selfield-tabindex.

  • IF GRID RADIO button (ALV GRID) IS selected .

if p_rb_02 is not initial.

  • SET PF-STATUS 'ALV_MENU_MAT'.

  • DISPLAY ALV GRID.

perform zf_display_alv_grid.

else.

  • SET PF-STATUS 'ALV_MENU_MAT'.

  • DISPLAY ALV LIST.

perform zf_display_alv_list.

endif.

set screen 0.

when 'BACK'.

leave screen.

when others.

message i004.

endcase.

  • WHEN 'BACK'.

      • CASE sy-ucomm.

      • WHEN 'BACK'.

      • LEAVE SCREEN.

***

      • ENDCASE.

endform. " zf_user_command

reward if helpful