Professional Documents
Culture Documents
Cs
Cs
e_onf4
e_onf4_before
e_onf4_after
e_ucomm
sender.
=========================================================================
*&---------------------------------------------------------------------*
*& Include ZMM_QA_LOGBOOK_DD
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Include ZMM_QA_LOGBOOK_DD
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
* Type Group *
*----------------------------------------------------------------------*
type-pools : slis.
*----------------------------------------------------------------------*
* Declaration of Tables *
*----------------------------------------------------------------------*
tables : ztb_qa_logbook.
*----------------------------------------------------------------------*
* Declaration of Internal table *
*----------------------------------------------------------------------*
* Internal table for output data ...
data : begin of it_output occurs 0.
include structure ztb_qa_logbook.
data : end of it_output.
*----------------------------------------------------------------------*
* Declaration of Work area *
*----------------------------------------------------------------------*
data : wa_output like line of it_output.
*----------------------------------------------------------------------*
* Declaration ALV variable data *
*----------------------------------------------------------------------*
data : ok_code like sy-ucomm,
save_ok like sy-ucomm,
gd_code like sy-ucomm,
gd_container type scrfname value 'QA_CONTAINER',
gt_fieldcat type lvc_t_fcat,
wa_fieldcat type lvc_s_fcat,
gd_layout type lvc_s_layo,
gd_grid type ref to cl_gui_alv_grid,
gd_custom_container type ref to cl_gui_custom_container.
*----------------------------------------------------------------------*
* Ranges *
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* Constants *
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* Local class declaration
*----------------------------------------------------------------------*
class lcl_event_receiver definition deferred.
*----------------------------------------------------------------------*
* CLASS lcl_event_receiver DEFINITION
*----------------------------------------------------------------------*
class lcl_event_receiver definition.
public section.
methods on_hotspot_click
for event hotspot_click of cl_gui_alv_grid
importing e_row_id
e_column_id
es_row_no.
methods add_button
for event toolbar of cl_gui_alv_grid
importing e_object
e_interactive.
methods handle_user_command
for event user_command of cl_gui_alv_grid
importing e_ucomm.
methods handle_data_changed
for event data_changed of cl_gui_alv_grid
importing er_data_changed
e_onf4
e_onf4_before
e_onf4_after
e_ucomm
sender.
* MEthods DISPLAY_PROTOCOL
private section.
*----------------------------------------------------------------------*
* CLASS lcl_event_receiver IMPLEMENTATION
*----------------------------------------------------------------------*
class lcl_event_receiver implementation.
method on_hotspot_click.
clear : wa_output.
data : ls_col_id type lvc_s_col.
read table it_output into wa_output
index e_row_id-index.
if sy-subrc eq 0.
if e_column_id-fieldname eq 'MATNR'.
set parameter id 'MAT' field wa_output-matnr.
call transaction 'MM03' and skip first screen.
endif. " IF e_column_id-fieldname EQ 'VBELN'.
endif. " IF sy-subrc EQ 0.READ TABLE it_sale_head INTO wa_sale_head
endmethod. "on_hotspot_click
method add_button.
data : ls_toolbar type stb_button.
clear ls_toolbar.
* ls_toolbar-function = 'ITEM'.
* ls_toolbar-icon = 'ICON_DISPLAY'.
* ls_toolbar-butn_type = '0'.
* ls_toolbar-text = 'Item deails'.
* APPEND ls_toolbar TO e_object->mt_toolbar.
endmethod. "add_button
method handle_user_command.
data : lt_rows type lvc_t_row.
refresh : lt_rows[].
case e_ucomm.
when 'SAVE'.
endmethod. "handle_user_command
when others.
endcase.
endmethod. "handle_data_changed
===================================================================================
=
*&---------------------------------------------------------------------*
*& Include ZMM_QA_LOGBOOK_SR
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Include ZMM_QA_LOGBOOK_SR
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module status_0100 output.
set pf-status 'MENU_0100'.
set titlebar 'TITLE_0100'.
if gd_custom_container is initial.
data : it_output_temp like table of it_output.
* Create a custom container control for alv grid (For that we have to
* pass the container name that created in the 0100 screen)
create object gd_custom_container
exporting
* parent =
container_name = gd_container
* style =
* lifetime = lifetime_default
* repid =
* dynnr =
* no_autodef_progid_dynnr =
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
* Create instance for grid (For that we have to pass the custom
* container as parent object) i.e the the grid object will refer the
* custom container
create object gd_grid
exporting
* i_shellstyle = 0
* i_lifetime =
i_parent = gd_custom_container
* i_appl_events = space
* i_parentdbg =
* i_applogparent =
* i_graphicsparent =
* i_name =
* i_fcat_complete = space
exceptions
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
perform build_fieldcatlog.
* Fill the layout details
gd_layout-grid_title = 'ZADF'.
gd_layout-zebra = 'X'.
gd_layout-sel_mode = 'A'.
* gd_layout-cwidth_opt = 'X'.
it_output_temp[] = it_output[].
* This methos is used for display the output details.
call method gd_grid->set_table_for_first_display
exporting
* i_buffer_active =
* i_bypassing_buffer =
* i_consistency_check =
i_structure_name = 'IT_OUTPUT'
* is_variant =
* i_save =
* i_default = 'X'
is_layout = gd_layout
* is_print =
* it_special_groups =
* it_toolbar_excluding =
* it_hyperlink =
* it_alv_graphics =
* it_except_qinfo =
* ir_salv_adapter =
changing
it_outtab = it_output[]
it_fieldcatalog = gt_fieldcat
* it_sort =
* it_filter =
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
if sy-subrc <> 0.
endif.
when 'MEINS'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-checktable = '!'.
when 'ZBINL'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-checktable = '!'.
when 'HSDAT'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-checktable = '!'.
when 'ZEDATE'.
wa_fieldcat-edit = 'X'.
when 'ZMAT_STA'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-drdn_hndl = '1'.
wa_fieldcat-drdn_alias = 'X'.
wa_fieldcat-checktable = '!'.
wa_fieldcat-outputlen = 15.
when 'ZREASON'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-drdn_hndl = '2'.
wa_fieldcat-drdn_alias = 'X'.
wa_fieldcat-outputlen = 15.
when 'ZDESPOSTN'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-drdn_hndl = '3'.
wa_fieldcat-drdn_alias = 'X'.
wa_fieldcat-outputlen = 15.
when 'REMARK'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-outputlen = 30.
when others.
endcase.
modify gt_fieldcat from wa_fieldcat.
endloop. " LOOP AT it_fieldcat INTO wa_fieldcat.
endif. " IF sy-subrc <> 0.
select *
from ztb_qa_logbook
into table it_output
where werks eq p_werks
and matnr eq p_matnr
and charg eq p_charg
and menge eq p_menge
and zmat_sta eq p_zmat_s.
append it_output.
endform. " FILL_OUTPUT_SS
*&---------------------------------------------------------------------*
*& Module EXIT INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module exit input.
leave program.
endmodule. " EXIT INPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module user_command_0100 input.
clear : gd_code.
gd_code = ok_code.
case gd_code.
when 'BACK' or 'CANC'.
leave to screen 0.
when 'SAVE'.
if lv_valid eq 'X'.
*We are not using lt_tab_n in are program anywhere we are passing it
*to avoid dump
data : lt_tab_n type table of dd07v.
clear : lt_tab_n.
clear :p_lt_tab_a[],
ls_tab_a.
*&---------------------------------------------------------------------*
*& Form display_item_details
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_LT_ROWS text
*----------------------------------------------------------------------*
form display_item_details tables p_lt_rows structure lvc_s_row
it_output_temp type standard table.
endif.
endif. "IF sy-subrc eq 0.
endform. "display_item_details
*&---------------------------------------------------------------------*
*& Form HANDLE_DATA_CHANGED
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_ER_DATA_CHANGED text
*----------------------------------------------------------------------*
form handle_data_changed using p_er_data_changed.