selection-screen function key 1.
Para utiliza-la basta utilizar a colinha abaixo:
report zinsertrequest.
type-pools: ctslg , icon, slis.
include: <icon>.
tables: e070, sscrfields.
include: rsvcmacr.
************************************************************************
* Definição de estruturas: TY_... *
************************************************************************
types:
begin of ty_requests,
trkorr like e070-trkorr, "REQUEST
ddtext type dd07t-ddtext, "TIPO REQUEST
ambiente(100), "LIKE tstrfcofil-tarsystem, "Ambiente
as4user like e070-as4user,"USUARIO
autor type sy-uname,
as4date like e070-as4date,"DATA
as4time like e070-as4time,"HORA
as4text like e07t-as4text,"DESCRICAO
end of ty_requests,
begin of ty_dd07t,
domvalue_l type dd07t-domvalue_l,
ddtext type dd07t-ddtext,
end of ty_dd07t,
begin of ty_ctslg_cofile,
exists type c,
imported type c,
del_lines_only type c,
systems type ctslg_systems,
merges type ctslg_mergelines,
rc type i,
end of ty_ctslg_cofile.
data: d_butt1(4).
************************************************************************
* Variáveis de Referência ( RV_...) *
************************************************************************
data: rv_structure type ref to data,
rv_table type ref to data,
rv_struc_desc type ref to cl_abap_structdescr,
************************************************************************
* Tabela Interna ( T_...) *
************************************************************************
t_lvc_fieldcatalogue type lvc_t_fcat,
t_fieldcatalogue type slis_t_fieldcat_alv,
t_es_cofile type ty_ctslg_cofile,
t_e070 type standard table of e070,
t_e07t type standard table of e07t,
t_amb type standard table of ctslg_system,
t_requests type standard table of ty_requests,
t_dd07t type standard table of ty_dd07t,
t_tp_obj type standard table of ko100,
************************************************************************
* Work Area ( wa_...) *
************************************************************************
wa_layout type slis_layout_alv,
wa_fieldcatalogue type slis_fieldcat_alv,
wa_lvc_fieldcatalogue type lvc_s_fcat,
wa_e070 like line of t_e070,
wa_e07t like line of t_e07t,
wa_amb like line of t_amb,
wa_requests like line of t_requests,
wa_dd07t like line of t_dd07t,
wa_tp_obj like line of t_tp_obj.
************************************************************************
* Field Symbols (< fs_...> ) *
************************************************************************
*field symbols declaration
field-symbols :
<fs_it_table> type standard table,
<fs_dyn_str> type any,
<fs_str_comp> type abap_compdescr.
************************************************************************
* Constantes ( c_...) *
************************************************************************
data: c_tab type dd02l-tabname value 'ZTUPDREQ'.
************************************************************************
* Variáveis Globais (v_...) *
************************************************************************
data : v_t1 type dd02t-ddtext,
v_t2(50) type c,
v_t3(50) type c,
v_table type dd02l-tabname.
************************************************************************
* Tela de seleção
************************************************************************
selection-screen begin of block b1 with frame title text-001.
select-options: s_req for e070-trkorr.
selection-screen function key 1.
selection-screen end of block b1.
************************************************************************
initialization.
************************************************************************
move 'Exibir Registros' to sscrfields-functxt_01.
move 'Exibir Registros' to sscrfields-functxt_02.
d_butt1 = 'NO'.
v_table = c_tab.
select single ddtext
from dd02t
into v_t1
where tabname = c_tab
and ddlanguage = sy-langu.
************************************************************************
at selection-screen.
************************************************************************
if sy-ucomm = 'FC01'.
d_butt1 = 'YES'.
sscrfields-ucomm = 'ONLI'.
endif.
************************************************************************
start-of-selection.
************************************************************************
if d_butt1 = 'NO'.
if not s_req[] is initial.
perform seleciona_dados.
if not t_requests[] is initial.
perform insere_reg_tab.
endif.
endif.
elseif d_butt1 = 'YES'.
perform exibe_alv.
d_butt1 = 'NO'.
endif.
type-pools: ctslg , icon, slis.
include: <icon>.
tables: e070, sscrfields.
include: rsvcmacr.
************************************************************************
* Definição de estruturas: TY_... *
************************************************************************
types:
begin of ty_requests,
trkorr like e070-trkorr, "REQUEST
ddtext type dd07t-ddtext, "TIPO REQUEST
ambiente(100), "LIKE tstrfcofil-tarsystem, "Ambiente
as4user like e070-as4user,"USUARIO
autor type sy-uname,
as4date like e070-as4date,"DATA
as4time like e070-as4time,"HORA
as4text like e07t-as4text,"DESCRICAO
end of ty_requests,
begin of ty_dd07t,
domvalue_l type dd07t-domvalue_l,
ddtext type dd07t-ddtext,
end of ty_dd07t,
begin of ty_ctslg_cofile,
exists type c,
imported type c,
del_lines_only type c,
systems type ctslg_systems,
merges type ctslg_mergelines,
rc type i,
end of ty_ctslg_cofile.
data: d_butt1(4).
************************************************************************
* Variáveis de Referência ( RV_...) *
************************************************************************
data: rv_structure type ref to data,
rv_table type ref to data,
rv_struc_desc type ref to cl_abap_structdescr,
************************************************************************
* Tabela Interna ( T_...) *
************************************************************************
t_lvc_fieldcatalogue type lvc_t_fcat,
t_fieldcatalogue type slis_t_fieldcat_alv,
t_es_cofile type ty_ctslg_cofile,
t_e070 type standard table of e070,
t_e07t type standard table of e07t,
t_amb type standard table of ctslg_system,
t_requests type standard table of ty_requests,
t_dd07t type standard table of ty_dd07t,
t_tp_obj type standard table of ko100,
************************************************************************
* Work Area ( wa_...) *
************************************************************************
wa_layout type slis_layout_alv,
wa_fieldcatalogue type slis_fieldcat_alv,
wa_lvc_fieldcatalogue type lvc_s_fcat,
wa_e070 like line of t_e070,
wa_e07t like line of t_e07t,
wa_amb like line of t_amb,
wa_requests like line of t_requests,
wa_dd07t like line of t_dd07t,
wa_tp_obj like line of t_tp_obj.
************************************************************************
* Field Symbols (< fs_...> ) *
************************************************************************
*field symbols declaration
field-symbols :
<fs_it_table> type standard table,
<fs_dyn_str> type any,
<fs_str_comp> type abap_compdescr.
************************************************************************
* Constantes ( c_...) *
************************************************************************
data: c_tab type dd02l-tabname value 'ZTUPDREQ'.
************************************************************************
* Variáveis Globais (v_...) *
************************************************************************
data : v_t1 type dd02t-ddtext,
v_t2(50) type c,
v_t3(50) type c,
v_table type dd02l-tabname.
************************************************************************
* Tela de seleção
************************************************************************
selection-screen begin of block b1 with frame title text-001.
select-options: s_req for e070-trkorr.
selection-screen function key 1.
selection-screen end of block b1.
************************************************************************
initialization.
************************************************************************
move 'Exibir Registros' to sscrfields-functxt_01.
move 'Exibir Registros' to sscrfields-functxt_02.
d_butt1 = 'NO'.
v_table = c_tab.
select single ddtext
from dd02t
into v_t1
where tabname = c_tab
and ddlanguage = sy-langu.
************************************************************************
at selection-screen.
************************************************************************
if sy-ucomm = 'FC01'.
d_butt1 = 'YES'.
sscrfields-ucomm = 'ONLI'.
endif.
************************************************************************
start-of-selection.
************************************************************************
if d_butt1 = 'NO'.
if not s_req[] is initial.
perform seleciona_dados.
if not t_requests[] is initial.
perform insere_reg_tab.
endif.
endif.
elseif d_butt1 = 'YES'.
perform exibe_alv.
d_butt1 = 'NO'.
endif.
Nenhum comentário:
Postar um comentário