Escolar Documentos
Profissional Documentos
Cultura Documentos
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* // //=== ||===== *
* // \\ || || *
* //===\\ ====|| ||===== *
* // \\ || || *
* // \\ ====// || *
*----------------------------------------------------------------------*
* 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 *
*----------------------------------------------------------------------*
* INCLUDES
*----------------------------------------------------------------------*
include: zlibrary.
*--------------------------------------------------------------------*
* C L A S S E S
*--------------------------------------------------------------------*
*---------------------------------------------------------------------*
* Definies das classes usadas ALV
*---------------------------------------------------------------------*
class lcl_eventos_grid definition deferred.
*----------------------------------------------------------------------*
* CLASS lcl_eventos_grid DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_eventos_grid definition.
public section.
methods:
handle_user_command
for event user_command of cl_gui_alv_grid
importing e_ucomm.
*----------------------------------------------------------------------*
* CLASS lcl_eventos_grid IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_eventos_grid implementation.
method hotspot_click.
endmethod. "HOTSPOT_CLICK
method handle_data_changed.
if e_ucomm = 'RECUSA'.
perform alv_user_command.
endif.
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
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* 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 .
if sy-subrc = 0.
else.
message e012(zmm). "Dados no encontrados
endif.
clear: lt_output.
clear: wl_ekko.
endloop.
perform f_inst_obj.
perform f_def_lyt.
perform f_mnt_fieldcat_master.
perform f_set_evt_master.
*
perform f_mount_grid_master.
clear ls_layout_master.
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.
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'.
* 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.
vl_index = p_e_row_id.
data:vl_index type i.
vl_index = p_e_row_id.
data:vl_index type i.
vl_index = p_e_row_id.
case lw_mod_cells-fieldname.
when 'MARK'.
endcase.
endloop.
break rnetto.