report yrtest0035.
include yrtest0035top.
include yrtest0035f01.
*-----------------------------------------------------------------*
initialization.
*-----------------------------------------------------------------*
if s_arbgb[] is initial.
mac_add_range s_arbgb 'I' 'CP' 'Z*' ''.
endif.
*-----------------------------------------------------------------*
start-of-selection.
*-----------------------------------------------------------------*
perform select_data.
*-----------------------------------------------------------------*
end-of-selection.
*-----------------------------------------------------------------*
call method zcl_ppz_msg_util=>msg_data_found( it_table = gt_itab[] ).
check gt_itab[] is not initial.
perform get_event_list using gt_events 0.
perform set_event.
perform set_layout.
perform set_fieldcat.
perform display_alv.
*&-----------------------------------------------------------------
*& Include YRTEST0035TOP
*& User A539
*& Date 2010.07.21
*&-----------------------------------------------------------------
*-----------------------------------------------------------------*
* type
*-----------------------------------------------------------------*
type-pools: slis.
*----------------------------------------------------------------*
* table
*----------------------------------------------------------------*
tables: t100a, "T100에 대한 메세지 ID
rsdag.
*--------------------------------------------------------------*
* internal table
*--------------------------------------------------------------*
data: begin of gt_itab occurs 0.
include structure t100a.
data: end of gt_itab.
data: itab like table of bdcmsgcoll with header line.
*--------------------------------------------------------------*
* BDC
*------------------------------------------------------------*
data: gt_bdcdata like bdcdata occurs 0 with header line,
gt_messtab like bdcmsgcoll occurs 0 with header line,
gs_options like ctu_params.
*----------------------------------------------------------*
* data
*--------------------------------------------------------------*
data: gt_lvc_fcat type lvc_t_fcat,
gs_lvc_layo type lvc_s_layo,
gs_layout type slis_layout_alv.
data: gt_events type slis_t_event.
data: gt_slis_t_fieldcat_alv type slis_t_fieldcat_alv,
gs_slis_fieldcat_alv type slis_fieldcat_alv.
*-------------------------------------------------------------*
* macro
*-------------------------------------------------------------*
* macro for filling select-option
define mac_add_range.
clear: &1.
&1-sign = &2.
&1-option = &3.
&1-low = &4.
&1-high = &5.
append &1.
end-of-definition.
*&-------------------------------------------------------------*
*& Include YRTEST00001_SEL
*&-------------------------------------------------------------*
selection-screen begin of block b1 with frame title text-001.
select-options: s_arbgb for t100a-arbgb.
selection-screen end of block b1.
*&----------------------------------------------------------
*& Include YRTEST0035F01
*& User A539
*& Date 2010.07.21
*&-------------------------------------------------------------
*&-------------------------------------------------------------*
*& Form DISPLAY_ALV
*&--------------------------------------------------------------*
* text
*---------------------------------------------------------------*
form display_alv .
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-cprog
it_fieldcat = gt_slis_t_fieldcat_alv
is_layout = gs_layout
i_default = 'X'
i_save = 'A'
it_events = gt_events
tables
t_outtab = gt_itab.
endform. " DISPLAY_ALV
*&--------------------------------------------------------------*
*& Form SET_FIELDCAT
*&---------------------------------------------------------------*
* text
*----------------------------------------------------------------*
form set_fieldcat .
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_internal_tabname = 'GT_ITAB'
i_inclname = sy-repid
changing
ct_fieldcat = gt_slis_t_fieldcat_alv
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.
loop at gt_slis_t_fieldcat_alv into gs_slis_fieldcat_alv.
case gs_slis_fieldcat_alv-fieldname.
when 'ARBGB'.
* gs_slis_fieldcat_alv-hotspot = 'X'.
gs_slis_fieldcat_alv-seltext_l = 'Message Class'.
gs_slis_fieldcat_alv-seltext_m = 'Message Class'.
modify gt_slis_t_fieldcat_alv from gs_slis_fieldcat_alv.
endcase.
endloop.
endform. " SET_FIELDCAT
*&-------------------------------------------------------------*
*& Form SELECT_DATA
*&---------------------------------------------------------------*
* text
*----------------------------------------------------------------*
form select_data .
select *
into corresponding fields of table gt_itab
from t100a
where arbgb in s_arbgb.
sort gt_itab by arbgb.
read table gt_itab index 1 transporting no fields.
endform. " SELECT_DATA
*&-------------------------------------------------------------*
*& Form SET_EVENT
*&--------------------------------------------------------------*
* text
*-------------------------------------------------------------*
form set_event .
data: ls_event type slis_alv_event.
* - FORM USER_COMMAND
read table gt_events with key name = slis_ev_user_command
into ls_event.
if sy-subrc eq 0.
move 'USER_COMMAND' to ls_event-form.
modify gt_events index sy-tabix from ls_event.
endif.
endform. " SET_EVENT
*&------------------------------------------------------------------*
*& Form USER_COMMAND
*&------------------------------------------------------------------*
* ##(REUSE_ALV_EVENTS_GET)## CALL# FORM ###.
*-------------------------------------------------------------------*
form user_command using p_ucomm like sy-ucomm
p_selfield type slis_selfield.
case p_ucomm.
when '&IC1'.
read table gt_itab index p_selfield-tabindex.
set parameter id 'MAG' field gt_itab-arbgb.
call transaction 'SE91' and skip first screen.
* perform call_transaction.
endcase.
endform. "USER_COMMAND
*&-----------------------------------------------------------*
*& FORM EVENTTAB_BUILD
*&--------------------------------------------------------------*
form get_event_list using p_events type slis_t_event
p_alv_type type slis_list_type.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = p_alv_type
importing
et_events = p_events.
endform. " EVENTTAB_BUILD
*&-----------------------------------------------------------*
*& Form SET_LAYOUT
*&------------------------------------------------------------*
* text
*--------------------------------------------------------------*
form set_layout .
clear: gs_layout.
gs_layout-zebra = 'X'.
endform. " SET_LAYOUT
*&------------------------------------------------------------*
*& Form CALL_TRANSACTION
*&--------------------------------------------------------------*
* text
*--------------------------------------------------------------*
form call_transaction .
clear: gs_options, gt_bdcdata[].
gs_options-dismode = 'E'.
gs_options-updmode = 'A'.
perform bdc_dynpro using 'SAPLWBMESSAGES' '0100'.
perform bdc_field using 'BDC_CURSOR' 'RSDAG-ARBGB'.
perform bdc_field using 'BDC_OKCODE' '=WB_DISPLAY'.
perform bdc_field using 'RSDAG-ARBGB' gt_itab-arbgb.
call transaction 'SE91' using gt_bdcdata
options from gs_options
messages into gt_messtab.
endform. " CALL_TRANSACTION
*&----------------------------------------------------------*
*& Form bdc_DYNPRO
*&--------------------------------------------------------------*
* text
*---------------------------------------------------------------*
form bdc_dynpro using program dynpro.
clear: gt_bdcdata.
gt_bdcdata-program = program.
gt_bdcdata-dynpro = dynpro.
gt_bdcdata-dynbegin = 'X'.
append gt_bdcdata.
endform. " bdc_DYNPRO
*&-----------------------------------------------------------*
*& Form bdc_FIELD
*&------------------------------------------------------------*
* text
*------------------------------------------------------------*
form bdc_field using fnam fval.
clear: gt_bdcdata.
gt_bdcdata-fnam = fnam.
gt_bdcdata-fval = fval.
append gt_bdcdata.
endform. " bdc_FIELD
'SAP > ABAP 개발' 카테고리의 다른 글
Enable Variant 'SAVE' button while using 'REUSE_ALV_GRID_DISPLAY' (3) | 2010.08.11 |
---|---|
cx_root - Division by zero (1) | 2010.07.21 |
Function - Yes or No POPUP - WFCS_POPUP_YES_NO (2) | 2010.07.21 |
SAPGUI_PROGRESS_INDICATOR - % (2) | 2010.07.19 |
PP - BOM Item List Function ( MAST STPO STKO ) (2) | 2010.07.16 |