Você está na página 1de 16

*----------------------------------------------------------------------*

*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* // //=== ||===== *
* // \\ || || *
* //===\\ ====|| ||===== *
* // \\ || || *
* // \\ ====// || *
*----------------------------------------------------------------------*
* A S S O C I A O S A D E D A F A M I L I A *
*----------------------------------------------------------------------*
* Consultoria: Equipe Interna de Desenvolvimento *
* Mdulo.....: (MM) *
* Programa...: ZMMR002 *
* Transao..: ZMM004 *
* Tipo Prog : Report *
* Descrio : pesquisa dos itens da cotao que no possuem preo *
* lanado *
* Objetivo : Chama WebServices para criao de PDC no BIONEXO com *
* base nos dados de uma cotao SAP *
*----------------------------------------------------------------------*
* C R I A O D O P R O G R A M A *
*----------------------------------------------------------------------*
* Dt Create | Consultoria | Request *
*----------------------------------------------------------------------*
* DADOS DE CRIAO DO PROGRAMA *
* 02.02.2016 |Consultoria/Nome Consultor |ECDK902836 *
************************************************************************
* 02.02.2016 |Leonardo Soares/Fabio Dezan |Verso 1.0 *
************************************************************************
* L O G D E M O D I F I C A E S *
*----------------------------------------------------------------------*
*
*======================================================================*
* No. Modif. | Solicitante |ABAP |Request *
*----------------------------------------------------------------------*
* *(1) |Nome solicitante |Programador ABAP | *
*----------------------------------------------------------------------*
* Descrio Modificao| *
*----------------------- *
*-> Descrever aqui a modificao realizada, cada linha modificada ir *

*-> possuir o identificador do No. Modif. *(1),este nmero sequencial*


*-> de acordo com a modificao/data realizada *
*======================================================================*

report zmmr002 no standard page heading message-id zmm.

*----------------------------------------------------------------------*
* INCLUDES
*----------------------------------------------------------------------*

include: zlibrary.

*--------------------------------------------------------------------*
* C L A S S E S
*--------------------------------------------------------------------*
*---------------------------------------------------------------------*
* Definies das classes usadas ALV
*---------------------------------------------------------------------*
class lcl_eventos_grid definition deferred.

data: g_evt_master type ref to lcl_eventos_grid.

*----------------------------------------------------------------------*
* CLASS lcl_eventos_grid DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_eventos_grid definition.
public section.
methods:

hotspot_click for event hotspot_click of cl_gui_alv_grid


importing e_row_id e_column_id es_row_no,

handle_data_changed for event data_changed


of cl_gui_alv_grid importing er_data_changed e_ucomm,

handle_user_command
for event user_command of cl_gui_alv_grid
importing e_ucomm.

endclass. "cl_eventos_grid DEFINITION

*----------------------------------------------------------------------*
* CLASS lcl_eventos_grid IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_eventos_grid implementation.

method hotspot_click.

if ( e_column_id = 'EBELN' ) and ( sy-dynnr = '9000').


perform f_call_me43 using e_row_id e_column_id es_row_no..
endif.

if ( e_column_id = 'LIFNR' ) and ( sy-dynnr = '9000').


perform f_call_xk03 using e_row_id e_column_id es_row_no..
endif.

if ( e_column_id = 'MATNR' ) and ( sy-dynnr = '9000').


perform f_call_mm03 using e_row_id e_column_id es_row_no..
endif.

endmethod. "HOTSPOT_CLICK

method handle_data_changed.

perform f_9000_chg_mark using er_data_changed e_ucomm.


endmethod.
method handle_user_command.

data: i_rows type lvc_t_row.

* CALL METHOD g_grid->get_selected_rows


* IMPORTING
* et_index_rows = i_rows.

call method cl_gui_cfw=>flush.

if e_ucomm = 'RECUSA'.
perform alv_user_command.
endif.

* PERFORM alv_user_command IN PROGRAM (g_programa)


* USING e_ucomm CHANGING i_rows[].
endmethod.

endclass.

*----------------------------------------------------------------------*
* TABLES
*----------------------------------------------------------------------*
tables:
ekko. "Cab. de Documento de Materiais
*----------------------------------------------------------------------*
* CONSTANTS
*----------------------------------------------------------------------*

*---------------------------------------------------------------------*
* TYPES
*----------------------------------------------------------------------*
types: begin of ty_output,
mark type xfeld,
bukrs type ekko-bukrs, "Empresa
ebeln type ekko-ebeln, "Doc. de Compras
bsart type ekko-bsart, "Tipo de Documento
aedat type ekko-aedat, "Data Criao
ernam type ekko-ernam, "Criado por
tx_ernam type usalias, "Denominao Usurio"
lifnr type lfa1-lifnr, "Cd. de Fornecedor
tx_name1 type lfa1-name1, "Den. Fornecedor
submi type ekko-submi, "RFQ Coletiva
angdt type ekko-angdt, "Prz.Apres.Cotao
ebelp type ekpo-ebelp, "Item
matnr type ekpo-matnr, "Cd. Material
txz01 type ekpo-txz01, "Texto Material
werks type ekpo-werks, "Centro
lgort type ekpo-lgort, "Depsito
menge type ekpo-menge, "Quantidade
netpr type ekpo-netpr, "Valor Unitrio
brtwr type ekpo-brtwr, "Valor Bruto
end of ty_output.

*----------------------------------------------------------------------*
* TABELAS INTENAS
*----------------------------------------------------------------------*
data:
lt_ekko type table of ekko,
lt_ekpo type table of ekpo,
lt_makt type table of makt,
lt_lfa1 type table of lfa1,
lt_users type table of usrefus,
lt_output type ty_output occurs 0,
lt_sort_master type lvc_t_sort,
lt_fieldcat_master type lvc_t_fcat,

*----------------------------------------------------------------------*
* WORK REAS
*----------------------------------------------------------------------*
wl_ekko type ekko,
wl_ekpo type ekpo,
wl_lfa1 type lfa1,
wl_makt type makt,
wl_users type usrefus,
wl_output type ty_output,
wl_sort like line of lt_sort_master,
ls_layout_master type lvc_s_layo,
ls_variant type disvariant,
ls_fieldcat type lvc_s_fcat,

*----------------------------------------------------------------------*
* VARIVEIS GLOBAIS
*----------------------------------------------------------------------*
lv_seq type i,
lv_col type i,

*----------------------------------------------------------------------*
* OUTRAS DECLARAES
*----------------------------------------------------------------------*

lo_grd_master type ref to cl_gui_alv_grid,


lo_cont_master type ref to cl_gui_custom_container.

*----------------------------------------------------------------------*
* SELECTION-SCREEN
*----------------------------------------------------------------------*
selection-screen: begin of block b1 with frame title text-h01.
parameters: p_ebeln type ekko-ebeln obligatory,
p_submi type ekko-submi.
selection-screen: end of block b1.

*----------------------------------------------------------------------*
* INITIALIZATION
*----------------------------------------------------------------------*
initialization.
ls_variant-report = sy-repid.
ls_variant-username = sy-uname.

*----------------------------------------------------------------------*
* AT SELECTION-SCREEN - PBO
*----------------------------------------------------------------------*
at selection-screen.

*----------------------------------------------------------------------*
* AT SELECTION-SCREEN OUTPUT - PAI
*----------------------------------------------------------------------*
at selection-screen output.

*----------------------------------------------------------------------*
* START-OF-SELECTION
*----------------------------------------------------------------------*

start-of-selection.

perform f_select_data.

perform f_process_data.

perform f_show_grid.

*--------------------------------------------------------------------*
* F O R M S
*--------------------------------------------------------------------*

*&---------------------------------------------------------------------*
*& Form F_SELECT_DATA
*&---------------------------------------------------------------------*
* Seleciona dados da tabela conforme parmetros
*----------------------------------------------------------------------*
form f_select_data .

clear: lt_ekko, lt_ekpo.

select * into table lt_ekko


from ekko
where ebeln = p_ebeln
and bstyp = 'A'
and statu = ''
and loekz = ''.

if sy-subrc = 0.

select * into table lt_ekpo


from ekpo
for all entries in lt_ekko
where ebeln = lt_ekko-ebeln.

select * into table lt_users


from usrefus
for all entries in lt_ekko
where bname = lt_ekko-ernam.

select * into table lt_makt


from makt
for all entries in lt_ekpo
where matnr = lt_ekpo-matnr.

select * into table lt_users


from usrefus
for all entries in lt_ekko
where bname = lt_ekko-ernam.

select * into table lt_lfa1


from lfa1
for all entries in lt_ekko
where lifnr = lt_ekko-lifnr.

else.
message e012(zmm). "Dados no encontrados

endif.

endform. " F_SELECT_DATA


*&---------------------------------------------------------------------*
*& Form F_PROCESS_DATA
*&---------------------------------------------------------------------*
* Monta sada com dados selecionados
*----------------------------------------------------------------------*
form f_process_data .

clear: lt_output.

sort lt_ekko by ebeln.


sort lt_ekpo by ebeln ebelp.

loop at lt_ekko into wl_ekko.

* MONTA ITENS PARA O PEDIDO


loop at lt_ekpo into wl_ekpo where ebeln = wl_ekko-ebeln.

move: wl_ekko-bukrs to wl_output-bukrs,


wl_ekko-ebeln to wl_output-ebeln,
wl_ekko-bsart to wl_output-bsart,
wl_ekko-aedat to wl_output-aedat,
wl_ekko-ernam to wl_output-ernam,
wl_ekko-lifnr to wl_output-lifnr,
wl_ekko-submi to wl_output-submi,
wl_ekko-angdt to wl_output-angdt.

* RECUPERA NOME DO USURIO


call function 'SUSR_USER_READ'
exporting
user_name = wl_output-ernam
importing
alias = wl_output-tx_ernam.

* RECUPERA NOME DO FORNECEDOR


clear: wl_lfa1.
read table lt_lfa1 into wl_lfa1 with key lifnr = wl_output-lifnr.
if sy-subrc = 0.
move: wl_lfa1-name1 to wl_output-tx_name1.
endif.
move: wl_ekpo-ebelp to wl_output-ebelp,
wl_ekpo-matnr to wl_output-matnr,
wl_ekpo-werks to wl_output-werks,
wl_ekpo-menge to wl_output-menge,
wl_ekpo-lgort to wl_output-lgort,
wl_ekpo-netpr to wl_output-netpr,
wl_ekpo-brtwr to wl_output-brtwr.

* RECUPERA TEXTO DO MATERIAL


clear: wl_makt.
read table lt_makt into wl_makt with key matnr = wl_output-matnr.
if sy-subrc = 0.
move: wl_makt-maktx to wl_output-txz01.
endif.

append wl_output to lt_output.


clear: wl_ekpo, wl_output.
endloop.

clear: wl_ekko.
endloop.

endform. " F_PROCESS_DATA


*&---------------------------------------------------------------------*
*& Form F_SHOW_GRID
*&---------------------------------------------------------------------*
* Exibe ALV de sada
*----------------------------------------------------------------------*
form f_show_grid .

check lo_cont_master is initial.

perform f_inst_obj.

perform f_def_lyt.

perform f_mnt_fieldcat_master.

perform f_set_evt_master.
*
perform f_mount_grid_master.

endform. " F_SHOW_GRID


*&---------------------------------------------------------------------*
*& Form F_INST_OBJ
*&---------------------------------------------------------------------*
* Instancia objetos do ALV de sada de dados
*----------------------------------------------------------------------*
form f_inst_obj .

create object lo_cont_master


exporting
container_name = 'C_OBJ_MASTER'.

create object lo_grd_master


exporting
i_parent = lo_cont_master.
create object g_evt_master.

endform. " F_INST_OBJ


*&---------------------------------------------------------------------*
*& Form F_DEF_LYT
*&---------------------------------------------------------------------*
* Define opes de Layout do ALV de sada
*----------------------------------------------------------------------*
form f_def_lyt .

clear ls_layout_master.

ls_layout_master-grid_title = 'MM - Cotaes p/ Recusa'. "#EC NOTEXT


ls_layout_master-sel_mode = 'A'.
ls_layout_master-no_rowmark = 'X'.

endform. " F_DEF_LYT


*&---------------------------------------------------------------------*
*& Form F_MNT_FIELDCAT_MASTER
*&---------------------------------------------------------------------*
* Monta campos de sada de ALV
*----------------------------------------------------------------------*
form f_mnt_fieldcat_master .
clear: lv_col.

add 1 to lv_col.

refresh: lt_fieldcat_master.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'MARK'. "Status Documento
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h16.
ls_fieldcat-scrtext_m = text-h16.
ls_fieldcat-scrtext_s = text-h16.
ls_fieldcat-reptext = text-h16.
ls_fieldcat-just = 'C'.
ls_fieldcat-checkbox = 'X'.
ls_fieldcat-edit = 'X'.
ls_fieldcat-outputlen = 03.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'BUKRS'. "Empresa
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h05.
ls_fieldcat-scrtext_m = text-h05.
ls_fieldcat-scrtext_s = text-h05.
ls_fieldcat-reptext = text-h05.
ls_fieldcat-just = 'C'.
ls_fieldcat-outputlen = 5.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'EBELN'. "Doc. Compras
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h06.
ls_fieldcat-scrtext_m = text-h06.
ls_fieldcat-scrtext_s = text-h06.
ls_fieldcat-reptext = text-h06.
ls_fieldcat-just = 'C'.
ls_fieldcat-emphasize = 'X'.
ls_fieldcat-hotspot = 'X'.
ls_fieldcat-outputlen = 13.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'BSART'. "Tipo Documento
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h08.
ls_fieldcat-scrtext_m = text-h08.
ls_fieldcat-scrtext_s = text-h08.
ls_fieldcat-reptext = text-h08.
ls_fieldcat-just = 'C'.
ls_fieldcat-outputlen = 7.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'AEDAT'. "Data Criao
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h09.
ls_fieldcat-scrtext_m = text-h09.
ls_fieldcat-scrtext_s = text-h09.
ls_fieldcat-reptext = text-h09.
ls_fieldcat-just = 'C'.
ls_fieldcat-outputlen = 11.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'ERNAM'. "Criado por
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h10.
ls_fieldcat-scrtext_m = text-h10.
ls_fieldcat-scrtext_s = text-h10.
ls_fieldcat-reptext = text-h10.
ls_fieldcat-just = 'C'.
ls_fieldcat-outputlen = 9.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'TX_ERNAM'. "Nome do usurio
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h02.
ls_fieldcat-scrtext_m = text-h02.
ls_fieldcat-scrtext_s = text-h02.
ls_fieldcat-reptext = text-h02.
ls_fieldcat-just = 'L'.
ls_fieldcat-outputlen = 17.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'LIFNR'. "Cd. Fornecedor
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h11.
ls_fieldcat-scrtext_m = text-h11.
ls_fieldcat-scrtext_s = text-h11.
ls_fieldcat-reptext = text-h11.
ls_fieldcat-just = 'C'.
ls_fieldcat-no_zero = 'X'.
ls_fieldcat-outputlen = 8.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'TX_NAME1'. "Nome Fornecedor
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h03.
ls_fieldcat-scrtext_m = text-h03.
ls_fieldcat-scrtext_s = text-h03.
ls_fieldcat-reptext = text-h03.
ls_fieldcat-just = 'L'.
ls_fieldcat-outputlen = 20.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'SUBMI'.
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h07.
ls_fieldcat-scrtext_m = text-h07.
ls_fieldcat-scrtext_s = text-h07.
ls_fieldcat-reptext = text-h07.
ls_fieldcat-just = 'C'.
ls_fieldcat-outputlen = 13.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'ANGDT'.
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h04.
ls_fieldcat-scrtext_m = text-h04.
ls_fieldcat-scrtext_s = text-h04.
ls_fieldcat-reptext = text-h04.
ls_fieldcat-just = 'C'.
ls_fieldcat-outputlen = 13.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'EBELP'.
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h21.
ls_fieldcat-scrtext_m = text-h21.
ls_fieldcat-scrtext_s = text-h21.
ls_fieldcat-reptext = text-h21.
ls_fieldcat-just = 'C'.
ls_fieldcat-outputlen = 6.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'MATNR'.
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h22.
ls_fieldcat-scrtext_m = text-h22.
ls_fieldcat-scrtext_s = text-h22.
ls_fieldcat-reptext = text-h22.
ls_fieldcat-just = 'C'.
ls_fieldcat-no_zero = 'X'.
ls_fieldcat-hotspot = 'X'.
ls_fieldcat-outputlen = 11.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'TXZ01'.
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h23.
ls_fieldcat-scrtext_m = text-h23.
ls_fieldcat-scrtext_s = text-h23.
ls_fieldcat-reptext = text-h23.
ls_fieldcat-just = 'L'.
ls_fieldcat-outputlen = 30.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'WERKS'.
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h24.
ls_fieldcat-scrtext_m = text-h24.
ls_fieldcat-scrtext_s = text-h24.
ls_fieldcat-reptext = text-h24.
ls_fieldcat-just = 'C'.
ls_fieldcat-outputlen = 6.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'LGORT'.
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h25.
ls_fieldcat-scrtext_m = text-h25.
ls_fieldcat-scrtext_s = text-h25.
ls_fieldcat-reptext = text-h25.
ls_fieldcat-just = 'C'.
ls_fieldcat-outputlen = 8.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.
clear: ls_fieldcat.
ls_fieldcat-fieldname = 'MENGE'.
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h30.
ls_fieldcat-scrtext_m = text-h30.
ls_fieldcat-scrtext_s = text-h30.
ls_fieldcat-reptext = text-h30.
ls_fieldcat-just = 'R'.
ls_fieldcat-do_sum = 'X'.
ls_fieldcat-outputlen = 12.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'NETPR'.
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h29.
ls_fieldcat-scrtext_m = text-h29.
ls_fieldcat-scrtext_s = text-h29.
ls_fieldcat-reptext = text-h29.
ls_fieldcat-just = 'R'.
ls_fieldcat-outputlen = 15.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

clear: ls_fieldcat.
ls_fieldcat-fieldname = 'BRTWR'.
ls_fieldcat-col_pos = lv_col.
ls_fieldcat-scrtext_l = text-h31.
ls_fieldcat-scrtext_m = text-h31.
ls_fieldcat-scrtext_s = text-h31.
ls_fieldcat-reptext = text-h31.
ls_fieldcat-just = 'R'.
ls_fieldcat-do_sum = 'X'.
ls_fieldcat-outputlen = 12.
append ls_fieldcat to lt_fieldcat_master.
clear: ls_fieldcat. add 1 to lv_col.

endform. " F_MNT_FIELDCAT_MASTER


*&---------------------------------------------------------------------*
*& Form F_SET_EVT_MASTER
*&---------------------------------------------------------------------*
* Define eventos do grid de sa;ida principal
*----------------------------------------------------------------------*
form f_set_evt_master .

set handler g_evt_master->hotspot_click for lo_grd_master.

endform. " F_SET_EVT_MASTER


*&---------------------------------------------------------------------*
*& Form F_MOUNT_GRID_MASTER
*&---------------------------------------------------------------------*
* Monta ALV de sada
*----------------------------------------------------------------------*
form f_mount_grid_master .

refresh lt_sort_master.
clear wl_sort.
wl_sort-spos = 1.
wl_sort-fieldname = 'EBELN'.
wl_sort-up = 'X'.
wl_sort-subtot = 'X'.
wl_sort-group = 'X'.

append wl_sort to lt_sort_master.


clear wl_sort.

* wl_sort-spos = 2.
* wl_sort-fieldname = 'EBELP'.
* wl_sort-up = 'X'.
* wl_sort-subtot = 'X'.
* wl_sort-group = 'X'.
* APPEND wl_sort TO lt_sort_master.
* CLEAR wl_sort.

sort lt_output by ebeln ebelp.

call method lo_grd_master->set_table_for_first_display


exporting
i_save = 'U'
is_variant = ls_variant
is_layout = ls_layout_master
changing
it_outtab = lt_output[]
it_sort = lt_sort_master[]
it_fieldcatalog = lt_fieldcat_master[].

call screen 9000.

endform. " F_MOUNT_GRID_MASTER


*&---------------------------------------------------------------------*
*& Module M_PBO_9000 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module m_pbo_9000 output.

endmodule. " M_PBO_9000 OUTPUT


*&---------------------------------------------------------------------*
*& Module M_STATUS_9000 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module m_status_9000 output.

set pf-status 'STATUS_9000'.


set titlebar 'TIT_9000'.
endmodule. " M_STATUS_9000 OUTPUT
*&---------------------------------------------------------------------*
*& Module M_PAI INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module m_pai input.
case sy-ucomm.
when 'BACK'.
leave to screen 0.
when 'EXIT'.
leave to screen 0.
when 'CANCEL'.
leave to screen 0.
endcase.

endmodule. " M_PAI INPUT


*&---------------------------------------------------------------------*
*& Form F_CALL_ME43
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_E_ROW_ID text
* -->P_E_COLUMN_ID text
* -->P_ES_ROW_NO text
*----------------------------------------------------------------------*
form f_call_me43 using p_e_row_id
p_e_column_id
p_es_row_no.
data:vl_index type i.

vl_index = p_e_row_id.

read table lt_output into wl_output index vl_index.

set parameter id 'ANF' field wl_output-ebeln.


call transaction 'ME43' and skip first screen.
endform. " F_CALL_ME43
*&---------------------------------------------------------------------*
*& Form F_CALL_XK03
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_E_ROW_ID text
* -->P_E_COLUMN_ID text
* -->P_ES_ROW_NO text
*----------------------------------------------------------------------*
form f_call_xk03 using p_e_row_id
p_e_column_id
p_es_row_no.

data:vl_index type i.

vl_index = p_e_row_id.

read table lt_output into wl_output index vl_index.

set parameter id 'LIF' field wl_output-lifnr.


call transaction 'XK03' and skip first screen.

endform. " F_CALL_XK03


*&---------------------------------------------------------------------*
*& Form F_CALL_MM03
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_E_ROW_ID text
* -->P_E_COLUMN_ID text
* -->P_ES_ROW_NO text
*----------------------------------------------------------------------*
form f_call_mm03 using p_e_row_id
p_e_column_id
p_es_row_no.

data:vl_index type i.

vl_index = p_e_row_id.

read table lt_output into wl_output index vl_index.

set parameter id 'MAT' field wl_output-matnr.


call transaction 'MM03' and skip first screen.
endform. " F_CALL_MM03
*&---------------------------------------------------------------------*
*& Form F_9000_CHG_MARK
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_ER_DATA_CHANGED text
* -->P_E_UCOMM text
*----------------------------------------------------------------------*
form f_9000_chg_mark using fcl_data type ref to cl_alv_changed_data_protocol
f_ucomm type sy-ucomm. "#EC NEEDED

data: lw_mod_cells type lvc_s_modi.

data: lv_mark type c.

loop at fcl_data->mt_good_cells into lw_mod_cells.

case lw_mod_cells-fieldname.

when 'MARK'.

call method fcl_data->get_cell_value


exporting
i_row_id = lw_mod_cells-row_id
i_fieldname = lw_mod_cells-fieldname
importing
e_value = lv_mark.

endcase.

endloop.

endform. " F_9000_CHG_MARK


*&---------------------------------------------------------------------*
*& Form ALV_USER_COMMAND
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form alv_user_command .

break rnetto.

endform. " ALV_USER_COMMAND

Você também pode gostar