Alv Renklendirme ve tıklanınca istenilen transactiona gitme
***ALV DECLARATIONS
data : gt_fieldcat type slis_t_fieldcat_alv with header line,
gs_layout type slis_layout_alv,
gs_cellcolour type lvc_s_scol.
***LAYOUT DECLARATIONS
data : gs_variant like disvariant,
gs_var_usr like disvariant.
***RANGE DECLARATIONS
ranges : gr_auart for vbak-auart.
constants : gc_save(1) type c value 'A',
gc_repid type sy-repid value 'YILSD_SHR001'.
selection-screen begin of block b2 with frame title text-024. " Layout
parameters: p_varia like disvariant-variant.
selection-screen end of block b2.
initialization.
perform f_variant_init.
gs_var_usr = gs_variant.
call function 'REUSE_ALV_VARIANT_DEFAULT_GET'
exporting
i_save = gc_save
changing
cs_variant = gs_var_usr
exceptions
not_found = 2.
if sy-subrc = 0.
p_varia = gs_var_usr-variant.
endif.
*** AT SELECTION-SCREEN
at selection-screen on value-request for p_varia.
perform f_varia changing p_varia.
at selection-screen.
if not p_varia is initial.
move gs_variant to gs_var_usr.
move p_varia to gs_var_usr-variant.
call function 'REUSE_ALV_VARIANT_EXISTENCE'
exporting
i_save = gc_save
changing
cs_variant = gs_var_usr.
gs_variant = gs_var_usr.
else.
perform f_variant_init.
endif.
form f_color_column.
perform f_using_coloring using 'AUART2' '4' ''.
perform f_using_coloring using 'VBELN2' '4' ''.
perform f_using_coloring using 'BSTKD2' '4' ''.
perform f_using_coloring using 'ZZILREF2' '4' ''.
perform f_using_coloring using 'AUDAT2' '4' ''.
perform f_using_coloring using 'VDATU2' '4' ''.
perform f_using_coloring using 'KZWI2' '4' ''.
perform f_using_coloring using 'DIFFERENCE' '3' ''.
perform f_using_coloring using 'AUART' '4' 'X'.
perform f_using_coloring using 'VBELN' '4' 'X'.
perform f_using_coloring using 'BSTKD' '4' 'X'.
perform f_using_coloring using 'ZZILREF' '4' 'X'.
perform f_using_coloring using 'AUDAT' '4' 'X'.
perform f_using_coloring using 'VDATU' '4' 'X'.
perform f_using_coloring using 'DT_NAME' '4' 'X'.
perform f_using_coloring using 'DT_NAME2' '4' 'X'.
perform f_using_coloring using 'ST_NAME' '4' 'X'.
perform f_using_coloring using 'PAYER' '4' 'X'.
perform f_using_coloring using 'FAKSK' '4' 'X'.
perform f_using_coloring using 'YZASDFRGHT' '4' 'X'.
perform f_using_coloring using 'SHIP' '4' 'X'.
perform f_using_coloring using 'IHREZ' '4' 'X'.
perform f_using_coloring using 'DIST' '4' 'X'.
perform f_using_coloring using 'KZWI1' '4' 'X'.
form f_using_coloring using p_name p_color p_control.
loop at gt_collect.
if gt_collect-total ne 'X'.
if p_control ne 'X'.
gs_cellcolour-fname = p_name.
gs_cellcolour-color-col = p_color.
gs_cellcolour-color-int = '1'.
gs_cellcolour-color-inv = '0'.
append gs_cellcolour to gt_collect-cell_colour.
modify gt_collect transporting cell_colour.
endif.
else.
if p_control ne 'X'.
gs_cellcolour-fname = p_name.
gs_cellcolour-color-col = '1'.
gs_cellcolour-color-int = '1'.
gs_cellcolour-color-inv = '0'.
append gs_cellcolour to gt_collect-cell_colour.
modify gt_collect transporting cell_colour.
else.
gs_cellcolour-fname = p_name.
gs_cellcolour-color-col = '1'.
gs_cellcolour-color-int = '1'.
gs_cellcolour-color-inv = '0'.
append gs_cellcolour to gt_collect-cell_colour.
modify gt_collect transporting cell_colour.
endif.
endif.
endloop.
endform.
form f_set_layout .
gs_layout-zebra = 'X'.
gs_layout-colwidth_optimize = 'X'.
gs_layout-coltab_fieldname = 'CELL_COLOUR'.
endform. " f_set_layout
form f_build_fieldcat .
perform f_add_fieldcat using 'DT_NAME' 'GT_COLLECT' text-015 '' ''.
perform f_add_fieldcat using 'DIST' 'GT_COLLECT' text-006 '' ''.
perform f_add_fieldcat using 'AUART' 'GT_COLLECT' text-012 '' ''.
perform f_add_fieldcat using 'VBELN' 'GT_COLLECT' text-008 '' ''.
perform f_add_fieldcat using 'ST_NAME' 'GT_COLLECT' text-016 '' ''.
perform f_add_fieldcat using 'SHIP' 'GT_COLLECT' text-010 '' ''.
perform f_add_fieldcat using 'PAYER' 'GT_COLLECT' text-017 '' ''.
perform f_add_fieldcat using 'AUDAT' 'GT_COLLECT' text-005 '' ''.
perform f_add_fieldcat using 'VDATU' 'GT_COLLECT' text-004 '' ''.
perform f_add_fieldcat using 'BSTKD' 'GT_COLLECT' text-009 '' ''.
perform f_add_fieldcat using 'IHREZ' 'GT_COLLECT' text-007 '' ''.
perform f_add_fieldcat using 'DT_NAME2' 'GT_COLLECT' text-015 '' ''.
perform f_add_fieldcat using 'DIST' 'GT_COLLECT' text-006 '' ''.
perform f_add_fieldcat using 'FAKSK' 'GT_COLLECT' text-018 '' ''.
perform f_add_fieldcat using 'ZZILREF' 'GT_COLLECT' text-013 '' ''.
perform f_add_fieldcat using 'YZASDFRGHT' 'GT_COLLECT' text-019 '' ''.
perform f_add_fieldcat using 'KZWI1' 'GT_COLLECT' text-014 '' ''.
perform f_add_fieldcat using 'AUART2' 'GT_COLLECT' text-012 '' ''.
perform f_add_fieldcat using 'VBELN2' 'GT_COLLECT' text-020 '' ''.
perform f_add_fieldcat using 'BSTKD2' 'GT_COLLECT' text-009 '' ''.
perform f_add_fieldcat using 'ZZILREF2' 'GT_COLLECT' text-013 '' ''.
perform f_add_fieldcat using 'AUDAT2' 'GT_COLLECT' text-005 '' ''.
perform f_add_fieldcat using 'VDATU2' 'GT_COLLECT' text-004 '' ''.
perform f_add_fieldcat using 'KZWI2' 'GT_COLLECT' text-014 '' ''.
perform f_add_fieldcat using 'DIFFERENCE' 'GT_COLLECT' text-021 '' ''.
form f_assign_range using p_low.
gr_auart-sign = 'I'.
gr_auart-option = 'EQ'.
gr_auart-low = p_low.
append gr_auart.
endform.
***** Transactiona Gitme
form f_user_command using r_ucomm like sy-ucomm
r_selfield type slis_selfield.
case r_ucomm.
when '&IC1'.
case r_selfield-sel_tab_field.
when 'GT_COLLECT-VBELN'.
read table gt_collect
with key vbeln = r_selfield-value.
set parameter id 'AUN' field r_selfield-value.
authority-check object 'S_TCODE'
id 'TCD'
field 'VA03'.
if sy-subrc = 0.
call transaction 'VA03' and skip first screen.
else.
message e077(s#) with 'VA03'.
endif.
call transaction 'VA03' and skip first screen.
when 'GT_COLLECT-VBELN2'.
read table gt_collect
with key vbeln = r_selfield-value..
set parameter id 'AUN' field r_selfield-value.
authority-check object 'S_TCODE'
id 'TCD'
field 'VA03'.
if sy-subrc = 0.
call transaction 'VA03' and skip first screen.
else.
message e077(s#) with 'VA03'.
endif.
endcase.
endcase.
endform.
***************************************************************
Serkan AKKAVAK
Bilgisayar Mühendisi
serkurumsal@yandex.com
SAP ve ABAP ile ilgili tüm sorun ve sorularınızı gönderebilirsiniz.
Social Plugin