Вы находитесь на странице: 1из 110

************************************************************************

* Nome programma
: Z1FI_FII049_UT_WIND_TELECOM
* Autore
: Antonio Petrone AE00405
* Data creazione
: <01.02.2010>
* RDM
: CC-M09-SAP-AA-0060
* Funzionalit del programma: WF CESPITI - ZENIT
*
* Descrizione di dettaglio : <descrizione ampliata>
*
* Autore modifica
: <nome> <cognome> <azienda>
* Data modifica
: <data modifica>
* Motivo intervento
: <descrizione>
**
************************************************************************
program z1aa_fie113_01 .
***
include z1aa_fie113_01_top.
***
include z1aa_fie113_01_for.
INCLUDE Z1AA_FIE113_01_MOD.
include z1aa_fie113_01_top.
*----------------------------------------------------------------------*
*
INCLUDE Z1AA_FIE113_01_TOP
*
*----------------------------------------------------------------------*
tables: ztaa_fie113_wf_t,
ztaa_fie113_wf_p,
ztaa_fie113_wf_c,
ztaa_fie113_wf_m,
ztaa_fie113_wf_n,
ztaa_fie113_wf_u,
ztaa_fie113_wf_v,
ztaa_fie113_wf_z,
ra01m,
t001,
tgsbt,
t087t,
cskt,
t006d,
t087s,
t087j,
icon,
t006,
t097t,
ztbcusto,
t087l,
anlz,
t087v,
t093c,
csks,
tgsb,
dd07t.
data: begin of tb_testata occurs 0.
include structure ztaa_fie113_wf_t.
data end of tb_testata.

data: begin of tb_pos occurs 0.


include structure zsaa_fie113_wf_posizioni.
data: celltab type lvc_t_styl.
data end of tb_pos.
data: begin of appo_pos.
include structure zsaa_fie113_wf_posizioni.
data: celltab type lvc_t_styl.
data end of appo_pos.
data: begin of tb_pos_check occurs 0.
include structure zsaa_fie113_wf_posizioni.
data: celltab type lvc_t_styl.
data end of tb_pos_check.
data: begin of tb_pos_save occurs 0.
include structure zsaa_fie113_wf_posizioni.
data end of tb_pos_save.
data: begin of va_pos.
include structure zsaa_fie113_wf_posizioni.
data: celltab type lvc_t_styl.
data: end of va_pos.
data: begin of gs_tab,
first_reached,
last_reached,
end of gs_tab.
data: begin of tb_pos_old occurs 0.
data: id_old like ztaa_fie113_wf_p-id,
gjahr_old like ztaa_fie113_wf_p-gjahr,
prozs like ztaa_fie113_wf_p-prozs,
valore like ztaa_fie113_wf_p-valore.
data end of tb_pos_old.
data: begin of tb_fogli occurs 0.
include structure zsaa_fie113_wf_view.
data end of tb_fogli.
data: begin of tb_fogli_bapi occurs 0.
include structure zsaa_fie113_wf_view.
data end of tb_fogli_bapi.
data: begin of tb_fogli_view occurs 0.
include structure zsaa_fie113_wf_view.
data end of tb_fogli_view.
data: begin of tb_cespiti occurs 0.
include structure zsaa_fie113_wf_cespiti.
data end of tb_cespiti.
data: begin of t_cespiti occurs 0.
include structure zsaa_fie113_wf_cespiti.
data end of t_cespiti.
data: begin of tb_ztaa_fie113_wf_z occurs 0.
include structure ztaa_fie113_wf_z.
data end of tb_ztaa_fie113_wf_z.

data wa_pos like ztaa_fie113_wf_p.


data: begin of origindocreference.
include structure bapifapo_doc_ref.
data: end of origindocreference.
data: begin of generalpostingdata.
include structure bapifapo_gen_info.
data: end of generalpostingdata.
data: begin of retirementdata.
include structure bapifapo_ret.
data: end of retirementdata.
data: begin of accountassignments.
include structure bapifapo_acc_ass.
data: end of accountassignments.
data: begin of furtherpostingdata.
include structure bapifapo_add_info.
data: end of furtherpostingdata.
data: begin of documentreference.
include structure bapifapo_doc_ref.
data: end of documentreference.
data: begin of return.
include structure bapiret2.
data: end of return.
types: g_ty_s_log type zsaa_fie113_wf_log.
types: begin of g_ty_s_outtab.
include type g_ty_s_log.
types:
end
of g_ty_s_outtab,
g_ty_t_outtab type table of g_ty_s_outtab.
data: gt_log
type g_ty_t_outtab.
data: gs_log type g_ty_s_outtab.
data begin of gt_log_bapi occurs 0.
include structure zsaa_fie113_wf_log.
data end of gt_log_bapi.
data: begin of tb_cespiti_bapi occurs 0.
include structure zsaa_fie113_wf_cespiti.
data end of tb_cespiti_bapi.
*** ------- Variabili -------- ***
data okcode like sy-ucomm.
data flag_save.
data: okcode_2 like sy-ucomm.
data: va_societa(25).
data: va_tipo(15).
data: va_motivo(15).
data: va_unita(25).
data: va_gjahr(4).
data: va_uname(10).
data: va_bldat(10).
data: va_budat(10).
data: tip(2)
type c,
area(2)
type c,
flag-imp type c,
flag-ar_terr type c.

data vn_meins like ztaa_fie113_wf_p-meins.


data vn_menge like ztaa_fie113_wf_p-menge.
data: va_flag_ci.
data: va_flag_61.
data valore_medio type dec11_4.
data pict_flag(1) type c value 'X'.
* data declaration
data: ok_code like sy-ucomm,
save_ok like sy-ucomm,
m type i,
g_container type scrfname value 'G_DISMISSIONI',
grid type ref to cl_gui_alv_grid,
g_custom_container type ref to cl_gui_custom_container,
gs_layout type lvc_s_layo,
gt_fieldcat_lvc type lvc_t_fcat with header line.
data: g_container_4 type scrfname value 'G_CESPITI',
grid_4 type ref to cl_gui_alv_grid,
g_custom_container_4 type ref to cl_gui_custom_container,
gs_layout_4 type lvc_s_layo,
it_tooolbar_excluding type ui_functions,
gt_fieldcat_lvc_4 type lvc_t_fcat with header line.
data: g_container_popup type scrfname value 'POPUP',
grid_popup type ref to cl_gui_alv_grid,
g_custom_container_popup type ref to cl_gui_custom_container,
gs_layout_popup type lvc_s_layo,
it_tooolbar_excluding_popup type ui_functions,
gt_fieldcat_lvc_popup type lvc_t_fcat with header line.
data: gt_outtab type table of ztaa_fie113_wf_p.
data: g_picture_control type ref to cl_gui_picture,
g_picture_container type ref to cl_gui_custom_container.
data: g_picture_control_logo type ref to cl_gui_picture,
g_picture_container_logo type ref to cl_gui_custom_container.
data: gr_container_log
gr_grid_log

type ref to cl_gui_custom_container,


type ref to cl_gui_alv_grid.

ranges r_anlkl for anla-anlkl.


ranges r_ord41 for anla-ord41.
ranges r_ord42 for anla-ord42.
ranges r_ord43 for anla-ord43.
ranges r_ord44 for anla-ord44.
ranges r_zujhr for anla-zujhr.
ranges r_gdlgrp for anla-gdlgrp.
ranges r_eigkz for anla-eigkz.
ranges r_anlue for anla-anlue.
ranges r_gsber for anlz-gsber.
ranges r_kostl for anlz-kostl.
ranges r_zujhr_pos for anla-zujhr.
*ranges r_zujhr for anla-zujhr.
data begin of va_zujhr.
data: sign(1),

option(2),
low type zujhr,
high type zujhr.
data end of va_zujhr.
* FUNCTION CODES FOR TABSTRIP 'STRIP_200'
constants: begin of c_strip_200,
tab1 like sy-ucomm value 'STRIP_200_FC1',
tab2 like sy-ucomm value 'STRIP_200_FC2',
end of c_strip_200.
* DATA FOR TABSTRIP 'STRIP_200'
controls: strip_200 type tabstrip.
data:
begin of g_strip_200,
subscreen
like sy-dynnr,
prog
like sy-repid value 'Z1AA_FIE113_01',
pressed_tab like sy-ucomm value c_strip_200-tab1,
end of g_strip_200.
data: va_gdlgrp like anla-gdlgrp.
*************************************************************
*----------------------------------------------------------------------*
*
CLASS lcl_event_handler DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_event_handler definition.
public section.
methods:
**Gestire nuovi pulsanti inseriti
handle_user_command for event user_command of cl_gui_alv_grid
importing e_ucomm,
**Aggiungere pulsanti alla toolbar
handle_toolbar for event toolbar of cl_gui_alv_grid
importing e_object e_interactive,
**Gestire hotspot click
handle_hotspot_click for event hotspot_click of cl_gui_alv_grid
importing e_row_id e_column_id es_row_no,
handle_hotspot_click_log for event hotspot_click of
cl_gui_alv_grid
importing e_row_id e_column_id es_row_no,
*Double-click control
handle_double_click
for event double_click of cl_gui_alv_grid
importing e_row e_column es_row_no,
**Un modo ad oggetti per gestire controlli
handle_double_click_log
for event double_click of cl_gui_alv_grid
importing e_row e_column es_row_no,
**dei dati quando si edita un'alv grid
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

private section.
data: error_in_data type c.
* Methods to modularize event handler method HANDLE_DATA_CHANGED:
methods: check_valore
importing
ps_good_valore type lvc_s_modi
pr_data_changed type ref to cl_alv_changed_data_protocol.
* Methods to modularize event handler method HANDLE_DATA_CHANGED:
methods: check_prozs
importing
ps_good_prozs type lvc_s_modi
pr_data_changed type ref to cl_alv_changed_data_protocol.
* Methods to modularize event handler method HANDLE_DATA_CHANGED:
methods: check_menge
importing
ps_good_menge type lvc_s_modi
pr_data_changed type ref to cl_alv_changed_data_protocol.
methods: check_zujhr
importing
ps_good_zujhr type lvc_s_modi
pr_data_changed type ref to cl_alv_changed_data_protocol.
methods: check_zujhr_a
importing
ps_good_zujhr_a type lvc_s_modi
pr_data_changed type ref to cl_alv_changed_data_protocol.
methods: check_zflag_ci
importing
ps_good_zflag_ci type lvc_s_modi
pr_data_changed type ref to cl_alv_changed_data_protocol.
endclass.

"lcl_event_handler DEFINITION

*----------------------------------------------------------------------*
*
CLASS lcl_event_handler IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_event_handler implementation .
method handle_user_command.
perform handle_user_command using e_ucomm.
endmethod.
"handle_user_command
method handle_toolbar.
perform handle_toolbar using e_object e_interactive .
endmethod .
"handle_toolbar
method handle_hotspot_click.
perform hotspot_click using e_row_id e_column_id es_row_no.
endmethod .
"handle_hotspot_click
method handle_hotspot_click_log.
perform hotspot_click_log using e_row_id e_column_id es_row_no.

endmethod.
method handle_double_click.
perform handle_double_click using e_row e_column es_row_no.
endmethod .
"handle_double_click
method handle_double_click_log.
perform handle_double_click_log using e_row e_column es_row_no.
endmethod .
"handle_double_click

*
*
*
*

method handle_data_changed.
perform handle_data_changed using er_data_changed
e_onf4
e_onf4_before
e_onf4_after.
data: ls_good type lvc_s_modi.

loop at er_data_changed->mt_good_cells into ls_good.


case ls_good-fieldname.
* check if column VALORE of this row was changed
when 'VALORE'.
call method check_valore
exporting
ps_good_valore = ls_good
pr_data_changed
= er_data_changed.
* check if column PERCENTUALE of this row was changed
when 'PROZS'.
call method check_prozs
exporting
ps_good_prozs
= ls_good
pr_data_changed = er_data_changed.
when 'MENGE'.
call method check_menge
exporting
ps_good_menge
= ls_good
pr_data_changed = er_data_changed.
when 'ZUJHR'.
call method check_zujhr
exporting
ps_good_zujhr
= ls_good
pr_data_changed = er_data_changed.
when 'ZUJHR_A'.
call method check_zujhr_a
exporting
ps_good_zujhr_a
= ls_good
pr_data_changed = er_data_changed.
when 'ZFLAG_CI'.
call method check_zflag_ci
exporting
ps_good_zflag_ci
= ls_good
pr_data_changed = er_data_changed.

endcase.
endloop.
if error_in_data eq 'X'.
call method er_data_changed->display_protocol.
endif.
endmethod .

"handle_DATA_CHANGED

method check_valore.
data: l_valore type btrab,
l_prozs type prozs,
l_menge type menge_d,
ls_good_valore type lvc_s_modi.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_valore-row_id
i_fieldname = ps_good_valore-fieldname
importing e_value
= l_valore.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_valore-row_id
i_fieldname = 'PROZS'
importing e_value
= l_prozs.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_valore-row_id
i_fieldname = 'MENGE'
importing e_value
= l_menge.
if not l_prozs is initial and
not l_valore is initial.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '027' i_msgty = 'E'
i_msgv1 = text-m03
"Flugzeugtyp
i_msgv2 = l_valore
i_msgv3 = text-m05
"exitstiert nicht
i_fieldname = ps_good_valore-fieldname
i_row_id = ps_good_valore-row_id.
error_in_data = 'X'.
exit.
endif.
if not l_prozs is initial and
not l_menge is initial.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '027' i_msgty = 'E'
i_msgv1 = text-m03
"Flugzeugtyp
i_msgv2 = l_valore
i_msgv3 = text-m05
"exitstiert nicht

i_fieldname = ps_good_valore-fieldname
i_row_id = ps_good_valore-row_id.
error_in_data = 'X'.
exit.
endif.
if not l_valore is initial and
not l_menge is initial.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '027' i_msgty = 'E'
i_msgv1 = text-m03
"Flugzeugtyp
i_msgv2 = l_valore
i_msgv3 = text-m05
"exitstiert nicht
i_fieldname = ps_good_valore-fieldname
i_row_id = ps_good_valore-row_id.
error_in_data = 'X'.
exit.
endif.
if l_prozs is initial and
l_valore is initial and
l_menge is initial.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '028' i_msgty = 'E'
i_msgv1 = text-m03
"Flugzeugtyp
i_msgv2 = l_valore
i_msgv3 = text-m05
"exitstiert nicht
i_fieldname = ps_good_valore-fieldname
i_row_id = ps_good_valore-row_id.
exit.
endif.
call method grid->refresh_table_display.
endmethod.
" valore
method check_prozs.
data: l_valore type btrab,
l_prozs type prozs,
l_menge type menge_d,
ls_good_prozs type lvc_s_modi.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_prozs-row_id
i_fieldname = ps_good_prozs-fieldname
importing e_value
= l_prozs.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_prozs-row_id
i_fieldname = 'VALORE'
importing e_value
= l_valore.

call method pr_data_changed->get_cell_value


exporting i_row_id =
ps_good_prozs-row_id
i_fieldname = 'MENGE'
importing e_value
= l_menge.
if not l_prozs is initial and
not l_valore is initial.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '027' i_msgty = 'E'
i_msgv1 = text-m03
"Flugzeugtyp
i_msgv2 = l_valore
i_msgv3 = text-m05
"exitstiert nicht
i_fieldname = ps_good_prozs-fieldname
i_row_id = ps_good_prozs-row_id.
error_in_data = 'X'.
exit.
endif.
if not l_prozs is initial and
not l_menge is initial.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '027' i_msgty = 'E'
i_msgv1 = text-m03
"Flugzeugtyp
i_msgv2 = l_valore
i_msgv3 = text-m05
"exitstiert nicht
i_fieldname = ps_good_prozs-fieldname
i_row_id = ps_good_prozs-row_id.
error_in_data = 'X'.
exit.
endif.
if not l_valore is initial and
not l_menge is initial.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '027' i_msgty = 'E'
i_msgv1 = text-m03
"Flugzeugtyp
i_msgv2 = l_valore
i_msgv3 = text-m05
"exitstiert nicht
i_fieldname = ps_good_prozs-fieldname
i_row_id = ps_good_prozs-row_id.
error_in_data = 'X'.
exit.
endif.
if l_prozs is initial and
l_valore is initial and
l_menge is initial.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '028' i_msgty = 'E'
i_msgv1 = text-m03
"Flugzeugtyp
i_msgv2 = l_valore

i_msgv3 = text-m05
"exitstiert nicht
i_fieldname = ps_good_prozs-fieldname
i_row_id = ps_good_prozs-row_id.
error_in_data = 'X'.
exit.
exit.
endif.
if l_prozs > 100.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '056' i_msgty = 'E'
i_msgv1 = text-m03
"Flugzeugtyp
i_msgv2 = l_prozs
i_msgv3 = text-m05
"exitstiert nicht
i_fieldname = ps_good_prozs-fieldname
i_row_id = ps_good_prozs-row_id.
error_in_data = 'X'.
exit.
endif.
call method grid->refresh_table_display.
endmethod.
" prozs
method check_menge.
data: l_valore type btrab,
l_prozs type prozs,
l_menge type menge_d,
l_buzei type buzei,
ls_good_menge type lvc_s_modi.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_menge-row_id
i_fieldname = ps_good_menge-fieldname
importing e_value
= l_menge.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_menge-row_id
i_fieldname = 'VALORE'
importing e_value
= l_valore.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_menge-row_id
i_fieldname = 'PROZS'
importing e_value
= l_prozs.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_menge-row_id
i_fieldname = 'BUZEI'
importing e_value
= l_buzei.
if not l_menge is initial.
clear va_pos.
read table tb_pos into va_pos with key buzei = l_buzei.
clear: wa_pos-valore, valore_medio.
call function 'ZUAA_FIE113_01'
exporting

bukrs
= tb_testata-bukrs
gjahr
= va_gjahr
ord41
= va_pos-ord41
ord42
= va_pos-ord42
ord43
= va_pos-ord43
ord44
= va_pos-ord44
gdlgrp
= va_pos-gdlgrp
meins
= va_pos-meins
importing
valore_medio = valore_medio
exceptions
ecc_quant
= 1
ecc_val_med = 2
others
= 3.
if sy-subrc <> 0.
case sy-subrc.
when 1.
message e034(zcaa_wf) with wa_pos-meins.
when 2.
message e033(zcaa_wf).
endcase.
endif.
va_pos-valore = l_menge * valore_medio.
modify tb_pos from va_pos index ps_good_menge-row_id.
call method grid->refresh_table_display.
endif.

if not l_prozs is initial and


not l_menge is initial.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '027' i_msgty = 'E'
i_msgv1 = text-m03
"Flugzeugtyp
i_msgv2 = l_valore
i_msgv3 = text-m05
"exitstiert nicht
i_fieldname = ps_good_menge-fieldname
i_row_id = ps_good_menge-row_id.
error_in_data = 'X'.
exit.
endif.
if l_prozs is initial and
l_valore is initial and
l_menge is initial.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '028' i_msgty = 'E'
i_msgv1 = text-m03
"Flugzeugtyp
i_msgv2 = l_valore
i_msgv3 = text-m05
"exitstiert nicht
i_fieldname = ps_good_menge-fieldname
i_row_id = ps_good_menge-row_id.
exit.
endif.

endmethod.

" menge

method check_zujhr.
data: l_zujhr type zujhr,
l_zujhr_a type zujhr,
ls_good_valore type lvc_s_modi,
l_ord41 type ord41,
l_ord42 type ord42,
l_ord43 type ord43,
l_ord44 type ord44,
l_gdlgrp type gdlgrp,
l_buzei type buzei.
.

call method pr_data_changed->get_cell_value


exporting i_row_id =
ps_good_zujhr-row_id
i_fieldname = ps_good_zujhr-fieldname
importing e_value
= l_zujhr.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr-row_id
i_fieldname = 'ZUJHR_A'
importing e_value
= l_zujhr_a.
*** Controlli coerenza Esercizio Capitalizzazione
if not l_zujhr_a is initial.
if l_zujhr is initial.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '052' i_msgty = 'E'
i_fieldname = ps_good_zujhr-fieldname
i_row_id = ps_good_zujhr-row_id.
error_in_data = 'X'.
exit.
endif.
endif.
if not l_zujhr is initial.
if not l_zujhr_a is initial.
if l_zujhr_a < l_zujhr.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '051' i_msgty = 'E'
i_msgv1 = l_zujhr
i_msgv2 = l_zujhr_a
*
i_msgv3 = text-m05
"exitstiert nicht
i_fieldname = ps_good_zujhr-fieldname
i_row_id = ps_good_zujhr-row_id.
error_in_data = 'X'.
exit.
endif.
endif.
endif.
**************** Controllo esistenza posizione
call method pr_data_changed->get_cell_value

exporting i_row_id =
ps_good_zujhr-row_id
i_fieldname = 'BUZEI'
importing e_value
= l_buzei.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr-row_id
i_fieldname = 'ORD41'
importing e_value
= l_ord41.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr-row_id
i_fieldname = 'ORD42'
importing e_value
= l_ord42.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr-row_id
i_fieldname = 'ORD43'
importing e_value
= l_ord43.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr-row_id
i_fieldname = 'ORD44'
importing e_value
= l_ord44.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr-row_id
i_fieldname = 'GDLGRP'
importing e_value
= l_gdlgrp.
refresh r_zujhr_pos.
clear r_zujhr_pos.
if not l_zujhr is initial.
if l_zujhr_a is initial.
clear va_zujhr.
va_zujhr-sign = 'I'.
va_zujhr-option = 'EQ'.
va_zujhr-low = l_zujhr.
append va_zujhr to r_zujhr_pos.
else.
clear va_zujhr.
va_zujhr-sign = 'I'.
va_zujhr-option = 'BT'.
va_zujhr-low = l_zujhr.
va_zujhr-high = l_zujhr_a.
append va_zujhr to r_zujhr_pos.
endif.
endif.

loop at tb_pos into appo_pos where bukrs = tb_testata-bukrs


and buzei ne l_buzei
and ord41 = l_ord41
and ord42 = l_ord42
and ord43 = l_ord43
and ord44 = l_ord44
and gdlgrp = l_gdlgrp
and zujhr in r_zujhr_pos.
endloop.
if sy-subrc = 0.
call method pr_data_changed->add_protocol_entry

exporting
i_msgid = 'ZCAA_WF' i_msgno = '019' i_msgty = 'E'
i_msgv1 = l_zujhr
i_msgv2 = l_zujhr_a
i_fieldname = ps_good_zujhr-fieldname
i_row_id = ps_good_zujhr-row_id.
error_in_data = 'X'.
exit.
endif.
if not l_zujhr is initial.
loop at tb_pos into appo_pos where bukrs = tb_testata-bukrs
and buzei ne l_buzei
and ord41 = l_ord41
and ord42 = l_ord42
and ord43 = l_ord43
and ord44 = l_ord44
and gdlgrp = l_gdlgrp
and zujhr <= l_zujhr
and zujhr_a >= l_zujhr.
endloop.
if sy-subrc = 0.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '019' i_msgty = 'E'
i_msgv1 = l_zujhr
i_msgv2 = l_zujhr_a
i_fieldname = ps_good_zujhr-fieldname
i_row_id = ps_good_zujhr-row_id.
error_in_data = 'X'.
exit.
endif.
endif.
*
*
*
*
*
*
*
*
*
*
**
*
*
*
*
*
*
*
*
*
*
*
*
*

if not l_zujhr_a is initial.


loop at tb_pos into appo_pos where bukrs = tb_testata-bukrs
and buzei ne l_buzei
and ord41 = l_ord41
and ord42 = l_ord42
and ord43 = l_ord43
and ord44 = l_ord44
and gdlgrp = l_gdlgrp
and zujhr >= l_zujhr_a
and zujhr_a <= l_zujhr_a.
.
endloop.
if sy-subrc = 0.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '019' i_msgty = 'E'
i_msgv1 = l_zujhr
i_msgv2 = l_zujhr_a
i_fieldname = ps_good_zujhr-fieldname
i_row_id = ps_good_zujhr-row_id.
error_in_data = 'X'.
exit.
endif.
endif.

call method grid->refresh_table_display.


endmethod.
method check_zujhr_a.
data: l_zujhr type zujhr,
l_zujhr_a type zujhr,
l_ord41 type ord41,
l_ord42 type ord42,
l_ord43 type ord43,
l_ord44 type ord44,
l_gdlgrp type gdlgrp,
l_buzei type buzei,
ls_good_valore type lvc_s_modi.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr_a-row_id
i_fieldname = ps_good_zujhr_a-fieldname
importing e_value
= l_zujhr_a.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr_a-row_id
i_fieldname = 'ZUJHR'
importing e_value
= l_zujhr.
*** Controlli coerenza Esercizio Capitalizzazione
if not l_zujhr_a is initial.
if l_zujhr is initial.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '052' i_msgty = 'E'
i_fieldname = ps_good_zujhr_a-fieldname
i_row_id = ps_good_zujhr_a-row_id.
error_in_data = 'X'.
exit.
endif.
endif.
if not l_zujhr is initial.
if not l_zujhr_a is initial.
if l_zujhr_a < l_zujhr.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '051' i_msgty = 'E'
i_msgv1 = l_zujhr
i_msgv2 = l_zujhr_a
*
i_msgv3 = text-m05
"exitstiert nicht
i_fieldname = ps_good_zujhr_a-fieldname
i_row_id = ps_good_zujhr_a-row_id.
error_in_data = 'X'.
exit.
endif.
endif.
endif.
**************** Controllo esistenza posizione
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr_a-row_id

i_fieldname = 'BUZEI'
importing e_value
= l_buzei.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr_a-row_id
i_fieldname = 'ORD41'
importing e_value
= l_ord41.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr_a-row_id
i_fieldname = 'ORD42'
importing e_value
= l_ord42.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr_a-row_id
i_fieldname = 'ORD43'
importing e_value
= l_ord43.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr_a-row_id
i_fieldname = 'ORD44'
importing e_value
= l_ord44.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zujhr_a-row_id
i_fieldname = 'GDLGRP'
importing e_value
= l_gdlgrp.
refresh r_zujhr_pos.
clear r_zujhr_pos.
if not l_zujhr is initial.
if l_zujhr_a is initial.
clear va_zujhr.
va_zujhr-sign = 'I'.
va_zujhr-option = 'EQ'.
va_zujhr-low = l_zujhr.
append va_zujhr to r_zujhr_pos.
else.
clear va_zujhr.
va_zujhr-sign = 'I'.
va_zujhr-option = 'BT'.
va_zujhr-low = l_zujhr.
va_zujhr-high = l_zujhr_a.
append va_zujhr to r_zujhr_pos.
endif.
endif.

loop at tb_pos into appo_pos where bukrs = tb_testata-bukrs


and buzei ne l_buzei
and ord41 = l_ord41
and ord42 = l_ord42
and ord43 = l_ord43
and ord44 = l_ord44
and gdlgrp = l_gdlgrp
and zujhr in r_zujhr_pos.
endloop.
if sy-subrc = 0.
call method pr_data_changed->add_protocol_entry
exporting

i_msgid = 'ZCAA_WF' i_msgno = '019' i_msgty = 'E'


i_msgv1 = l_zujhr
i_msgv2 = l_zujhr_a
i_fieldname = ps_good_zujhr_a-fieldname
i_row_id = ps_good_zujhr_a-row_id.
error_in_data = 'X'.
exit.
endif.
if not l_zujhr is initial.
loop at tb_pos into appo_pos where bukrs = tb_testata-bukrs
and buzei ne l_buzei
and ord41 = l_ord41
and ord42 = l_ord42
and ord43 = l_ord43
and ord44 = l_ord44
and gdlgrp = l_gdlgrp
and zujhr <= l_zujhr
and zujhr_a >= l_zujhr.
endloop.
if sy-subrc = 0.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '019' i_msgty = 'E'
i_msgv1 = l_zujhr
i_msgv2 = l_zujhr_a
i_fieldname = ps_good_zujhr_a-fieldname
i_row_id = ps_good_zujhr_a-row_id.
error_in_data = 'X'.
exit.
endif.
endif.
*
*
*
*
*
*
*
*
*
**
*
*
*
*
*
*
*
*
*
*
*
*
*

if not l_zujhr_a is initial.


loop at tb_pos into appo_pos where bukrs = tb_testata-bukrs
and buzei ne l_buzei
and ord41 = l_ord41
and ord42 = l_ord42
and ord43 = l_ord43
and ord44 = l_ord44
and gdlgrp = l_gdlgrp
and zujhr >= l_zujhr_a.
and zujhr_a <= l_zujhr_a.
endloop.
if sy-subrc = 0.
call method pr_data_changed->add_protocol_entry
exporting
i_msgid = 'ZCAA_WF' i_msgno = '019' i_msgty = 'E'
i_msgv1 = l_zujhr
i_msgv2 = l_zujhr_a
i_fieldname = ps_good_zujhr_a-fieldname
i_row_id = ps_good_zujhr_a-row_id.
error_in_data = 'X'.
exit.
endif.
endif.
call method grid->refresh_table_display.
endmethod.

method check_zflag_ci.
data: va_ci,
ls_good_valore type lvc_s_modi.
call method pr_data_changed->get_cell_value
exporting i_row_id =
ps_good_zflag_ci-row_id
i_fieldname = ps_good_zflag_ci-fieldname
importing e_value
= va_ci.
if not va_ci is initial and va_flag_ci is initial.
va_flag_ci = 'X'.
call function 'POPUP_TO_DISPLAY_TEXT'
exporting
titel
= 'Includere "CI" Costi incrementativi'
textline1
= 'ATTENZIONE hai selezionato il FLAG "CI"'
textline2
= 'Saranno inclusi i costi incrementativi'
start_column = 25
start_row
= 6.
endif.
call method grid->refresh_table_display.
endmethod.
endclass.

data

"lcl_event_handler IMPLEMENTATION

gr_event_handler type ref to lcl_event_handler.

****Classe per la gestione del drag&drop


* FUNCTION CODES FOR TABSTRIP 'TRASFERIMENTI'
constants: begin of c_trasferimenti,
tab1 like sy-ucomm value 'TRASFERIMENTI_FC1',
tab2 like sy-ucomm value 'TRASFERIMENTI_FC2',
tab3 like sy-ucomm value 'TRASFERIMENTI_FC3',
end of c_trasferimenti.
* DATA FOR TABSTRIP 'TRASFERIMENTI'
controls: trasferimenti type tabstrip.
data:
begin of g_trasferimenti,
subscreen
like sy-dynnr,
prog
like sy-repid value 'Z1AA_FIE113_01',
pressed_tab like sy-ucomm value c_trasferimenti-tab1,
end of g_trasferimenti.

Z1AA_FIE113_01_FOR

*----------------------------------------------------------------------*
*
INCLUDE Z1AA_FIE113_01_FOR
*
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*

*&
Form controlli
*&---------------------------------------------------------------------*
form controlli_invio.
* refresh tb_pos_check.
* tb_pos_check[] = tb_pos[].
****** Controllo 61
if wa_pos-ord41 = '61' and va_flag_61 is initial.
clear ztaa_fie113_wf_v.
select single * from ztaa_fie113_wf_v where bukrs = tb_testata-bukrs
and gjahr = va_gjahr
and ord41 = wa_pos-ord41
and ord42 = wa_pos-ord42
and ord43 = wa_pos-ord43
and ord44 = wa_pos-ord44.
if ztaa_fie113_wf_v-meins = 'VAL'.
va_flag_61 = 'X'.
call function 'POPUP_TO_DISPLAY_TEXT'
exporting
titel
= 'Controllo per tipologia 61'
textline1
= 'ATTENZIONE Per Tipologia 61, accettarsi'
textline2 = 'di avere inserito il valore nel campo Quantita'''
start_column = 25
start_row
= 6.
endif.
endif.
*** popup CI
if not wa_pos-zflag_ci is initial and va_flag_ci is initial.
va_flag_ci = 'X'.
call function 'POPUP_TO_DISPLAY_TEXT'
exporting
titel
= 'Includere "CI" Costi incrementativi'
textline1
= 'ATTENZIONE hai selezionato il FLAG "CI"'
textline2
= 'Saranno inclusi i costi incrementativi'
start_column = 25
start_row
= 6.
endif.
* Controllo area territoriale / Unit Richeidente.
if not wa_pos-ord44 is initial.
if wa_pos-ord41 = '44'.
if tb_testata-zzrespbudg+2(2) = 'SR' or
tb_testata-zzrespbudg+2(2) = 'ER'.
if wa_pos-ord44+2(1) ne tb_testata-zzrespbudg+1(1).
message w080(zcaa_wf).
exit.
endif.
if wa_pos-ord44(2) ne '44'.
message w080(zcaa_wf).
exit.
endif.
endif.
endif.
endif.
* Controllo area territoriale / Unit Richeidente Campo destinatario
if not wa_pos-ord44_a is initial.
if wa_pos-ord41_a = '44'.
if wa_pos-ord44_a(2) ne '44'.
message w080(zcaa_wf).

exit.
endif.
endif.
endif.
if tb_testata-ztipo = 'DI'.
clear: tip, area, flag-imp, flag-ar_terr .
*controllo di esistenza su tabella custom
select single * from ztbcusto into ztbcusto
where societa = tb_testata-bukrs
and tipologia = wa_pos-ord41
and parte = wa_pos-ord42
and sezione = wa_pos-ord43.
if sy-subrc = 0.
*controllo sul campo IMPIANTO
if wa_pos-gdlgrp <> space.
move wa_pos-gdlgrp to tip.
*controllo ugualianza tra TIPOLOGIA ed IMPIANTO
if not tip = ztbcusto-tipologia.
flag-imp = 'X'.
endif.
endif.
*controllo sul campo AREA TERRITORIALE
if wa_pos-ord44 <> space.
move wa_pos-ord44 to area.
*controllo ugualianza tra TIPOLOGIA ed AREA TERRITORIALE
if not area = ztbcusto-tipologia.
flag-ar_terr = 'X'.
endif.
endif.
*impostazioni per messaggio d'errore
if flag-imp eq space
and
flag-ar_terr eq space .
else.
message w011(zcaa_wf).
exit.
endif.
else.
message w011(zcaa_wf).
exit.
endif.
* controllo IMPIANTO
if wa_pos-gdlgrp is initial.
message w020(zcaa_wf).
else.
clear va_gdlgrp.
concatenate wa_pos-ord41 tb_testata-zzrespbudg+1(3)
into va_gdlgrp.
if wa_pos-gdlgrp(5) ne va_gdlgrp(5).
message w042(zcaa_wf) with wa_pos-gdlgrp.
endif.
endif.
** controllo Esercizio di prima capitalizzazione
*
if wa_pos-zujhr is initial.
*
message w018(zcaa_wf).
*
exit.
*
endif.

**** Controllo Natura provvisorio


***
if wa_pos-eigkz is initial.
***
message w017(zcaa_wf).
***
exit.
***
elseif wa_pos-eigkz = 'T'.
**** contollo N. collettivo cesp.
***
if wa_pos-anlue is initial.
***
message w016(zcaa_wf).
***
exit.
***
endif.
***
endif.
if wa_pos-prozs is initial and
wa_pos-valore is initial and
wa_pos-menge is initial.
message w012(zcaa_wf).
exit.
endif.
if not wa_pos-prozs is initial and
not wa_pos-valore is initial.
message w013(zcaa_wf).
exit.
endif.
if not wa_pos-prozs is initial and
not wa_pos-menge is initial.
message w013(zcaa_wf).
exit.
endif.
*
*
*
*
*

if not wa_pos-valore is initial and


not wa_pos-menge is initial.
message w013(zcaa_wf).
exit.
endif.
if not wa_pos-menge is initial and
wa_pos-meins is initial.
message w014(zcaa_wf).
exit.
endif.

*********************** TRASFERIMENTI
elseif tb_testata-ztipo = 'TR'.
clear: tip, area, flag-imp, flag-ar_terr .
*controllo di esistenza su tabella custom
select single * from ztbcusto into ztbcusto
where societa = tb_testata-bukrs
and tipologia = wa_pos-ord41
and parte = wa_pos-ord42
and sezione = wa_pos-ord43.
if sy-subrc = 0.
*controllo sul campo IMPIANTO
if wa_pos-gdlgrp <> space.
move wa_pos-gdlgrp to tip.
*controllo ugualianza tra TIPOLOGIA ed IMPIANTO

if not tip = ztbcusto-tipologia.


flag-imp = 'X'.
endif.
endif.
*controllo sul campo AREA TERRITORIALE
if wa_pos-ord44 <> space.
move wa_pos-ord44 to area.
*controllo ugualianza tra TIPOLOGIA ed AREA TERRITORIALE
if not area = ztbcusto-tipologia.
flag-ar_terr = 'X'.
endif.
endif.
*impostazioni per messaggio d'errore
if flag-imp eq space
and
flag-ar_terr eq space .
else.
message w029(zcaa_wf).
exit.
endif.
else.
message w029(zcaa_wf).
exit.
endif.
* controllo IMPIANTO
if wa_pos-gdlgrp is initial.
message w020(zcaa_wf).
exit.
else.
clear va_gdlgrp.
concatenate wa_pos-ord41 tb_testata-zzrespbudg+1(3)
into va_gdlgrp.
if wa_pos-gdlgrp(5) ne va_gdlgrp(5).
message w042(zcaa_wf) with wa_pos-gdlgrp.
exit.
endif.
endif.
** controllo Esercizio di prima capitalizzazione
*
if wa_pos-zujhr is initial.
*
message w018(zcaa_wf).
*
exit.
*
endif.
*
*
*
*

if wa_pos-kostl is initial.
message w032(zcaa_wf).
exit.
endif.

********** cotrollo campi trasferiti


clear: tip, area, flag-imp, flag-ar_terr .
*controllo di esistenza su tabella custom
select single * from ztbcusto into ztbcusto
where societa = tb_testata-bukrs
and tipologia = wa_pos-ord41_a
and parte = wa_pos-ord42_a

and sezione = wa_pos-ord43_a.


if sy-subrc = 0.
*controllo sul campo IMPIANTO
if wa_pos-gdlgrp_a <> space.
move wa_pos-gdlgrp_a to tip.
*controllo ugualianza tra TIPOLOGIA ed IMPIANTO
if not tip = ztbcusto-tipologia.
flag-imp = 'X'.
endif.
endif.
*controllo sul campo AREA TERRITORIALE
if wa_pos-ord44_a <> space.
move wa_pos-ord44_a to area.
*controllo ugualianza tra TIPOLOGIA ed AREA TERRITORIALE
if not area = ztbcusto-tipologia.
flag-ar_terr = 'X'.
endif.
endif.
*impostazioni per messaggio d'errore
if flag-imp eq space
and
flag-ar_terr eq space .
else.
message w029(zcaa_wf).
exit.
endif.
else.
message w029(zcaa_wf).
exit.
endif.
* controllo IMPIANTO
if wa_pos-gdlgrp_a is initial.
message w020(zcaa_wf).
exit.
else.
*
clear va_gdlgrp.
*
concatenate wa_pos-ord41_a tb_testata-zzrespbudg+1(3)
*
into va_gdlgrp.
if wa_pos-gdlgrp_a(3) ne wa_pos-ord44_a(3).
message w042(zcaa_wf) with wa_pos-gdlgrp_a.
exit.
endif.
endif.
* controllo Area Territoriale
if wa_pos-ord44_a is initial.
message w041(zcaa_wf).
exit.
endif.
*** Controllo area territoriale.
**
if not wa_pos-ord44_a is initial.
**
if tb_testata-zzrespbudg+2(2) = 'SR'.
**
if wa_pos-ord44+3(1) ne tb_testata-zzrespbudg+2(1).
**
message w080(zcaa_wf).
**
exit.
**
endif.
**
endif.
**
endif.

if wa_pos-kostl_a is initial.
message w032(zcaa_wf).
exit.
endif.
** Controllo Natura
*
IF wa_pos-eigkz_a IS INITIAL.
*
MESSAGE w017(zcaa_wf).
*
EXIT.
*
ELSEIF wa_pos-eigkz_a = 'T'.
** contollo N. collettivo cesp.
*
IF wa_pos-anlue_a IS INITIAL.
*
MESSAGE w016(zcaa_wf).
*
EXIT.
*
ENDIF.
*
ENDIF.
if wa_pos-prozs is initial and
wa_pos-valore is initial and
wa_pos-menge is initial.
message w030(zcaa_wf).
exit.
endif.
if not wa_pos-prozs is initial and
not wa_pos-valore is initial.
message w031(zcaa_wf).
exit.
endif.
if not wa_pos-prozs is initial and
not wa_pos-menge is initial.
message w031(zcaa_wf).
exit.
endif.
*
*
*
*
*

if not wa_pos-valore is initial and


not wa_pos-menge is initial.
message w031(zcaa_wf).
exit.
endif.
if not wa_pos-menge is initial and
wa_pos-meins is initial.
message w031(zcaa_wf).
exit.
endif.
endif.
if not wa_pos-menge is initial.
clear: wa_pos-valore, valore_medio.
call function 'ZUAA_FIE113_01'
exporting
bukrs
= tb_testata-bukrs
gjahr
= va_gjahr
ord41
= wa_pos-ord41
ord42
= wa_pos-ord42
ord43
= wa_pos-ord43
ord44
= wa_pos-ord44

gdlgrp
= wa_pos-gdlgrp
meins
= wa_pos-meins
importing
valore_medio = valore_medio
exceptions
ecc_quant
= 1
ecc_val_med = 2
others
= 3.
if sy-subrc <> 0.
case sy-subrc.
when 1.
message e034(zcaa_wf) with wa_pos-meins.
when 2.
message e033(zcaa_wf).
endcase.
endif.
wa_pos-valore = wa_pos-menge * valore_medio.
wa_pos-zflag_t4x = 'X'.
* Controllo esistenza ZAPS
read table tb_pos with key zflag_t4x = space.
if sy-subrc = 0.
message w043(zcaa_wf).
endif.
else.
if wa_pos-zflag_t4x is initial.
read table tb_pos with key zflag_t4x = 'X'.
if sy-subrc = 0.
message w045(zcaa_wf).
endif.
endif.
endif.
**** Controllo 48.
clear ztaa_fie113_wf_u.
select single * from ztaa_fie113_wf_u where bukrs = tb_testata-bukrs
and gjahr = va_gjahr
and monat = tb_testata-bldat+4(2)
and ord41 = wa_pos-ord41
and ord42 = wa_pos-ord42
and ord43 = wa_pos-ord43
and ord44 = wa_pos-ord44
and gdlgrp = wa_pos-gdlgrp.
if sy-subrc = 0.
wa_pos-zflag_48 = 'X'.
read table tb_pos with key zflag_48 = space.
if sy-subrc = 0.
message w044(zcaa_wf).
endif.
if tb_testata-ztipo = 'DI'.
if tb_testata-zmotivo ne '1'.
message w048(zcaa_wf).
endif.
endif.
else.
read table tb_pos with key zflag_48 = 'X'.
if sy-subrc = 0.
message w046(zcaa_wf).

endif.
endif.
*** Controlli coerenza Esercizio Capitalizzazione
if not wa_pos-zujhr_a is initial.
if wa_pos-zujhr is initial.
message w052(zcaa_wf).
endif.
endif.
if not wa_pos-zujhr is initial.
if not wa_pos-zujhr_a is initial.
if wa_pos-zujhr_a < wa_pos-zujhr.
message w051(zcaa_wf) with wa_pos-zujhr_a wa_pos-zujhr.
endif.
endif.
endif.
*** Controllo campo PROZS %
if wa_pos-prozs > 100.
message w056(zcaa_wf).
endif.
endform.
" controlli
*----------------------------------------------------------------------*
*
INCLUDE TABLECONTROL_FORMS
*
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&
Form USER_OK_TC
*
*&---------------------------------------------------------------------*
form user_ok_tc using
p_tc_name type dynfnam
p_table_name
p_mark_name
changing p_ok
like sy-ucomm.
*-BEGIN OF LOCAL DATA--------------------------------------------------*
data: l_ok
type sy-ucomm,
l_offset
type i.
*-END OF LOCAL DATA----------------------------------------------------*
* Table control specific operations
*
evaluate TC name and operations
search p_ok for p_tc_name.
if sy-subrc <> 0.
exit.
endif.
l_offset = strlen( p_tc_name ) + 1.
l_ok = p_ok+l_offset.
* execute general and TC specific operations
case l_ok.
when 'INSR'.
"insert row
perform fcode_insert_row using
p_tc_name
p_table_name.
clear p_ok.
when 'DELE'.
perform fcode_delete_row using

"delete row
p_tc_name
p_table_name
p_mark_name.

*
*

clear p_ok.
when 'P--' or
'P-' or
'P+' or
'P++'.
perform compute_scrolling_in_tc
*
*
*
*
*
*
*
*
*
*
*
*

"top of list
"previous page
"next page
"bottom of list
using p_tc_name
l_ok.

clear p_ok.
WHEN 'L--'.
"total left
PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
WHEN 'L-'.
"column left
PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
WHEN 'R+'.
"column right
PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
WHEN 'R++'.
"total right
PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
when 'MARK'.
"mark all filled lines
perform fcode_tc_mark_lines using p_tc_name
p_table_name
p_mark_name
.
clear p_ok.
when 'DMRK'.
"demark all filled lines
perform fcode_tc_demark_lines using p_tc_name
p_table_name
p_mark_name .
clear p_ok.

*
*
*
*

WHEN 'SASCEND'
OR
'SDESCEND'.
"sort column
PERFORM FCODE_SORT_TC USING P_TC_NAME
l_ok.
endcase.

endform.

" USER_OK_TC

*&---------------------------------------------------------------------*
*&
Form FCODE_INSERT_ROW
*
*&---------------------------------------------------------------------*
form fcode_insert_row
using
p_tc_name
type dynfnam
p_table_name
.
*-BEGIN OF LOCAL DATA--------------------------------------------------*
data l_lines_name
like feld-name.
data l_selline
like sy-stepl.
data l_lastline
type i.
data l_line
type i.
data l_table_name
like feld-name.
field-symbols <tc>
type cxtab_control.
field-symbols <table>
type standard table.
field-symbols <lines>
type i.
*-END OF LOCAL DATA----------------------------------------------------*
assign (p_tc_name) to <tc>.

* get the table, which belongs to the tc


concatenate p_table_name '[]' into l_table_name. "table body
assign (l_table_name) to <table>.
"not headerline

* get looplines of TableControl


concatenate 'G_' p_tc_name '_LINES' into l_lines_name.
assign (l_lines_name) to <lines>.
* get current line
get cursor line l_selline.
if sy-subrc <> 0.
" append line to table
l_selline = <tc>-lines + 1.
*&SPWIZARD: set top line and new cursor line
if l_selline > <lines>.
<tc>-top_line = l_selline - <lines> + 1 .
else.
<tc>-top_line = 1.
endif.
else.
" insert line into table
l_selline = <tc>-top_line + l_selline - 1.
l_lastline = <tc>-top_line + <lines> - 1.
endif.
*&SPWIZARD: set new cursor line
l_line = l_selline - <tc>-top_line + 1.
* insert initial line
insert initial line into <table> index l_selline.
<tc>-lines = <tc>-lines + 1.
* set cursor
set cursor line l_line.
endform.

" FCODE_INSERT_ROW

*&---------------------------------------------------------------------*
*&
Form FCODE_DELETE_ROW
*
*&---------------------------------------------------------------------*
form fcode_delete_row
using
p_tc_name
type dynfnam
p_table_name
p_mark_name
.
*-BEGIN OF LOCAL DATA--------------------------------------------------*
data l_table_name
like feld-name.
field-symbols <tc>
type cxtab_control.
field-symbols <table>
type standard table.
field-symbols <wa>.
field-symbols <mark_field>.
*-END OF LOCAL DATA----------------------------------------------------*
assign (p_tc_name) to <tc>.
* get the table, which belongs to the tc
concatenate p_table_name '[]' into l_table_name. "table body
assign (l_table_name) to <table>.
"not headerline

* delete marked lines


describe table <table> lines <tc>-lines.

loop at <table> assigning <wa>.

access to the component 'FLAG' of the table header


assign component p_mark_name of structure <wa> to <mark_field>.

if <mark_field> = 'X'.
delete <table> index syst-tabix.
if sy-subrc = 0.
<tc>-lines = <tc>-lines - 1.
endif.
endif.
endloop.
endform.

" FCODE_DELETE_ROW

*&---------------------------------------------------------------------*
*&
Form COMPUTE_SCROLLING_IN_TC
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
-->P_TC_NAME name of tablecontrol
*
-->P_OK
ok code
*----------------------------------------------------------------------*
form compute_scrolling_in_tc using
p_tc_name
p_ok.
*-BEGIN OF LOCAL DATA--------------------------------------------------*
data l_tc_new_top_line
type i.
data l_tc_name
like feld-name.
data l_tc_lines_name
like feld-name.
data l_tc_field_name
like feld-name.
field-symbols <tc>
type cxtab_control.
field-symbols <lines>
type i.
*-END OF LOCAL DATA----------------------------------------------------*
assign (p_tc_name) to <tc>.
* get looplines of TableControl
concatenate 'G_' p_tc_name '_LINES' into l_tc_lines_name.
assign (l_tc_lines_name) to <lines>.
* is no line filled?
if <tc>-lines = 0.
*
yes, ...
l_tc_new_top_line = 1.
else.
*
no, ...
call function 'SCROLLING_IN_TABLE'
exporting
entry_act
= <tc>-top_line
entry_from
= 1
entry_to
= <tc>-lines
last_page_full
= 'X'
loops
= <lines>
ok_code
= p_ok
overlapping
= 'X'
importing
entry_new
= l_tc_new_top_line
exceptions
*
NO_ENTRY_OR_PAGE_ACT = 01
*
NO_ENTRY_TO
= 02
*
NO_OK_CODE_OR_PAGE_GO = 03
others
= 0.

*
*
*

endif.
* get actual tc and column
get cursor field l_tc_field_name
area l_tc_name.

if syst-subrc = 0.
if l_tc_name = p_tc_name.
*
set actual column
set cursor field l_tc_field_name line 1.
endif.
endif.

* set the new top line


<tc>-top_line = l_tc_new_top_line.
endform.

" COMPUTE_SCROLLING_IN_TC

*&---------------------------------------------------------------------*
*&
Form FCODE_TC_MARK_LINES
*&---------------------------------------------------------------------*
*
marks all TableControl lines
*----------------------------------------------------------------------*
*
-->P_TC_NAME name of tablecontrol
*----------------------------------------------------------------------*
form fcode_tc_mark_lines using p_tc_name
p_table_name
p_mark_name.
*-BEGIN OF LOCAL DATA--------------------------------------------------*
data l_table_name
like feld-name.
field-symbols <tc>
type cxtab_control.
field-symbols <table>
type standard table.
field-symbols <wa>.
field-symbols <mark_field>.
*-END OF LOCAL DATA----------------------------------------------------*
assign (p_tc_name) to <tc>.
* get the table, which belongs to the tc
concatenate p_table_name '[]' into l_table_name. "table body
assign (l_table_name) to <table>.
"not headerline

* mark all filled lines


loop at <table> assigning <wa>.

access to the component 'FLAG' of the table header


assign component p_mark_name of structure <wa> to <mark_field>.

<mark_field> = 'X'.
endloop.
endform.

"fcode_tc_mark_lines

*&---------------------------------------------------------------------*
*&
Form FCODE_TC_DEMARK_LINES
*&---------------------------------------------------------------------*
*
demarks all TableControl lines
*----------------------------------------------------------------------*
*
-->P_TC_NAME name of tablecontrol
*----------------------------------------------------------------------*

form fcode_tc_demark_lines using p_tc_name


p_table_name
p_mark_name .
*-BEGIN OF LOCAL DATA--------------------------------------------------*
data l_table_name
like feld-name.
field-symbols <tc>
type cxtab_control.
field-symbols <table>
type standard table.
field-symbols <wa>.
field-symbols <mark_field>.
*-END OF LOCAL DATA----------------------------------------------------*
assign (p_tc_name) to <tc>.
* get the table, which belongs to the tc
concatenate p_table_name '[]' into l_table_name. "table body
assign (l_table_name) to <table>.
"not headerline

* demark all filled lines


loop at <table> assigning <wa>.

access to the component 'FLAG' of the table header


assign component p_mark_name of structure <wa> to <mark_field>.

<mark_field> = space.
endloop.
endform.

"fcode_tc_mark_lines

*&---------------------------------------------------------------------*
*&
Form fieldacat
*&---------------------------------------------------------------------*
form fieldacat.
refresh gt_fieldcat_lvc.
* merge the fieldcatalog
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'ZTAA_FIE113_WF_P'
changing
ct_fieldcat
= gt_fieldcat_lvc[].
clear gt_fieldcat_lvc.
gt_fieldcat_lvc-fieldname = 'ICON'.
gt_fieldcat_lvc-tabname = 'TB_POS'.
gt_fieldcat_lvc-icon = 'X'.
gt_fieldcat_lvc-scrtext_s = 'Check'.
append gt_fieldcat_lvc.
* blind out the column 'XSTRING'
loop at gt_fieldcat_lvc .
if tb_testata-ztipo = 'DI'.
case gt_fieldcat_lvc-fieldname.
when 'PROZS'.
gt_fieldcat_lvc-edit = '1'.
modify gt_fieldcat_lvc.
when 'VALORE'.
gt_fieldcat_lvc-edit = '1'.
modify gt_fieldcat_lvc.
when 'MENGE'.
gt_fieldcat_lvc-edit = '1'.
modify gt_fieldcat_lvc.

when 'ZUJHR'.
gt_fieldcat_lvc-edit = '1'.
modify gt_fieldcat_lvc.
when 'ZUJHR_A'.
gt_fieldcat_lvc-edit = '1'.
modify gt_fieldcat_lvc.
*

when 'ZRICAVO'.
gt_fieldcat_lvc-edit = '1'.
modify gt_fieldcat_lvc.
when 'ZFLAG_IMPORTO'.
gt_fieldcat_lvc-edit = '1'.
gt_fieldcat_lvc-checkbox = 'X'.
modify gt_fieldcat_lvc.
when 'ZFLAG_CAPIENZA'.
gt_fieldcat_lvc-edit = '1'.
gt_fieldcat_lvc-checkbox = 'X'.
modify gt_fieldcat_lvc.
when 'ZFLAG_CAP_ANNO'.
gt_fieldcat_lvc-edit = '1'.
gt_fieldcat_lvc-checkbox = 'X'.
modify gt_fieldcat_lvc.
when 'ZFLAG_CI'.
gt_fieldcat_lvc-edit = '1'.
gt_fieldcat_lvc-checkbox = 'X'.
modify gt_fieldcat_lvc.
when 'BUKRS'.
gt_fieldcat_lvc-no_out = 'X'.
modify gt_fieldcat_lvc.
when 'ID'.
gt_fieldcat_lvc-no_out = 'X'.
modify gt_fieldcat_lvc.
when 'GJAHR'.
gt_fieldcat_lvc-no_out = 'X'.
modify gt_fieldcat_lvc.

when 'ZFLAG_T4X'.
gt_fieldcat_lvc-edit = '1'.
gt_fieldcat_lvc-checkbox = 'X'.
modify gt_fieldcat_lvc.
when 'ZFLAG_48'.
gt_fieldcat_lvc-edit = '1'.
gt_fieldcat_lvc-checkbox = 'X'.
modify gt_fieldcat_lvc.
when 'CLASSE_A'.
gt_fieldcat_lvc-no_out = 'X'.
modify gt_fieldcat_lvc.
when 'ORD41_A'.
gt_fieldcat_lvc-no_out = 'X'.
modify gt_fieldcat_lvc.

when 'ORD42_A'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'ORD43_A'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'ORD44_A'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'ZFLAG'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'KOSTL'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'GSBER'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'ANLUE_A'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'GDLGRP_A'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'EIGKZ_A'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'KOSTL_A'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'GSBER_A'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'UMWKZ_A'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.

'X'.
'X'.
'X'.
'X'.
'X'.
'X'.
'X'.
'X'.
'X'.
'X'.
'X'.
'X'.

when 'APPO_SEC'.
gt_fieldcat_lvc-no_out = 'X'.
modify gt_fieldcat_lvc.
endcase.
elseif tb_testata-ztipo = 'TR'.
case gt_fieldcat_lvc-fieldname.
when 'PROZS'.
gt_fieldcat_lvc-edit = '1'.
modify gt_fieldcat_lvc.
when 'VALORE'.
gt_fieldcat_lvc-edit = '1'.
modify gt_fieldcat_lvc.
when 'MENGE'.
gt_fieldcat_lvc-edit = '1'.
modify gt_fieldcat_lvc.
when 'ZUJHR'.
gt_fieldcat_lvc-edit = '1'.
modify gt_fieldcat_lvc.
when 'ZUJHR_A'.
gt_fieldcat_lvc-edit = '1'.
modify gt_fieldcat_lvc.

when 'BUKRS'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'ID'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'GJAHR'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
when 'APPO_SEC'.
gt_fieldcat_lvc-no_out =
modify gt_fieldcat_lvc.
*

'X'.
'X'.
'X'.
'X'.

when 'ZFLAG_IMPORTO'.
gt_fieldcat_lvc-edit = '1'.
gt_fieldcat_lvc-checkbox = 'X'.
modify gt_fieldcat_lvc.
when 'ZFLAG_CAPIENZA'.
gt_fieldcat_lvc-edit = '1'.
gt_fieldcat_lvc-checkbox = 'X'.
modify gt_fieldcat_lvc.
when 'ZFLAG_CAP_ANNO'.
gt_fieldcat_lvc-edit = '1'.
gt_fieldcat_lvc-checkbox = 'X'.
modify gt_fieldcat_lvc.
when 'ZFLAG_CI'.
gt_fieldcat_lvc-edit = '1'.
gt_fieldcat_lvc-checkbox = 'X'.
modify gt_fieldcat_lvc.
when 'APPO_SEC'.
gt_fieldcat_lvc-no_out = 'X'.
modify gt_fieldcat_lvc.

when 'ZFLAG_T4X'.
gt_fieldcat_lvc-edit = '1'.
gt_fieldcat_lvc-checkbox = 'X'.
modify gt_fieldcat_lvc.
when 'ZFLAG'.
gt_fieldcat_lvc-checkbox = 'X'.
modify gt_fieldcat_lvc.

when 'ZFLAG_48'.
gt_fieldcat_lvc-edit = '1'.
gt_fieldcat_lvc-checkbox = 'X'.
modify gt_fieldcat_lvc.
endcase.
endif.
endloop.
data: lt_celltab type lvc_t_styl,
l_index type i.

loop at tb_pos.
l_index = sy-tabix.
refresh lt_celltab.
clear tb_pos-celltab.
perform fill_celltab using 'RW'
'PROZS'
changing lt_celltab. "CHIUDI
*
perform fill_celltab using 'RO'
*
'VALORE'
*
changing lt_celltab. "APRI
* endif.
*2c.Copy your celltab to the celltab of the current row of gt_outtab.
insert lines of lt_celltab into table tb_pos-celltab.
modify tb_pos index l_index.
endloop.
endform.
" fieldacat
*&---------------------------------------------------------------------*
*&
Form alv_grid
*&---------------------------------------------------------------------*
form alv_grid.
if not tb_pos[] is initial.
perform fieldacat.
perform escludi.
if g_custom_container is initial.
create object g_custom_container
exporting container_name = g_container.
create object grid
exporting i_parent = g_custom_container.
* make the ALV Grid Control editable and optimize the width of the colum
*
gs_layout-edit = 'X'.
gs_layout-cwidth_opt = 'X'.
gs_layout-zebra = 'X'.
gs_layout-cwidth_opt = 'X'.
gs_layout-stylefname = 'CELLTAB'.

*
*

create object gr_event_handler .


set handler gr_event_handler->handle_toolbar for grid.
set handler gr_event_handler->handle_user_command for grid.
set handler gr_event_handler->handle_data_changed for grid.
SET HANDLER gr_event_handler->handle_hotspot_click FOR grid.
SET HANDLER gr_event_handler->handle_double_click FOR grid .

* set table for first display


call method grid->set_table_for_first_display
exporting
it_toolbar_excluding = it_tooolbar_excluding
i_structure_name = 'ZTAA_FIE113_WF_P'
is_layout
= gs_layout
changing
it_outtab
= tb_pos[]
it_fieldcatalog = gt_fieldcat_lvc[].
* make the ALV Grid Control ready for input
call method grid->set_ready_for_input

exporting
i_ready_for_input = 1.
call method grid->register_edit_event
exporting
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
else.
call method grid->refresh_table_display.
endif.
call method cl_gui_control=>set_focus exporting control = grid.
endif.
endform.
" alv_grid
*&---------------------------------------------------------------------*
*&
Form ordxx_text_lesen
*&---------------------------------------------------------------------*
form ordxx_text_lesen.
data: l_ord4x
l_ordtx
l_ordnr

like anla-ord41,
like ra01m-ordtx_1,
like t087-ordnr.

*
do 4 times
varying l_ord4x from wa_pos-ord41
varying l_ordtx from ra01m-ordtx_1
*

next wa_pos-ord42
next ra01m-ordtx_2.
Wenn Initial - text space setzen

if l_ord4x is initial.
l_ordtx
= space.
else.
unpack sy-index to l_ordnr.
perform ordxx_text using l_ordtx l_ord4x l_ordnr.
endif.
enddo.
endform.
" ordxx_text_lesen
*&---------------------------------------------------------------------*
*&
Form gdlgrp_text_lesen
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
form gdlgrp_text_lesen.
data: ld_t087s like t087s.
*
check not wa_pos-gdlgrp is initial.
ld_t087s-gdlgrp = wa_pos-gdlgrp.
call function 'T087G_READ'
changing
f_t087s
= ld_t087s
exceptions
not_found = 1
no_entries = 2
others
= 3.

case sy-subrc.
when 0.
t087s = ld_t087s.
when others.
t087s-gdlgrp_txt = text-008.
endcase.
endform.
" gdlgrp_text_lesen
*&---------------------------------------------------------------------*
*&
Form ordxx_text
*&---------------------------------------------------------------------*
form ordxx_text using u_text u_ord4x u_ordnr.
*
local: u_ordnr,
u_ord4x.
data: ld_t087 like t087.
*

Ordnungsbegriffstext lesen
ld_t087-ordnr = u_ordnr.
ld_t087-ord4x = u_ord4x.
call function 'T087_READ'
importing
e_t087t
= t087t
changing
f_t087
= ld_t087
exceptions
not_found = 1
no_entries = 2
others
= 3.
if sy-subrc = 0.
u_text
= t087t-ordtx.
else.
u_text
= text-008.
endif.

*
endform.

" ordxx_text

*&---------------------------------------------------------------------*
*&
Form anlue_text_lesen
*&---------------------------------------------------------------------*
form anlue_text_lesen.
data: ld_t087v like t087v.
*
if not wa_pos-anlue is initial.
ld_t087v-anlue = wa_pos-anlue.
call function 'T087U_READ'
changing
f_t087v
= ld_t087v
exceptions
no_entries = 1
not_found = 2.
t087v-anlue_txt = text-008.
if sy-subrc = 0.
t087v-anlue_txt = ld_t087v-anlue_txt.
endif.
else.

t087v-anlue_txt = space.
endif.
endform.
" anlue_text_lesen
*&---------------------------------------------------------------------*
*&
Form anlue_check
*&---------------------------------------------------------------------*
form anlue_check.
* Prfen der Wirtschaftseinheit
data: ld_t087v like t087v.
*
check not wa_pos-anlue is initial.
ld_t087v-anlue = wa_pos-anlue.
call function 'T087U_READ'
changing
f_t087v
= ld_t087v
exceptions
no_entries = 1
not_found = 2.
if sy-subrc = 2.
message id sy-msgid
with
sy-msgv1
endif.

type 'E'
sy-msgv2

number sy-msgno
sy-msgv3
sy-msgv4.

endform.
" anlue_check
*&---------------------------------------------------------------------*
*&
Form controlli_100
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
form controlli_100.
* Controlli Societ
if tb_testata-bukrs is initial.
message e001(zcaa_wf).
endif.
* Controlli Data registrazione
if tb_testata-bldat is initial.
message e010(zcaa_wf).
else.
concatenate tb_testata-bldat+6(2) '.'
tb_testata-bldat+4(2) '.'
tb_testata-bldat(4) into va_bldat.
endif.
** controllo data evento > sy-datum
if tb_testata-bldat > sy-datum.
message e076(zcaa_wf) with tb_testata-bldat sy-datum .
endif.
* Controllo tipo operazione
if tb_testata-ztipo is initial.
message e004(zcaa_wf).
endif.

* Motivo operazione
if tb_testata-zmotivo is initial.
message e006(zcaa_wf).
endif.
* Motivo operazione
if tb_testata-zzrespbudg is initial.
message e008(zcaa_wf).
endif.
* Controllo Passaggio esercizio
select single lgjahr into t093c-lgjahr from t093c
where bukrs = tb_testata-bukrs.
if va_gjahr > t093c-lgjahr.
message e059(ab).
endif.
refresh tb_ztaa_fie113_wf_z
select * into corresponding
from ztaa_fie113_wf_z where
and

.
fields of table tb_ztaa_fie113_wf_z
ztipo = tb_testata-ztipo
zmotivo = tb_testata-zmotivo.

authority-check object 'I_INGRP'


id 'TCD'
field
sy-tcode
*
ID 'IWERK' FIELD
dummy
id 'INGRP' field tb_testata-zzrespbudg+1(3).
if sy-subrc <> 0.
message e035(zcaa_wf) with sy-uname tb_testata-zzrespbudg.
endif.
* if tb_testata-ztipo = 'DI'.
*
if tb_testata-zmotivo = 2.
*
message w036(ZCAA_WF).
*
endif.
* endif.
endform.
" controlli_100
*&---------------------------------------------------------------------*
*&
Form inserisci
*&---------------------------------------------------------------------*
form inserisci.
data vn_pos(3) type n.
check not wa_pos is initial.
perform crea_ranges.
perform controllo_esistenza.
* controlli sulla chiave TIPOLOGIA/ PARTE/ SEZIONE/ IMPIANTO/ ESERCIZIO
* di capitalizzazione del cespite/ AREA TERRITORIALE
loop at tb_pos.
add 1 to vn_pos.
endloop.
clear tb_pos.
tb_testata-gjahr = va_gjahr.
tb_testata-ernam = sy-uname.
tb_testata-zstato = 'ACM'.

move-corresponding wa_pos to tb_pos.


move-corresponding tb_testata to tb_pos.
tb_pos-icon = '@5D@'.
*
*
*
*
*
*

add 1 to vn_pos.
loop at tb_cespiti where buzei eq space.
tb_cespiti-bukrs = tb_testata-bukrs.
tb_cespiti-gjahr = tb_testata-gjahr.
tb_cespiti-buzei = vn_pos.
modify tb_cespiti.
endloop.
if tb_testata-ztipo = 'DI'.
if tb_pos-zflag_t4x = 'X' and tb_pos-zujhr is initial.
tb_pos-zflag_importo = space.
tb_pos-zflag_capienza = 'X'.
endif.
if tb_pos-zflag_t4x = 'X' and not tb_pos-zujhr is initial.
tb_pos-zflag_importo = 'X'.
tb_pos-zflag_capienza = space.
endif.
if tb_pos-zflag_48 = 'X'.
tb_pos-zflag_importo = 'X'.
tb_pos-zflag_capienza = space.
endif.
if tb_pos-zflag_48 is initial and tb_pos-zflag_t4x is initial.
tb_pos-zflag_importo = 'X'.
tb_pos-zflag_capienza = space.
endif.
else.
tb_pos-zflag_importo = 'X'.
tb_pos-zflag_capienza = space.
endif.

*
*
*

if not tb_pos-zujhr is initial.


tb_pos-zflag_cap_anno = 'X'.
endif.
select single * from ztaa_fie113_wf_n where bukrs = tb_testata-bukrs
and ord41 = tb_pos-ord41
and ord42 = tb_pos-ord42
and ord43 = tb_pos-ord43
and ord44 = tb_pos-ord44.
if sy-subrc = 0.
if not tb_pos-anlue is initial.
tb_pos-eigkz = 'T'.
endif.
endif.
tb_pos-buzei = vn_pos.
append tb_pos.
perform alv_grid.
clear wa_pos.

endform.
" inserisci
*&---------------------------------------------------------------------*
*&
Form meins_pruefen

*&---------------------------------------------------------------------*
form meins_pruefen using u_meins.
*
data: g_trtyp
like t020-aktyp value 'H'.
constants: con_anzei(1)
type c value 'A'.
if g_trtyp = con_anzei.
exit.
endif.
*

Keine Mengeneinheit eingegeben


if u_meins is initial.
exit.
endif.

*
select single * from t006 where

msehi = u_meins.

if sy-subrc ne 0.
message id 'AA' type 'E' number '183'
with u_meins.
endif.
*
Kaufmnische Einheit
if t006-kzkeh = space.
message id 'AA' type 'E' number '185'
with u_meins.
endif.
endform.
" meins_pruefen
*&---------------------------------------------------------------------*
*&
Form menge_meins_pruefen
*&---------------------------------------------------------------------*
form menge_meins_pruefen using u_meins u_menge.
if not u_menge is initial.
if u_meins is initial.
message id 'AA' type 'E' number '899'.
endif.
endif.
endform.
" menge_meins_pruefen
*&---------------------------------------------------------------------*
*&
Form menge_pruefen
*&---------------------------------------------------------------------*
form menge_pruefen.
*data:
gt_frules
type aist_fieldrules.
*data: ls_frules
like line of gt_frules.
*
*
check WA_POS-menge is initial.
*
*
read table gt_frules into ls_frules
*
with table key fldnm = 'WA_POS-MENGE'.
*
if
sy-subrc eq 0
*
and ls_frules-status eq '3'
"<< note 445513
*
and g_dialog
eq con_x. "<< note 387962
**
return error only in dialog processing e.g. in AS02
*
message e055(00).
*
endif.
endform.
" menge_pruefen
*&---------------------------------------------------------------------*
*&
Form help_meins_kaufm

*&---------------------------------------------------------------------*
form help_meins_kaufm using u_meins.
*
data: hlp_meins
like anka-meins.
data: l_input.
data: g_trtyp
like t020-aktyp value 'H'.
constants:
con_aende(1)
type c value 'V',
con_hinzu(1)
type c value 'H'.
*
Range erforderlich fr
*
Help Mengen/Flcheneinheit
ranges r_meins for t006a-msehi.
*
clear t006d.
refresh r_meins.
*
call function 'ME_VALUES_T006'
exporting
i_kz1eh = space
i_kz2eh = space
i_kzkeh = 'X'
i_kzwob = space
i_t006d = t006d
importing
e_meins = hlp_meins
tables
t_meins = r_meins.
*
EINGABE NICHT BERNEHMEN, WENN
*
keine Auswahl oder Anzeigen
l_input = '0'.
*
if g_trtyp = con_aende or
g_trtyp = con_hinzu.
loop at screen.
if screen-name = 'WA_POS-MEINS'.
l_input = screen-input.
exit.
endif.
*
endloop.
endif.
if hlp_meins
ne space and
l_input
ne '0'.
u_meins = hlp_meins.
endif.
endform.
" help_meins_kaufm
*&---------------------------------------------------------------------*
*&
Form crea_ranges
*&---------------------------------------------------------------------*
form crea_ranges.
refresh
refresh
refresh
refresh
refresh

r_anlue.
r_ord41.
r_ord42.
r_ord43.
r_ord44.

refresh
refresh
refresh
refresh
clear
clear
clear
clear
clear
clear
clear
clear

r_zujhr.
r_gdlgrp.
r_eigkz.
r_anlkl.

r_ord41.
r_ord42.
r_ord43.
r_ord44.
r_zujhr.
r_gdlgrp.
r_anlue.
r_eigkz.

append 'EEQ00000098' to r_anlkl.


append 'EEQ00000099' to r_anlkl.

if not wa_pos-ord41 is initial.


clear r_ord41.
r_ord41-sign = 'I'.
r_ord41-option = 'EQ'.
r_ord41-low = wa_pos-ord41.
append r_ord41.
endif.
if not wa_pos-ord42 is initial.
clear r_ord42.
r_ord42-sign = 'I'.
r_ord42-option = 'EQ'.
r_ord42-low = wa_pos-ord42.
append r_ord42.
endif.
if not wa_pos-ord43 is initial.
clear r_ord43.
r_ord43-sign = 'I'.
r_ord43-option = 'EQ'.
r_ord43-low = wa_pos-ord43.
append r_ord43.
endif.
if not wa_pos-ord44 is initial.
clear r_ord44.
r_ord44-sign = 'I'.
r_ord44-option = 'EQ'.
r_ord44-low = wa_pos-ord44.
append r_ord44.
endif.
*
*
*
*
*
*
*

if not wa_pos-zujhr is initial.


clear r_zujhr.
r_zujhr-sign = 'I'.
r_zujhr-option = 'EQ'.
r_zujhr-low = wa_pos-zujhr.
append r_zujhr.
endif.
if not wa_pos-gdlgrp is initial.
clear r_gdlgrp.

r_gdlgrp-sign = 'I'.
r_gdlgrp-option = 'EQ'.
r_gdlgrp-low = wa_pos-gdlgrp.
append r_gdlgrp.
endif.
if not wa_pos-eigkz is initial.
clear r_eigkz.
refresh r_eigkz.
r_eigkz-sign = 'I'.
r_eigkz-option = 'EQ'.
r_eigkz-low = wa_pos-eigkz.
append r_eigkz.
endif.
if not wa_pos-anlue is initial.
clear r_anlue.
r_anlue-sign = 'I'.
r_anlue-option = 'EQ'.
r_anlue-low = wa_pos-anlue.
append r_anlue.
endif.

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*

if not wa_pos-zujhr is initial.


if wa_pos-zujhr_a is initial.
clear r_zujhr.
r_zujhr-sign = 'I'.
r_zujhr-option = 'EQ'.
r_zujhr-low = wa_pos-zujhr.
append r_zujhr.
else.
clear r_zujhr.
r_zujhr-sign = 'I'.
r_zujhr-option = 'BT'.
r_zujhr-low = wa_pos-zujhr.
r_zujhr-high = wa_pos-zujhr_a.
append r_zujhr.
endif.
endif.
if not wa_pos-kostl is initial.
clear r_kostl.
refresh r_kostl.
r_kostl-sign = 'I'.
r_kostl-option = 'EQ'.
r_kostl-low = wa_pos-kostl.
append r_kostl.
endif.
if not wa_pos-gsber is initial.
clear r_gsber.
refresh r_gsber.
r_gsber-sign = 'I'.
r_gsber-option = 'EQ'.
r_gsber-low = wa_pos-gsber.
append r_gsber.
endif.

endform.

" crea_ranges

*&---------------------------------------------------------------------*
*&
Form controllo_esistenza
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
form controllo_esistenza.
data: begin of s_anlc.
include structure anlc.
data end of s_anlc.
data: begin of s_anlcv.
include structure anlcv.
data end of s_anlcv.
loop at tb_pos

where bukrs = tb_testata-bukrs


and ord41 = wa_pos-ord41
and ord42 = wa_pos-ord42
and ord43 = wa_pos-ord43
and ord44 = wa_pos-ord44
and zujhr in r_zujhr
and gdlgrp = wa_pos-gdlgrp.

endloop.
if sy-subrc = 0.
message e019(zcaa_wf).
endif.
read table tb_pos with key bukrs = tb_testata-bukrs
ord41 = wa_pos-ord41
ord42 = wa_pos-ord42
ord43 = wa_pos-ord43
ord44 = wa_pos-ord44
zujhr = wa_pos-zujhr
zujhr_a = wa_pos-eigkz_a
gdlgrp = wa_pos-gdlgrp.
if sy-subrc = 0.
message e019(zcaa_wf).
endif.
*
*
*
*
*
*
*
*
*
*
*
*
*
*

refresh r_zujhr_pos.
clear r_zujhr_pos.
if not wa_pos-zujhr is initial.
if wa_pos-zujhr_a is initial.
clear va_zujhr.
va_zujhr-sign = 'I'.
va_zujhr-option = 'EQ'.
va_zujhr-low = wa_pos-zujhr.
append va_zujhr to r_zujhr_pos.
else.
clear va_zujhr.
va_zujhr-sign = 'I'.
va_zujhr-option = 'BT'.
va_zujhr-low = wa_pos-zujhr.

*
*
*
*

va_zujhr-high = wa_pos-zujhr_a.
append va_zujhr to r_zujhr_pos.
endif.
endif.
if not wa_pos-zujhr is initial.
loop at tb_pos into appo_pos where
and
and
and
and
and
and
and
endloop.
if sy-subrc = 0.
message e019(zcaa_wf).
endif.
endif.
if not wa_pos-zujhr_a is initial.
loop at tb_pos into appo_pos where
and
and
and
and
and
and
and
endloop.
if sy-subrc = 0.
message e019(zcaa_wf).
endif.
endif.

bukrs = tb_testata-bukrs
ord41 = wa_pos-ord41
ord42 = wa_pos-ord42
ord43 = wa_pos-ord43
ord44 = wa_pos-ord44
gdlgrp = wa_pos-gdlgrp
zujhr <= wa_pos-zujhr
zujhr_a >= wa_pos-zujhr.

bukrs = tb_testata-bukrs
ord41 = wa_pos-ord41
ord42 = wa_pos-ord42
ord43 = wa_pos-ord43
ord44 = wa_pos-ord44
gdlgrp = wa_pos-gdlgrp
zujhr >= wa_pos-zujhr_a
zujhr_a <= wa_pos-zujhr_a.

refresh t_cespiti.
select * into corresponding fields of table t_cespiti from anla
where bukrs = tb_testata-bukrs
and anlkl in r_anlkl
and ord41 in r_ord41
and ord42 in r_ord42
and ord43 in r_ord43
and ord44 in r_ord44
and zujhr in r_zujhr
and eigkz in r_eigkz
and anlue in r_anlue
and gdlgrp in r_gdlgrp.
loop at t_cespiti.
if not t_cespiti-deakt is initial.
delete t_cespiti.
continue.
endif.
if t_cespiti-zugdt is initial.
delete t_cespiti.
endif.
endloop.

read table t_cespiti index 1.


if sy-subrc ne 0.
message e015(zcaa_wf).
endif.
endform.
" controllo_esistenza
*&---------------------------------------------------------------------*
*&
Form estrai_cespiti
*&---------------------------------------------------------------------*
form estrai_cespiti.
data: flag_check, flag_err,
icon type icon_d.
clear: flag_check, flag_err, icon.
refresh: t_cespiti, tb_cespiti, tb_fogli_bapi, tb_fogli.
refresh: gt_log.
loop at tb_pos.
refresh: t_cespiti, tb_fogli_bapi.
call function 'ZUAA_FIE113_01_CESPITI'
exporting
bukrs
= tb_testata-bukrs
gjahr
= va_gjahr
id
= tb_testata-id
buzei
= tb_pos-buzei
ord41
= tb_pos-ord41
ord42
= tb_pos-ord42
ord43
= tb_pos-ord43
ord44
= tb_pos-ord44
zujhr
= tb_pos-zujhr
zujhr_a
= tb_pos-zujhr_a
eigkz
= tb_pos-eigkz
anlue
= tb_pos-anlue
gdlgrp
= tb_pos-gdlgrp
valore
= tb_pos-valore
prozs
= tb_pos-prozs
bldat
= tb_testata-bldat
zricavo
= tb_pos-zricavo
zflag_importo = tb_pos-zflag_importo
zflag_capienza = tb_pos-zflag_capienza
zflag_cap_anno = tb_pos-zflag_cap_anno
zflag_ci
= tb_pos-zflag_ci
tables
t_cespiti
= t_cespiti
tb_fogli
= tb_fogli_bapi.
loop at t_cespiti.
clear tb_cespiti.
tb_cespiti = t_cespiti.
append tb_cespiti.
endloop.
sort tb_fogli_bapi by buzei id_old buzei_old bldat.
loop at tb_fogli_bapi.
clear tb_fogli.
tb_fogli = tb_fogli_bapi.
clear: tb_fogli-menge, tb_fogli-meins, vn_meins, vn_menge.
vn_meins = tb_fogli_bapi-meins.
vn_menge = tb_fogli_bapi-menge.
at new buzei_old.
tb_fogli-menge = vn_menge.

*
*
*
*

tb_fogli-meins = vn_meins.
endat.
on change of tb_fogli_bapi-id_old or tb_fogli_bapi-buzei_old.
tb_fogli-menge = tb_fogli_bapi-menge.
tb_fogli-meins = tb_fogli_bapi-meins.
endon.
append tb_fogli.
endloop.
endloop.

if tb_cespiti[] is initial.
sort gt_log by buzei type id .
delete adjacent duplicates from gt_log.
perform alv_log.
else.
refresh: gt_log.
loop at tb_pos.
refresh: gt_log_bapi, tb_cespiti_bapi .
loop at tb_cespiti where buzei = tb_pos-buzei.
clear tb_cespiti_bapi.
tb_cespiti_bapi = tb_cespiti.
append tb_cespiti_bapi.
endloop.
clear: flag_check, flag_err.

call function 'ZUAA_FIE113_01_BAPI_CHECK'


exporting
bukrs
= tb_testata-bukrs
gjahr
= va_gjahr
id
= tb_testata-id
buzei
= tb_pos-buzei
bldat
= tb_testata-bldat
budat
= tb_testata-budat
ord41
= tb_pos-ord41
ord42
= tb_pos-ord42
ord43
= tb_pos-ord43
ord44
= tb_pos-ord44
zujhr
= tb_pos-zujhr
gdlgrp
= tb_pos-gdlgrp
menge
= tb_pos-menge
meins
= tb_pos-meins
zflag_ci
= tb_pos-zflag_ci
importing
flag_err
= flag_err
flag_check = flag_check
icon
= icon
tables
gt_log
= gt_log_bapi
tb_cespiti = tb_cespiti_bapi
tb_fogli
= tb_fogli.

loop at gt_log_bapi into gs_log.


append gs_log to gt_log.
endloop.
tb_pos-flag_err = flag_err.
tb_pos-flag_check = flag_check.
tb_pos-icon = icon.
modify tb_pos.
endloop.
endif.
sort gt_log by buzei type id .
delete adjacent duplicates from gt_log.
endform.
" estrai_cespiti
*&---------------------------------------------------------------------*
*&
Form fieldacat_400
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
form fieldacat_400.
refresh gt_fieldcat_lvc_4.
* merge the fieldcatalog
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'ZSAA_FIE113_WF_CESPITI'
changing
ct_fieldcat
= gt_fieldcat_lvc_4[].
* blind out the column 'XSTRING'
loop at gt_fieldcat_lvc_4 .
case gt_fieldcat_lvc_4-fieldname.
when 'BUKRS'.
gt_fieldcat_lvc_4-no_out = 'X'.
modify gt_fieldcat_lvc_4.
when 'ID'.
gt_fieldcat_lvc_4-no_out = 'X'.
modify gt_fieldcat_lvc_4.
when 'POSNR'.
gt_fieldcat_lvc_4-no_out = 'X'.
modify gt_fieldcat_lvc_4.

when 'ANLN1'.
gt_fieldcat_lvc_4-hotspot = 'X'.
gt_fieldcat_lvc_4-no_out = 'X'.
modify gt_fieldcat_lvc_4.

when 'ANLN2'.
gt_fieldcat_lvc_4-no_out = 'X'.
modify gt_fieldcat_lvc_4.

when 'ANLKL'.
gt_fieldcat_lvc_4-no_out = 'X'.
modify gt_fieldcat_lvc_4.
when 'KANSW'.

gt_fieldcat_lvc_4-do_sum = 'X'.
modify gt_fieldcat_lvc_4.
when 'VALORE_MOVIMENTO'.
gt_fieldcat_lvc_4-do_sum = 'X'.
modify gt_fieldcat_lvc_4.
when 'VALORE_DISPONIBILE'.
gt_fieldcat_lvc_4-do_sum = 'X'.
modify gt_fieldcat_lvc_4.
when 'ZRICAVO'.
gt_fieldcat_lvc_4-do_sum = 'X'.
modify gt_fieldcat_lvc_4.
when 'CLASSE_A'.
gt_fieldcat_lvc_4-no_out =
modify gt_fieldcat_lvc_4.
when 'GJAHR'.
gt_fieldcat_lvc_4-no_out =
modify gt_fieldcat_lvc_4.
when 'ZZDEST_ANLN1'.
gt_fieldcat_lvc_4-no_out =
modify gt_fieldcat_lvc_4.
when 'ZZDEST_ANLN2'.
gt_fieldcat_lvc_4-no_out =
modify gt_fieldcat_lvc_4.
when 'BELNR'.
gt_fieldcat_lvc_4-no_out =
modify gt_fieldcat_lvc_4.
when 'DMBTR'.
gt_fieldcat_lvc_4-no_out =
modify gt_fieldcat_lvc_4.

'X'.
'X'.
'X'.
'X'.
'X'.
'X'.

when 'APPO_SEC'.
gt_fieldcat_lvc_4-no_out = 'X'.
modify gt_fieldcat_lvc_4.
*
*
*

when 'VALORE'.
gt_fieldcat_lvc_4-no_out = 'X'.
modify gt_fieldcat_lvc_4.
endcase.
endloop.

endform.
" fieldacat_400
*&---------------------------------------------------------------------*
*&
Form escludi
*&---------------------------------------------------------------------*
form escludi.
refresh it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_check
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_loc_cut
to it_tooolbar_excluding.

append cl_gui_alv_grid=>mc_fc_loc_delete_row
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_loc_append_row
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_loc_copy_row
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_loc_insert_row
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_loc_move_row
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_loc_paste
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_loc_paste_new_row
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_loc_undo
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_loc_insert_row
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_evt_enter
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_evt_modified
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_loc_copy
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_call_abc
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_deselect_all
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_graph
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_help
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_call_master_data
to it_tooolbar_excluding.
append cl_gui_alv_grid=>mc_fc_info
to it_tooolbar_excluding.
endform.
" escludi
*&---------------------------------------------------------------------*
*&
Form controlli_200
*&---------------------------------------------------------------------*
form controlli_200.
clear: va_flag_61,
va_flag_ci.
* Controllo area territoriale / Unit Richeidente.
if not wa_pos-ord44 is initial.
if wa_pos-ord41 = '44'.
if tb_testata-zzrespbudg+2(2) = 'SR' or
tb_testata-zzrespbudg+2(2) = 'ER'.
if wa_pos-ord44+2(1) ne tb_testata-zzrespbudg+1(1).
message e080(zcaa_wf).
exit.
endif.
if wa_pos-ord44(2) ne '44'.
message e080(zcaa_wf).
exit.
endif.
endif.

endif.
endif.
* Controllo area territoriale / Unit Richeidente Campo destinatario
if not wa_pos-ord44_a is initial.
if wa_pos-ord41_a = '44'.
if wa_pos-ord44_a(2) ne '44'.
message w080(zcaa_wf).
exit.
endif.
endif.
endif.
if tb_testata-ztipo = 'DI'.
clear: tip, area, flag-imp, flag-ar_terr .
*controllo di esistenza su tabella custom
select single * from ztbcusto into ztbcusto
where societa = tb_testata-bukrs
and tipologia = wa_pos-ord41
and parte = wa_pos-ord42
and sezione = wa_pos-ord43.
if sy-subrc = 0.
*controllo sul campo IMPIANTO
if wa_pos-gdlgrp <> space.
move wa_pos-gdlgrp to tip.
*controllo ugualianza tra TIPOLOGIA ed IMPIANTO
if not tip = ztbcusto-tipologia.
flag-imp = 'X'.
endif.
endif.
*controllo sul campo AREA TERRITORIALE
if wa_pos-ord44 <> space.
move wa_pos-ord44 to area.
*controllo ugualianza tra TIPOLOGIA ed AREA TERRITORIALE
if not area = ztbcusto-tipologia.
flag-ar_terr = 'X'.
endif.
endif.
*impostazioni per messaggio d'errore
if flag-imp eq space
and
flag-ar_terr eq space .
else.
message e011(zcaa_wf).
endif.
else.
message e011(zcaa_wf).
endif.
* controllo IMPIANTO
if wa_pos-gdlgrp is initial.
message e020(zcaa_wf).
else.
**
clear va_gdlgrp.
**
concatenate wa_pos-ord41 tb_testata-zzrespbudg+1(3)
**
into va_gdlgrp.
**
if wa_pos-gdlgrp(5) ne va_gdlgrp(5).
**
message e042(zcaa_wf) with wa_pos-gdlgrp.
**
endif.
endif.

**** Controllo Natura provvisorio


***
if wa_pos-eigkz is initial.
***
message e017(zcaa_wf).
***
elseif wa_pos-eigkz = 'T'..
**** contollo N. collettivo cesp.
***
if wa_pos-anlue is initial.
***
message e016(zcaa_wf).
***
endif.
***
endif.
*** controllo Esercizio di prima capitalizzazione
**
if wa_pos-zujhr is initial.
**
message e018(zcaa_wf).
**
endif.
if wa_pos-prozs is initial and
wa_pos-valore is initial and
wa_pos-menge is initial.
message e012(zcaa_wf).
endif.
if not wa_pos-prozs is initial and
not wa_pos-valore is initial.
message e013(zcaa_wf).
endif.
if not wa_pos-prozs is initial and
not wa_pos-menge is initial.
message e013(zcaa_wf).
endif.
*
*
*
*

if not wa_pos-valore is initial and


not wa_pos-menge is initial.
message e013(zcaa_wf).
endif.
if not wa_pos-menge is initial and
wa_pos-meins is initial.
message e014(zcaa_wf).
endif.

*--------------- TRASFERIMENTI
elseif tb_testata-ztipo = 'TR'.
clear: tip, area, flag-imp, flag-ar_terr .
*controllo di esistenza su tabella custom
select single * from ztbcusto into ztbcusto
where societa = tb_testata-bukrs
and tipologia = wa_pos-ord41
and parte = wa_pos-ord42
and sezione = wa_pos-ord43.
if sy-subrc = 0.
*controllo sul campo IMPIANTO
if wa_pos-gdlgrp <> space.
move wa_pos-gdlgrp to tip.
*controllo ugualianza tra TIPOLOGIA ed IMPIANTO
if not tip = ztbcusto-tipologia.
flag-imp = 'X'.
endif.

endif.
*controllo sul campo AREA TERRITORIALE
if wa_pos-ord44 <> space.
move wa_pos-ord44 to area.
*controllo ugualianza tra TIPOLOGIA ed AREA TERRITORIALE
if not area = ztbcusto-tipologia.
flag-ar_terr = 'X'.
endif.
endif.
*impostazioni per messaggio d'errore
if flag-imp eq space
and
flag-ar_terr eq space .
else.
message e029(zcaa_wf).
exit.
endif.
else.
message e029(zcaa_wf).
exit.
endif.
* controllo IMPIANTO
if wa_pos-gdlgrp is initial.
message e020(zcaa_wf).
exit.
else.
**
clear va_gdlgrp.
**
concatenate wa_pos-ord41 tb_testata-zzrespbudg+1(3)
**
into va_gdlgrp.
**
if wa_pos-gdlgrp(5) ne va_gdlgrp(5).
**
message e042(zcaa_wf) with wa_pos-gdlgrp.
**
endif.
endif.
* centro di costo
*
if wa_pos-kostl is initial.
*
message e032(zcaa_wf).
*
exit.
*
endif.
* controllo Esercizio di prima capitalizzazione
*
if wa_pos-zujhr is initial.
*
message e018(zcaa_wf).
*
exit.
*
endif.
***** Videata dati trasferiti.
clear: tip, area, flag-imp, flag-ar_terr .
*controllo di esistenza su tabella custom
select single * from ztbcusto into ztbcusto
where societa = tb_testata-bukrs
and tipologia = wa_pos-ord41_a
and parte = wa_pos-ord42_a
and sezione = wa_pos-ord43_a.
if sy-subrc = 0.
*controllo sul campo IMPIANTO
if wa_pos-gdlgrp_a <> space.
move wa_pos-gdlgrp_a to tip.
*controllo ugualianza tra TIPOLOGIA ed IMPIANTO

if not tip = ztbcusto-tipologia.


flag-imp = 'X'.
endif.
endif.
*controllo sul campo AREA TERRITORIALE
if wa_pos-ord44_a <> space.
move wa_pos-ord44_a to area.
*controllo ugualianza tra TIPOLOGIA ed AREA TERRITORIALE
if not area = ztbcusto-tipologia.
flag-ar_terr = 'X'.
endif.
endif.
*impostazioni per messaggio d'errore
if flag-imp eq space
and
flag-ar_terr eq space .
else.
message e029(zcaa_wf).
exit.
endif.
else.
message e029(zcaa_wf).
exit.
endif.
* controllo IMPIANTO
if wa_pos-gdlgrp_a is initial.
message e020(zcaa_wf).
exit.
endif.
* controllo Area Territoriale
if wa_pos-ord44_a is initial.
message e041(zcaa_wf).
exit.
endif.

if wa_pos-kostl_a is initial.
message e032(zcaa_wf).
exit.
endif.
if wa_pos-prozs is initial and
wa_pos-valore is initial and
wa_pos-menge is initial.
message e030(zcaa_wf).
exit.
endif.
if not wa_pos-prozs is initial and
not wa_pos-valore is initial.
message e031(zcaa_wf).
exit.
endif.
if not wa_pos-prozs is initial and
not wa_pos-menge is initial.
message e031(zcaa_wf).
exit.
endif.

*
*
*
*
*

if not wa_pos-valore is initial and


not wa_pos-menge is initial.
message e031(zcaa_wf).
exit.
endif.
if not wa_pos-menge is initial and
wa_pos-meins is initial.
message e031(zcaa_wf).
exit.
endif.
endif.

**** calcolo valore medio


if not wa_pos-menge is initial.
clear: wa_pos-valore, valore_medio.
call function 'ZUAA_FIE113_01'
exporting
bukrs
= tb_testata-bukrs
gjahr
= va_gjahr
ord41
= wa_pos-ord41
ord42
= wa_pos-ord42
ord43
= wa_pos-ord43
ord44
= wa_pos-ord44
gdlgrp
= wa_pos-gdlgrp
meins
= wa_pos-meins
importing
valore_medio = valore_medio
exceptions
ecc_quant
= 1
ecc_val_med = 2
others
= 3.
if sy-subrc <> 0.
case sy-subrc.
when 1.
message e034(zcaa_wf) with wa_pos-meins.
when 2.
message e033(zcaa_wf).
endcase.
endif.
wa_pos-valore = wa_pos-menge * valore_medio.
wa_pos-zflag_t4x = 'X'.
* Controllo esistenza ZAPS
read table tb_pos with key zflag_t4x = space.
if sy-subrc = 0.
message e043(zcaa_wf).
endif.
else.
if wa_pos-zflag_t4x is initial.
read table tb_pos with key zflag_t4x = 'X'.
if sy-subrc = 0.
message e045(zcaa_wf).
endif.
endif.
endif.
**** Controllo 48.

select single * from ztaa_fie113_wf_u where bukrs = tb_testata-bukrs


and gjahr = va_gjahr
and monat = tb_testata-bldat+4(2)
and ord41 = wa_pos-ord41
and ord42 = wa_pos-ord42
and ord43 = wa_pos-ord43
and ord44 = wa_pos-ord44
and gdlgrp = wa_pos-gdlgrp.
if sy-subrc = 0.
wa_pos-zflag_48 = 'X'.
read table tb_pos with key zflag_48 = space.
if sy-subrc = 0.
message e044(zcaa_wf).
endif.
if tb_testata-ztipo = 'DI'.
if tb_testata-zmotivo ne '1'.
message e048(zcaa_wf).
endif.
endif.
else.
read table tb_pos with key zflag_48 = 'X'.
if sy-subrc = 0.
message e046(zcaa_wf).
endif.
endif.
*** Controlli coerenza Esercizio Capitalizzazione
if not wa_pos-zujhr_a is initial.
if wa_pos-zujhr is initial.
message e052(zcaa_wf).
endif.
endif.
if not wa_pos-zujhr is initial.
if not wa_pos-zujhr_a is initial.
if wa_pos-zujhr_a < wa_pos-zujhr.
message e051(zcaa_wf) with wa_pos-zujhr_a wa_pos-zujhr.
endif.
endif.
endif.
*** controllo campo prozs %
if wa_pos-prozs > 100.
message e056(zcaa_wf).
endif.
**** Campo Natura DA
if not wa_pos-ord41 is initial or
not wa_pos-ord42 is initial or
not wa_pos-ord43 is initial.
select single * from ztaa_fie113_wf_n where bukrs = tb_testata-bukrs
and ord41 = wa_pos-ord41
and ord42 = wa_pos-ord42
and ord43 = wa_pos-ord43
and ord44 = wa_pos-ord44.
if sy-subrc = 0.
if not wa_pos-anlue is initial.
wa_pos-eigkz = 'T'.
else.

clear: wa_pos-eigkz.
endif.
else.
clear: wa_pos-eigkz.
endif.
endif.
* Campo Natura a
if not
not
not
not

wa_pos-ord41_a
wa_pos-ord42_a
wa_pos-ord43_a
wa_pos-ord44_a

is
is
is
is

initial or
initial or
initial or
initial.

select single * from ztaa_fie113_wf_n where bukrs =


and ord41
and ord42
and ord43
and ord44
if sy-subrc = 0.
if not wa_pos-anlue_a is initial.
wa_pos-eigkz_a = 'T'.
else.
clear: wa_pos-eigkz_a.
endif.
else.
clear: wa_pos-eigkz_a.
endif.
endif.

tb_testata-bukrs
= wa_pos-ord41_a
= wa_pos-ord42_a
= wa_pos-ord43_a
= wa_pos-ord44_a.

if wa_pos-ord44 is initial.
message e087(zcaa_wf).
endif.
endform.
" controlli_200
*&---------------------------------------------------------------------*
*&
Form handle_user_command
*&---------------------------------------------------------------------*
form handle_user_command using p_e_ucomm.
case p_e_ucomm.
when 'DEL'.
perform cancella.
when 'SALV'.
call method grid->refresh_table_display.
endcase.
endform.
" handle_user_command
*&---------------------------------------------------------------------*
*&
Form cancella
*&---------------------------------------------------------------------*
form cancella.
data: l_t_selected_rows type lvc_t_row,
ind type sy-index,
inde type line of lvc_t_row.
call method grid->get_selected_rows

importing
et_index_rows = l_t_selected_rows.
loop at l_t_selected_rows into inde.
clear tb_pos.
read table tb_pos index inde-index.
delete tb_cespiti where buzei = tb_pos-buzei.
delete gt_log where buzei = tb_pos-buzei.
*
DELETE tb_pos.
delete tb_pos index inde-index.
endloop.
call method grid->refresh_table_display
EXPORTING
is_stable
=
i_soft_refresh =
exceptions
finished
= 1
others
= 2.
endform.
" cancella
*&---------------------------------------------------------------------*
*&
Form handle_toolbar
*&---------------------------------------------------------------------*
form handle_toolbar using
p_e_object type ref to
cl_alv_event_toolbar_set
p_e_interactive.
*
*
*

data: ls_toolbar type stb_button.


clear ls_toolbar.
move 'DEL' to ls_toolbar-function.
move '@18@' to ls_toolbar-icon.
move 'Cancella Riga' to ls_toolbar-quickinfo.
move 'Cancella Riga' to ls_toolbar-text.
move ' ' to ls_toolbar-disabled.
append ls_toolbar to p_e_object->mt_toolbar.
clear ls_toolbar.
move 'SALV' to ls_toolbar-function.
move '@39@' to ls_toolbar-icon.
move 'Modifica Riga' to ls_toolbar-quickinfo.
move 'Modifica Riga' to ls_toolbar-text.
move ' ' to ls_toolbar-disabled.
append ls_toolbar to p_e_object->mt_toolbar.
*
*
*
*
*
*
*

clear ls_toolbar.
move 'SALV' to ls_toolbar-function.
move '@2L@' to ls_toolbar-icon.
move 'Modifica Riga' to ls_toolbar-quickinfo.
move 'Modifica Riga' to ls_toolbar-text.
move ' ' to ls_toolbar-disabled.
append ls_toolbar to p_e_object->mt_toolbar.

"#EC NOTEXT

"#EC NOTEXT

"#EC NOTEXT

"#EC NOTEXT

"#EC NOTEXT

"#EC NOTEXT

endform.
" handle_toolbar
*&---------------------------------------------------------------------*
*&
Form hotspot_click
*&---------------------------------------------------------------------*
form hotspot_click using
e_row_id type lvc_s_row
e_column_id type lvc_s_col
es_row_no type lvc_s_roid.

data in type sy-subrc.


read table tb_cespiti index es_row_no-row_id.
set parameter id 'BUK' field tb_cespiti-bukrs.
set parameter id 'AN1' field tb_cespiti-anln1.
set parameter id 'AN2' field tb_cespiti-anln2.
if sy-subrc = 0.
call transaction 'AS03' and skip first screen.
endif.
endform.
" hotspot_click
*&---------------------------------------------------------------------*
*&
Form make_field_edit
*&---------------------------------------------------------------------*
form make_field_edit changing p_output1.
* DATA: ls_grid LIKE LINE OF pt_grid,
*
ls_style TYPE lvc_s_styl,
*
lt_style TYPE lvc_t_styl.
*
* LOOP AT pt_grid INTO ls_grid.
*
IF ls_grid-uno = 'Faccio' AND ls_grid-cellstyles[] IS INITIAL.
*"your condition for the row
*
ls_style-fieldname = 'UNO'.
*
ls_style-style = cl_gui_alv_grid=>mc_style_enabled.
*
APPEND ls_style TO lt_style.
*
LOOP AT lt_style INTO ls_style.
*
APPEND ls_style TO ls_grid-cellstyles.
*
ENDLOOP.
*
MODIFY pt_grid FROM ls_grid.
*
ENDIF.
* ENDLOOP.
*
*
* CALL METHOD r_alv1->set_ready_for_input
*
EXPORTING
*
i_ready_for_input = 1.
endform.
" make_field_edit
*&---------------------------------------------------------------------*
*&
Form babi_check
*&---------------------------------------------------------------------*
form babi_check.
data: flag_check, flag_err,
icon type icon_d.
clear: flag_check, flag_err, icon.
check not tb_cespiti is initial.
refresh: gt_log.
loop at tb_pos.
*

refresh: gt_log_bapi, tb_cespiti_bapi .


read table tb_ztaa_fie113_wf_z index 1.
loop at tb_cespiti where buzei = tb_pos-buzei.
clear tb_cespiti_bapi.
tb_cespiti_bapi = tb_cespiti.
append tb_cespiti_bapi.

endloop.
clear: flag_check, flag_err.

call function 'ZUAA_FIE113_01_BAPI_CHECK'


exporting
bukrs
= tb_testata-bukrs
gjahr
= va_gjahr
id
= tb_testata-id
buzei
= tb_pos-buzei
bldat
= tb_testata-bldat
budat
= tb_testata-budat
ord41
= tb_pos-ord41
ord42
= tb_pos-ord42
ord43
= tb_pos-ord43
ord44
= tb_pos-ord44
zujhr
= tb_pos-zujhr
gdlgrp
= tb_pos-gdlgrp
menge
= tb_pos-menge
meins
= tb_pos-meins
zflag_ci
= tb_pos-zflag_ci
importing
flag_err
= flag_err
flag_check = flag_check
icon
= icon
tables
gt_log
= gt_log_bapi
tb_cespiti = tb_cespiti_bapi
tb_fogli
= tb_fogli.
loop at gt_log_bapi into gs_log.
append gs_log to gt_log.
endloop.
tb_pos-flag_err = flag_err.
tb_testata-zricavo = space.
tb_pos-flag_check = flag_check.
tb_pos-icon = icon.
modify tb_pos.
endloop.
if sy-subrc = 0.
*
sort gt_log by buzei type id .
*
delete adjacent duplicates from gt_log.
**
sort tb_fogli.
**
delete adjacent duplicates from tb_fogli.
*
perform alv_log.
else.
message s025(zcaa_wf).
endif.
endform.
" babi_check
*&---------------------------------------------------------------------*
*&
Form valorizza_strutture
*&---------------------------------------------------------------------*
form valorizza_strutture.
*

data: vn_valore type ztaa_fie113_wf_p-valore.


read table tb_ztaa_fie113_wf_z index 1.

clear: origindocreference, generalpostingdata,


retirementdata, accountassignments, furtherpostingdata,
documentreference, documentreference, return.
generalpostingdata-username = sy-uname.
generalpostingdata-doc_type = tb_ztaa_fie113_wf_z-blart.
generalpostingdata-doc_date = tb_testata-bldat.
generalpostingdata-pstng_date = tb_testata-budat.
* generalpostingdata-fis_period =
* generalpostingdata-trans_date
generalpostingdata-comp_code = tb_testata-bukrs.
generalpostingdata-assetmaino = tb_cespiti-anln1.
generalpostingdata-assetsubno = tb_cespiti-anln2.
generalpostingdata-assettrtyp = tb_ztaa_fie113_wf_z-bwasl.
clear vn_valore.
loop at tb_fogli where buzei = tb_pos-buzei.
clear ztaa_fie113_wf_c.
select single * from ztaa_fie113_wf_c where bukrs = tb_testata-bukrs
and id = tb_fogli-id_old
and gjahr = tb_fogli-gjahr_old
and anln1 = tb_cespiti-anln1
and anln2 = tb_cespiti-anln2.
if sy-subrc = 0.
*
retirementdata-perc_rate = tb_cespiti-prozs + tb_pos-prozs_old.
add ztaa_fie113_wf_c-valore_movimento to vn_valore .
endif.
endloop.
*

retirementdata-perc_rate = tb_cespiti-prozs.
retirementdata-amount = tb_cespiti-valore_movimento + vn_valore.

*
*
*
*
*
*
*

if retirementdata-perc_rate > 0.
clear vn_valore.
vn_valore = ( tb_cespiti-kansw * retirementdata-perc_rate ) / 100.
retirementdata-amount = retirementdata-amount + vn_valore.
clear retirementdata-perc_rate.
endif.

retirementdata-cmpl_ret =

retirementdata-rev_on_ret = tb_pos-zricavo.
*retirementdata-ret_costs =
retirementdata-currency = 'EUR'.
*retirementdata-currency_iso
* retirementdata-quantity = tb_pos-menge + tb_pos-menge_old .
* retirementdata-base_uom = tb_pos-meins.
* retirementdata-base_uom_iso
* retirementdata-perc_rate = tb_pos-prozs + tb_pos-prozs_old.
* retirementdata-rev_nbv_in
* retirementdata-area_nbv
retirementdata-valuedate = tb_testata-budat.
* retirementdata-trade_id
* tretirementdata-r_part_ba

furtherpostingdata-alloc_nmbr = 'Attribuzione'.
furtherpostingdata-header_txt = 'TESTO'.
*furtherpostingdata-REF_DOC_NO
*furtherpostingdata-ITEM_TEXT
endform.
" valorizza_strutture
*&---------------------------------------------------------------------*
*&
Form alv_log
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
form alv_log.
data: lt_fcat
type lvc_t_fcat,
ls_layo
type lvc_s_layo,
ls_vari
type disvariant,
ls_prnt
type lvc_s_prnt,
l_consistency_check type char1.
perform log_get_outtab.
perform log_set_grid_layo changing ls_layo.
perform log_set_grid_fcat changing lt_fcat.
if gr_container_log is initial.
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
create object gr_container_log
exporting container_name = 'G_LOG'.
*
ENDIF.
*

create object gr_grid_log


exporting i_parent = gr_container_log.
*

ls_prnt-grpchgedit = con_true.
create object gr_event_handler .
set handler gr_event_handler->handle_double_click_log
for gr_grid_log .
set handler gr_event_handler->handle_hotspot_click_log
for gr_grid_log.
call method gr_grid_log->set_table_for_first_display
exporting
i_bypassing_buffer = 'X'
is_layout
= ls_layo
changing
it_outtab
= gt_log[]
it_fieldcatalog
= lt_fcat.
else.
call method gr_grid_log->refresh_table_display.
endif.

endform.

" alv_log

*&---------------------------------------------------------------------*
*&
Form log_set_grid_layo
*&---------------------------------------------------------------------*
form log_set_grid_layo changing cs_layo type lvc_s_layo.
cs_layo-zebra
cs_layo-no_toolbar
* cs_layo-box_fname

= 'X'.
= 'X'.
= 'BOX'.

*... ALV-Control: Exceptions


* cs_layo-excp_fname = 'LIGHTS'.
endform.
" log_set_grid_layo
*&---------------------------------------------------------------------*
*&
Form log_set_grid_fcat
*&---------------------------------------------------------------------*
form log_set_grid_fcat changing ct_fcat type lvc_t_fcat.
data: cs_fcat type lvc_s_fcat.
refresh ct_fcat.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
*
i_buffer_active
= gs_test-buffer_active
i_structure_name
= 'ZSAA_FIE113_WF_LOG'
*
i_client_never_display = con_true
*
i_bypassing_buffer
= gs_test-bypassing_buffer
changing
ct_fieldcat
= ct_fcat[]
exceptions
inconsistent_interface = 1
program_error
= 2
others
= 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
loop at ct_fcat into cs_fcat.
case cs_fcat-fieldname.
when 'ICON'.
cs_fcat-hotspot = '1'.
modify ct_fcat from cs_fcat.
when 'ID'.
cs_fcat-no_out
modify ct_fcat
when 'ID_M'.
cs_fcat-no_out
modify ct_fcat
when 'NUMBER'.
cs_fcat-no_out
modify ct_fcat
*
*
*
*

= 'X'.
from cs_fcat.
= 'X'.
from cs_fcat.
= 'X'.
from cs_fcat.

when 'ANLN1'.
cs_fcat-no_out = 'X'.
modify ct_fcat from cs_fcat.
when 'ANLN2'.

*
*

cs_fcat-no_out = 'X'.
modify ct_fcat from cs_fcat.
endcase.
endloop.

endform.
" log_set_grid_fcat
*&---------------------------------------------------------------------*
*&
Form log_get_outtab
*&---------------------------------------------------------------------*
form log_get_outtab.
field-symbols: <ls_outtab> type g_ty_s_outtab.
data: l_excp_mod
l_excp_div
l_excp_amnt
l_excp

type
type
type
type

i,
i,
i value 4,
i.

loop at gt_log assigning <ls_outtab>.


if <ls_outtab>-type = 'E'.
<ls_outtab>-icon = '@0A@'.
elseif <ls_outtab>-type = 'W'.
<ls_outtab>-icon = '@09@'.
elseif <ls_outtab>-type = 'S'.
<ls_outtab>-icon = '@08@'.
else.
<ls_outtab>-icon = '@DH@'.
endif.
endloop.
endform.
" log_get_outtab
*&---------------------------------------------------------------------*
*&
Form refresh_alv_log
*&---------------------------------------------------------------------*
form refresh_alv_log.
if not gr_container_log is initial.
call method gr_grid_log->free.
call method gr_container_log->free.
*
CALL METHOD gr_container_log->flush.
clear: gr_grid_log, gr_container_log.
endif.
endform.
" refresh_alv_log
*&---------------------------------------------------------------------*
*&
Form handle_double_click
*&---------------------------------------------------------------------*
form handle_double_click using
e_row_id type lvc_s_row
e_column_id type lvc_s_col
es_row_no type lvc_s_roid.
data in type sy-subrc.
read table tb_cespiti index es_row_no-row_id.
set parameter id 'BUK' field tb_cespiti-bukrs.

set parameter id 'AN1' field tb_cespiti-anln1.


set parameter id 'AN2' field tb_cespiti-anln2.
if sy-subrc = 0.
call transaction 'AS03' and skip first screen .
endif.
endform.
" handle_double_click
*&---------------------------------------------------------------------*
*&
Form save
*&---------------------------------------------------------------------*
form save.
refresh tb_pos_save.
loop at tb_pos.
clear tb_pos_save.
move-corresponding tb_pos to tb_pos_save.
*
tb_pos_save = tb_pos.
append tb_pos_save.
endloop.
clear return.
call function 'ZUAA_FIE113_01_SAVE'
exporting
inserimento = 'X'
cambio_stato = space
tb_testata
= tb_testata
importing
return
= return
tables
tb_pos
= tb_pos_save
tb_cespiti
= tb_cespiti.
if return-type = 'S'.
message id return-id type return-type number return-number with
return-message_v1.
clear: tb_testata, wa_pos.
refresh: tb_pos, tb_cespiti, gt_log, tb_pos_save.
if not gr_container_log is initial.
call method gr_grid_log->free.
call method gr_container_log->free.
call method cl_gui_cfw=>flush.
clear: gr_grid_log, gr_container_log.
refresh gt_log.
endif.
if not g_custom_container is initial.
call method grid->free.
call method g_custom_container->free.
clear: grid, g_custom_container.
endif.
if not g_custom_container_4 is initial.
call method grid_4->free.
call method g_custom_container_4->free.
clear: grid_4, g_custom_container_4.
endif.
leave to screen 100.
else.

message id return-id type return-type number return-number with


return-message_v1.
* message e022(zcaa_wf).
endif.
endform.
" save
*&---------------------------------------------------------------------*
*&
Form old_fvi
*&---------------------------------------------------------------------*
form old_fvi.
* DATA: vn_prozs_old LIKE ztaa_fie113_wf_p-prozs,
*
vn_valore_old LIKE ztaa_fie113_wf_p-valore,
*
vn_menge_old LIKE ztaa_fie113_wf_p-menge,
*
vn_meins_old LIKE ztaa_fie113_wf_p-meins.
refresh tb_fogli.
*

*
*
*
*

loop at tb_pos.
CLEAR: vn_prozs_old, vn_valore_old, vn_menge_old, vn_meins_old.
refresh tb_pos_old.
select id gjahr prozs valore menge meins
into corresponding fields of table tb_pos_old
from ztaa_fie113_wf_p where bukrs = tb_pos-bukrs
and ord41 = tb_pos-ord41
and ord42 = tb_pos-ord42
and ord43 = tb_pos-ord43
and ord44 = tb_pos-ord44
and anlue = tb_pos-anlue
and gdlgrp = tb_pos-gdlgrp.
and eigkz = tb_pos-eigkz
and zujhr = tb_pos-zujhr.
clear: tb_pos-prozs_old, tb_pos-valore_old, tb_pos-menge_old.

loop at tb_pos_old.
* attenzione
select single zstato into ztaa_fie113_wf_t-zstato
from ztaa_fie113_wf_t where bukrs = tb_pos-bukrs
and id = tb_pos_old-id_old
and gjahr = tb_pos_old-gjahr_old.

*
*
*

*
*
*
*
*

if ztaa_fie113_wf_t-zstato ne 'AN1' or
ztaa_fie113_wf_t-zstato ne 'RF2' or
ztaa_fie113_wf_t-zstato ne 'RF3' or
ztaa_fie113_wf_t-zstato ne 'CO3'.
add tb_pos_old-prozs to tb_pos-prozs_old.
add tb_pos_old-valore to tb_pos-valore_old.
add tb_pos_old-menge to tb_pos-menge_old.
clear tb_fogli.
tb_fogli-buzei = tb_pos-buzei.
tb_fogli-id_old = tb_pos_old-id_old.
tb_fogli-gjahr_old = tb_pos_old-gjahr_old.
tb_fogli-buzei = tb_pos-buzei.
tb_fogli-prozs = tb_pos_old-prozs.
tb_fogli-valore = tb_pos_old-valore.
tb_fogli-menge = tb_pos_old-menge.
tb_fogli-meins = tb_pos_old-meins.
append tb_fogli.
endif.

endloop.
modify tb_pos.
endloop.
endform.
" old_fvi
*&---------------------------------------------------------------------*
*&
Form handle_data_changed
*&---------------------------------------------------------------------*
*FORM handle_data_changed USING er_data_changed
*
e_onf4
*
e_onf4_before
*
e_onf4_after.
*
* DATA: ls_good TYPE lvc_s_modi.
*
*
* LOOP AT er_data_changed->mt_good_cells INTO ls_good.
*
CASE ls_good-fieldname.
** check if column PLANETYPE of this row was changed
*
WHEN 'VALORE'.
*
CALL METHOD check_valore
*
EXPORTING
*
ps_good_planetype = ls_good
*
pr_data_changed
= er_data_changed.
*
** check if column SEATSOCC of this row was changed
*
WHEN 'SEATSOCC'.
**
call method check_seatsocc
**
exporting
**
ps_good
= ls_good
**
pr_data_changed = er_data_changed.
*
ENDCASE.
* ENDLOOP.
*
* IF error_in_data EQ 'X'.
*
CALL METHOD er_data_changed->display_protocol.
* ENDIF.
* .
*
*ENDFORM.
" handle_data_changed
*&---------------------------------------------------------------------*
*&
Form create_picture_control
*&---------------------------------------------------------------------*
form create_picture_control.
data: events type cntl_simple_events,
event type cntl_simple_event.
if g_picture_container is initial.
create object: g_picture_container
exporting container_name = 'PICTURE',
g_picture_control
exporting parent = g_picture_container.
event-eventid = cl_gui_picture=>eventid_picture_click.
event-appl_event = ' '.
"system event
append event to events.
event-eventid = cl_gui_picture=>eventid_picture_dblclick.
event-appl_event = ' '.
"system event
append event to events.
call method: g_picture_control->set_registered_events
exporting events = events.

*
*
*

set handler g_application->handle_picture_click


g_application->handle_picture_dblclick
for g_picture_control.
endif.

endform.
" create_picture_control
*&---------------------------------------------------------------------*
*&
Form fill_picture_control
*&---------------------------------------------------------------------*
form fill_picture_control.
data: url(255) type c,
alignment type i.
data query_table like w3query occurs 1 with header line.
* DATA html_table LIKE w3html OCCURS 0.
data begin of html_table occurs 0.
include structure w3html.
data: end of html_table.
data return_code like w3param-ret_code.
data content_type like w3param-cont_type.
data content_length like w3param-cont_len.
data pic_data like w3mime occurs 0.
data pic_size type i.
refresh query_table.
query_table-name = '_OBJECT_ID'.
query_table-value = 'ZAA_ZENITH_2009_SMALL'.
append query_table.

call function 'WWW_GET_MIME_OBJECT'


tables
query_string
= query_table
html
= html_table
mime
= pic_data
changing
return_code
= return_code
content_type
= content_type
content_length
= content_length
exceptions
object_not_found
= 1
parameter_not_found = 2
others
= 3.
call function 'DP_CREATE_URL'
exporting
type
= 'image'
subtype = cndp_sap_tab_unknown
size
= pic_size
lifetime = cndp_lifetime_transaction
tables
data
= pic_data
changing
url
= url
exceptions
others
= 1.

**
**
**
**
**
**
**
**
**
**

*
*
*
*
*

CALL FUNCTION 'DP_CREATE_URL'


EXPORTING
type
= 'IMAGE'
subtype = 'GIF'
TABLES
data
= pict_tab
CHANGING
url
= url
EXCEPTIONS
OTHERS = 4.
if sy-subrc ne 0.
clear pict_flag.
CALL METHOD g_docking_container->link
EXPORTING
repid = g_repid
dynnr = '0100'.
LEAVE TO SCREEN 100.
endif.
alignment = cl_gui_control=>align_at_left
+
cl_gui_control=>align_at_right +
cl_gui_control=>align_at_top
+
cl_gui_control=>align_at_bottom.
call method g_picture_control->set_alignment
exporting alignment = alignment.

*
*
*
*
*
*

call method g_picture_control->load_picture_from_url


exporting url = url
exceptions others = 4.
if sy-subrc ne 0.
CLEAR pict_flag.
CALL METHOD g_docking_container->link
EXPORTING
repid = g_repid
dynnr = '0100'.
LEAVE TO SCREEN 100.
endif.

endform.
" fill_picture_control
*&---------------------------------------------------------------------*
*&
Form create_picture_control_logo
*&---------------------------------------------------------------------*
form create_picture_control_logo.
data: events type cntl_simple_events,
event type cntl_simple_event.
if g_picture_container_logo is initial.
create object: g_picture_container_logo
exporting container_name = 'G_LOGO',
g_picture_control_logo
exporting parent = g_picture_container_logo.
event-eventid = cl_gui_picture=>eventid_picture_click.
event-appl_event = ' '.
"system event
append event to events.
event-eventid = cl_gui_picture=>eventid_picture_dblclick.
event-appl_event = ' '.
"system event
append event to events.
call method: g_picture_control_logo->set_registered_events

exporting events = events.


endif.
endform.
" create_picture_control_logo
*&---------------------------------------------------------------------*
*&
Form fill_picture_control_logo
*&---------------------------------------------------------------------*
form fill_picture_control_logo.
data: url(255) type c,
alignment type i.
data query_table like w3query occurs 1 with header line.
* DATA html_table LIKE w3html OCCURS 0.
data begin of html_table occurs 0.
include structure w3html.
data: end of html_table.
data return_code like w3param-ret_code.
data content_type like w3param-cont_type.
data content_length like w3param-cont_len.
data pic_data like w3mime occurs 0.
data pic_size type i.
refresh query_table.
query_table-name = '_OBJECT_ID'.
query_table-value = 'ZAA_ZENITH_LOGO'.
append query_table.

call function 'WWW_GET_MIME_OBJECT'


tables
query_string
= query_table
html
= html_table
mime
= pic_data
changing
return_code
= return_code
content_type
= content_type
content_length
= content_length
exceptions
object_not_found
= 1
parameter_not_found = 2
others
= 3.
call function 'DP_CREATE_URL'
exporting
type
= 'image'
subtype = cndp_sap_tab_unknown
size
= pic_size
lifetime = cndp_lifetime_transaction
tables
data
= pic_data
changing
url
= url
exceptions
others
= 1.
**
**
**
**

CALL FUNCTION 'DP_CREATE_URL'


EXPORTING
type
= 'IMAGE'
subtype = 'GIF'

**
**
**
**
**
**

*
*
*
*
*

TABLES
data
CHANGING
url
EXCEPTIONS
OTHERS

= pict_tab
= url
= 4.

if sy-subrc ne 0.
clear pict_flag.
CALL METHOD g_docking_container->link
EXPORTING
repid = g_repid
dynnr = '0100'.
LEAVE TO SCREEN 100.
endif.
alignment = cl_gui_control=>align_at_left
+
cl_gui_control=>align_at_right +
cl_gui_control=>align_at_top
+
cl_gui_control=>align_at_bottom.
call method g_picture_control_logo->set_alignment
exporting alignment = alignment.

*
*
*
*
*
*

call method g_picture_control_logo->load_picture_from_url


exporting url = url
exceptions others = 4.
if sy-subrc ne 0.
CLEAR pict_flag.
CALL METHOD g_docking_container->link
EXPORTING
repid = g_repid
dynnr = '0100'.
LEAVE TO SCREEN 100.
endif.

endform.
" fill_picture_control_logo
*&---------------------------------------------------------------------*
*&
Module ordxx_text_lesen_a OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module ordxx_text_lesen_a output.
data: l_ord4x
l_ordtx
l_ordnr

like anla-ord41,
like ra01m-ordtx_1,
like t087-ordnr.

*
do 4 times
varying l_ord4x from wa_pos-ord41_a
next wa_pos-ord42_a
varying l_ordtx from ra01m-ordtx_1 next ra01m-ordtx_2.
*
Wenn Initial - text space setzen
if l_ord4x is initial.
l_ordtx
= space.
else.
unpack sy-index to l_ordnr.
perform ordxx_text using l_ordtx l_ord4x l_ordnr.
endif.

enddo.
endmodule.
" ordxx_text_lesen_a OUTPUT
*&---------------------------------------------------------------------*
*&
Form kostl_lesen
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
-->P_ANLZ_KOSTL text
*
-->P_WA_POS_GSBER text
*
-->P_ENDMODULE text
*----------------------------------------------------------------------*
form kostl_lesen using u_kostl u_gsber.
data: l_kokrs
con_bdatu

like tka01-kokrs,
type d value '99991231'.

data: l_datum
like anlz-bdatu.
data: ld_message(1)
type c.
"<<< ins # 216603
call function 'RK_KOKRS_FIND'
exporting
bukrs
= tb_testata-bukrs
gsber
= u_gsber
importing
kokrs
= l_kokrs
exceptions
insufficient_input = 01.
*
if sy-subrc ne 0.
message e199(aa) with tb_testata-bukrs u_gsber.
endif.
*
*
Kostenstellentext lesen
* <<<<<<<<<< Begin of insertion note # 216603 >>>>>>>>>>
* If message handler is active, deactivate message handler before
* call of 'RK_KOSTL_READ'
call function 'MESSAGES_ACTIVE'
exceptions
not_active = 1.
if sy-subrc = 0.
ld_message = 'X'.
call function 'MESSAGES_STOP'
exceptions
a_message = 1
e_message = 2
i_message = 3
w_message = 4
others
= 5.
if sy-subrc <> 0.
* For TODO
endif.
endif.
* <<<<<<<<<< End of insertion note # 216603 >>>>>>>>>>
* <<<<<<<<<< Begin of insertion note # 315716 >>>>>>>>>>
*
Wenn Tagesdatum im Intervall, dann lese mit Tagesdatum
* IF sy-datlo GE tb_testata-bldat AND sy-datlo LE tb_testata-bldat.
*
l_datum = sy-datlo.
* ELSE.
**
Jetzt mit bdatu < 31.12.9999 oder adatu lesen
">>> ins # 337109
*
IF tb_testata-bldat NE con_bdatu.
*
l_datum = xanlz-bdatu.
">>> ins # 337109

*
*
*
*

ELSE.
l_datum = xanlz-adatu.
ENDIF.
ENDIF.

">>> ins # 337109


">>> ins # 337109
">>> ins # 337109

l_datum = tb_testata-bldat.
call function 'RK_KOSTL_READ'
exporting
datum
= l_datum
kokrs
= l_kokrs
kostl
= u_kostl
kosts
= 'X'
nurex
= space
spras
= sy-langu
importing
ktext
= cskt-ktext
exceptions
error_message = 98
others
= 99.
*
if sy-subrc ne 0.
Jetzt mit Adatu lesen
">>> ins # 337109
l_datum = tb_testata-budat.
* <<<<<<<<<< End of insertion note # 315716 >>>>>>>>>>
call function 'RK_KOSTL_READ'
exporting
datum
= l_datum
kokrs
= l_kokrs
kostl
= u_kostl
kosts
= 'X'
nurex
= space
spras
= sy-langu
importing
ktext
= cskt-ktext
exceptions
error_message = 98
others
= 99.
*
if sy-subrc ne 0.
if l_datum ne sy-datlo.
l_datum = sy-datlo.
*
Jetzt nochmal mit Tagesdatum falls Kostenstelle reorganisiert o..
call function 'RK_KOSTL_READ'
exporting
datum
= l_datum
kokrs
= l_kokrs
kostl
= u_kostl
kosts
= 'X'
nurex
= 'X'
spras
= sy-langu
importing
ktext
= cskt-ktext
exceptions
error_message = 98
others
= 99.
*
if sy-subrc ne 0.
cskt-ktext = text-008.
endif.
else.
*

cskt-ktext = text-008.
endif.
" >>> insert note # 315716
endif.
endif.
* <<<<<<<<<< Begin of insertion note # 216603 >>>>>>>>>>
* If message handler was active, reactivate message handler
if ld_message = 'X'.
call function 'MESSAGES_INITIALIZE'
exporting
reset = space.
endif.
* <<<<<<<<<< End of insertion note # 216603 >>>>>>>>>>
endform.
" kostl_lesen
*&---------------------------------------------------------------------*
*&
Form bbs_call_direct
*&---------------------------------------------------------------------*
form bbs_call_direct.
data: lt_sel
like rstisel
occurs 0 with header line,
lt_fields like rstifields occurs 0 with header line.
data: ld_rec like rstirec.
data: ld_kokrs like csks-kokrs.
check not wa_pos-kostl_a is initial.
perform bbs_fields_val_fill tables lt_fields lt_sel
using 'KOSTL'
'KOSTL'
'KOSTL'
wa_pos-kostl_a.
perform empfaenger_fuellen using 'KS03' ld_rec.
perform bbs_fields_val_fill tables lt_fields lt_sel
using 'BUKRS' 'BUKRS'
'BUKRS'
tb_testata-bukrs.
* Kostenrechnungskreis setzen.
perform kokrs_setzen using tb_testata-bukrs ld_kokrs.
perform bbs_fields_val_fill tables lt_fields lt_sel
using 'KOKRS' 'KOKRS'
'KOKRS'
ld_kokrs.
set parameter id 'CAC' field ld_kokrs.
check not lt_fields[] is initial.
* Aufruf der BBS-Schnittstelle
call function 'FIAA_BBS_TRANSACTION_CALL'
exporting
i_rec
= ld_rec
*
I_TCODE = SY-TCODE
tables
t_sel
= lt_sel
t_fields = lt_fields
exceptions
others
= 0.
endform.
" bbs_call_direct
*&---------------------------------------------------------------------*
*&
Form bbs_fields_val_fill
*&---------------------------------------------------------------------*
*
text

*----------------------------------------------------------------------*
*
-->P_LT_FIELDS text
*
-->P_LT_SEL text
*
-->P_4327
text
*
-->P_4328
text
*
-->P_4329
text
*
-->P_WA_POS_KOSTL text
*----------------------------------------------------------------------*
form bbs_fields_val_fill tables ut_fields structure rstifields
ut_sel
structure rstisel
using value(u_fieldname)
value(u_rollname)
value(u_domname)
value(u_value).
* Fllen der Feldinformationen
ut_fields-field
= u_fieldname.
ut_fields-rollname = u_rollname.
ut_fields-domname = u_domname.
append ut_fields.
* Fllen des Feldinhalts
ut_sel-sign = 'I'.
ut_sel-option = 'EQ'.
ut_sel-field = u_fieldname.
ut_sel-low =
u_value.
append ut_sel.
endform.
" bbs_fields_val_fill
*&---------------------------------------------------------------------*
*&
Form empfaenger_fuellen
*&---------------------------------------------------------------------*
form empfaenger_fuellen using
value(u_tcode)
e_rec structure rstirec.
* Receiver-Applikation.
e_rec-rtool = 'TR'.
e_rec-ronam = u_tcode.
endform.
" empfaenger_fuellen
*&---------------------------------------------------------------------*
*&
Form kokrs_setzen
*&---------------------------------------------------------------------*
form kokrs_setzen using value(u_bukrs)
changing e_kokrs.
* Zustzlich Kostenrechnungskreis setzen.
call function 'RK_KOKRS_FIND'
exporting
bukrs = tb_testata-bukrs
importing
kokrs = e_kokrs
exceptions
others = 1.
endform.
" kokrs_setzen
*&---------------------------------------------------------------------*
*&
Form handle_double_click_log
*&---------------------------------------------------------------------*
form handle_double_click_log using
e_row_id type lvc_s_row
e_column_id type lvc_s_col
es_row_no type lvc_s_roid.

data: in type sy-subrc,


va_buzei type buzei.
read table gt_log into gs_log index es_row_no-row_id.
if sy-subrc = 0.
sort tb_fogli by buzei id_old bldat buzei_old.
va_buzei = gs_log-buzei.
refresh tb_fogli_view.
loop at tb_fogli where buzei = va_buzei.
clear: tb_fogli_view, tb_fogli-menge, tb_fogli-meins.
tb_fogli_view = tb_fogli.
collect tb_fogli_view.
endloop.
loop at tb_fogli where buzei = va_buzei.
loop at tb_fogli_view where buzei = tb_fogli-buzei
and id_old = tb_fogli-id_old
and buzei_old = tb_fogli-buzei_old.
if not tb_fogli-menge is initial.
tb_fogli_view-menge = tb_fogli-menge.
tb_fogli_view-meins = tb_fogli-meins.
modify tb_fogli_view .
endif.
endloop.
endloop.
if not tb_fogli_view[] is initial.
call screen 450 starting at 5 5.
endif.
endif.
endform.
" handle_double_click_log
*&---------------------------------------------------------------------*
*&
Form fieldacat_popup
*&---------------------------------------------------------------------*
form fieldacat_popup.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'ZSAA_FIE113_WF_VIEW'
changing
ct_fieldcat
= gt_fieldcat_lvc_popup[].
loop at gt_fieldcat_lvc_popup .
case gt_fieldcat_lvc_popup-fieldname.
when 'ID'.
gt_fieldcat_lvc_popup-no_out = 'X'.
modify gt_fieldcat_lvc_popup.
when 'VALORE'.
gt_fieldcat_lvc_popup-do_sum = '1'.
modify gt_fieldcat_lvc_popup.
when 'PROZS'.
gt_fieldcat_lvc_popup-do_sum = '1'.
modify gt_fieldcat_lvc_popup.
when 'MENGE'.
gt_fieldcat_lvc_popup-do_sum = '1'.
modify gt_fieldcat_lvc_popup.
endcase.
endloop.

endform.
" fieldacat_popup
*&---------------------------------------------------------------------*
*&
Form hotspot_click_log
*&---------------------------------------------------------------------*
form hotspot_click_log using
e_row_id type lvc_s_row
e_column_id type lvc_s_col
es_row_no type lvc_s_roid.
data: in type sy-subrc,
va_buzei type buzei.
read table gt_log into gs_log index es_row_no-row_id.

if sy-subrc = 0.
sort tb_fogli by buzei id_old bldat buzei_old.
va_buzei = gs_log-buzei.
refresh tb_fogli_view.
loop at tb_fogli where buzei = va_buzei.
clear: tb_fogli_view, tb_fogli-menge, tb_fogli-meins.
tb_fogli_view = tb_fogli.
collect tb_fogli_view.
endloop.
loop at tb_fogli where buzei = va_buzei.
loop at tb_fogli_view where buzei = tb_fogli-buzei
and id_old = tb_fogli-id_old
and buzei_old = tb_fogli-buzei_old.
if not tb_fogli-menge is initial.
tb_fogli_view-menge = tb_fogli-menge.
tb_fogli_view-meins = tb_fogli-meins.
modify tb_fogli_view .
endif.
endloop.
endloop.
if not tb_fogli_view[] is initial.
call screen 450 starting at 5 5.
endif.
endif.
endform.
" hotspot_click_log
*&---------------------------------------------------------------------*
*&
Form umwkz_text_lesen
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
form umwkz_text_lesen.
data: ld_t087k like t087k.
*
clear t087l.
check not wa_pos-umwkz_a is initial.
ld_t087k-umwkz = wa_pos-umwkz_a.
call function 'T087K_READ'
importing
e_t087l
= t087l
changing

f_t087k
exceptions
not_found
no_entries
others

= ld_t087k
= 1
= 2
= 3.

if sy-subrc > 0.
t087l-txt50 = text-008.
endif.
*
endform.
" umwkz_text_lesen
*&---------------------------------------------------------------------*
*&
Form fill_celltab
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
-->P_1251
text
*
<--P_LT_CELLTAB text
*----------------------------------------------------------------------*
form fill_celltab using value(p_mode)
campo
changing pt_celltab type lvc_t_styl.
data: ls_celltab type lvc_s_styl,
l_mode type raw4.
* This forms sets the style of column 'PRICE' editable
* according to 'p_mode' and the rest to read only either way.
*** if p_mode eq 'RW'.
****2a.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell
****
to status "editable".
***
l_mode = cl_gui_alv_grid=>mc_style_enabled.
*** else. "p_mode eq 'RO'
****2b.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_DISABLED to set a cell
****
to status "non-editable".
***
l_mode = cl_gui_alv_grid=>mc_style_disabled.
*** endif.
***** PEr dismissioni automatismo percentuale
if tb_testata-ztipo = 'DI'.
select single * from ztaa_fie113_wf_u where bukrs = tb_testata-bukrs
and gjahr = va_gjahr
and monat = tb_testata-bldat+4(2)
and ord41 = tb_pos-ord41
and ord42 = tb_pos-ord42
and ord43 = tb_pos-ord43
and ord44 = tb_pos-ord44
and gdlgrp = tb_pos-gdlgrp.
if sy-subrc = 0.
ls_celltab-fieldname = 'PROZS'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
insert ls_celltab into table pt_celltab.
ls_celltab-fieldname = 'MENGE'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
insert ls_celltab into table pt_celltab.
ls_celltab-fieldname = 'VALORE'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
insert ls_celltab into table pt_celltab.
ls_celltab-fieldname = 'MEINS'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
insert ls_celltab into table pt_celltab.

exit.
endif.
endif.
if tb_pos-valore > 0.
if tb_pos-menge > 0.
ls_celltab-fieldname = 'VALORE'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
insert ls_celltab into table pt_celltab.
else.
ls_celltab-fieldname = 'VALORE'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
insert ls_celltab into table pt_celltab.
ls_celltab-fieldname = 'MENGE'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled..
insert ls_celltab into table pt_celltab.
endif.
ls_celltab-fieldname = 'PROZS'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
insert ls_celltab into table pt_celltab.
endif.
if tb_pos-prozs > 0.
ls_celltab-fieldname = 'PROZS'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
insert ls_celltab into table pt_celltab.
ls_celltab-fieldname = 'MENGE'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled..
insert ls_celltab into table pt_celltab.
ls_celltab-fieldname = 'VALORE'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
insert ls_celltab into table pt_celltab.
endif.
if tb_pos-menge > 0.
ls_celltab-fieldname = 'MENGE'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
insert ls_celltab into table pt_celltab.
*
ls_celltab-fieldname = 'VALORE'.
*
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
*
insert ls_celltab into table pt_celltab.
ls_celltab-fieldname = 'PROZS'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
insert ls_celltab into table pt_celltab.
endif.

endform.
" fill_celltab
*&---------------------------------------------------------------------*
*&
Form aggiorna_posizione
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
form aggiorna_posizione.
data: va_flag_t4x,

*
*

va_flag_48.
refresh tb_pos_check.
tb_pos_check[] = tb_pos[].

loop at tb_pos.
**** calcolo valore medio
if not tb_pos-menge is initial.
clear: tb_pos-valore, valore_medio.
call function 'ZUAA_FIE113_01'
exporting
bukrs
= tb_testata-bukrs
gjahr
= va_gjahr
ord41
= tb_pos-ord41
ord42
= tb_pos-ord42
ord43
= tb_pos-ord43
ord44
= tb_pos-ord44
gdlgrp
= tb_pos-gdlgrp
meins
= tb_pos-meins
importing
valore_medio = valore_medio
exceptions
ecc_quant
= 1
ecc_val_med = 2
others
= 3.
if sy-subrc <> 0.
case sy-subrc.
when 1.
message e034(zcaa_wf) with tb_pos-meins.
when 2.
message e033(zcaa_wf).
endcase.
endif.
tb_pos-valore = tb_pos-menge * valore_medio.
modify tb_pos.
endif.
endloop.
endform.
" aggiorna_posizione
*&---------------------------------------------------------------------*
*&
Form invio_a
*&---------------------------------------------------------------------*
form invio_a.
loop at screen.
if screen-name = 'WA_POS-EIGKZ_A'.
*
or screen-name = 'WA_POS-ANLUE_A'.
*
screen-input = 0.
modify screen.
endif.
endloop.
****** Controllo 61
if wa_pos-ord41 = '61' and va_flag_61 is initial.
clear ztaa_fie113_wf_v.
select single * from ztaa_fie113_wf_v where bukrs = tb_testata-bukrs
and gjahr = va_gjahr
and ord41 = wa_pos-ord41
and ord42 = wa_pos-ord42
and ord43 = wa_pos-ord43
and ord44 = wa_pos-ord44.

if ztaa_fie113_wf_v-meins = 'VAL'.
va_flag_61 = 'X'.
call function 'POPUP_TO_DISPLAY_TEXT'
exporting
titel
= 'Controllo per tipologia 61'
textline1
= 'ATTENZIONE Per Tipologia 61, accettarsi'
textline2 = 'di avere inserito il valore nel campo Quantita'''
start_column = 25
start_row
= 6.
endif.
endif.
*** popup CI
if not wa_pos-zflag_ci is initial and va_flag_ci is initial.
va_flag_ci = 'X'.
call function 'POPUP_TO_DISPLAY_TEXT'
exporting
titel
= 'Includere "CI" Costi incrementativi'
textline1
= 'ATTENZIONE hai selezionato il FLAG "CI"'
textline2
= 'Saranno inclusi i costi incrementativi'
start_column = 25
start_row
= 6.
endif.
*

if tb_testata-ztipo = 'DI'.
if not
not
not
not

wa_pos-ord41_a
wa_pos-ord42_a
wa_pos-ord43_a
wa_pos-ord44_a

is
is
is
is

initial or
initial or
initial or
initial.

select single * from ztaa_fie113_wf_n where bukrs =


and ord41
and ord42
and ord43
and ord44
if sy-subrc = 0.
loop at screen.
if screen-name = 'WA_POS-EIGKZ_A'.
screen-input = 0.
screen-required = 1.
if not wa_pos-anlue_a is initial.
wa_pos-eigkz_a = 'T'.
screen-input = 0.
endif.
modify screen.
endif.
if screen-name = 'WA_POS-ANLUE_A'.
screen-input = 1.
screen-required = 0.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = 'WA_POS-EIGKZ_A'.
or screen-name = 'WA_POS-ANLUE_A'.
screen-input = 0.
screen-required = 0.
modify screen.

tb_testata-bukrs
= wa_pos-ord41_a
= wa_pos-ord42_a
= wa_pos-ord43_a
= wa_pos-ord44_a.

clear: wa_pos-eigkz_a.
endif.
endloop.
endif.
else.
loop at screen.
if screen-name = 'WA_POS-EIGKZ_A'
or screen-name = 'WA_POS-ANLUE_A'.
screen-input = 1.
modify screen.
endif.
endloop.
endif.
if not wa_pos-zflag is initial.
loop at screen.
if screen-name = 'WA_POS-ORD44_A'.
screen-input = 1.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = 'WA_POS-ORD44_A'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
if wa_pos-ord41_a = '44'.
loop at screen.
if screen-name = 'WA_POS-ORD44_A'.
screen-input = 1.
screen-required = 1.
modify screen.
endif.
endloop.
endif.
endform.
" invio_a
*&---------------------------------------------------------------------*
*&
Form invio_da
*&---------------------------------------------------------------------*
form invio_da.
****** Controllo 61
if wa_pos-ord41 = '61' and va_flag_61 is initial.
clear ztaa_fie113_wf_v.
select single * from ztaa_fie113_wf_v where bukrs = tb_testata-bukrs
and gjahr = va_gjahr
and ord41 = wa_pos-ord41
and ord42 = wa_pos-ord42
and ord43 = wa_pos-ord43
and ord44 = wa_pos-ord44.
if ztaa_fie113_wf_v-meins = 'VAL'.
va_flag_61 = 'X'.
call function 'POPUP_TO_DISPLAY_TEXT'
exporting
titel
= 'Controllo per tipologia 61'

textline1
= 'ATTENZIONE Per Tipologia 61, accettarsi'
textline2 = 'di avere inserito il valore nel campo Quantita'''
start_column = 25
start_row
= 6.
endif.
endif.
*** popup CI
if not wa_pos-zflag_ci is initial and va_flag_ci is initial.
va_flag_ci = 'X'.
call function 'POPUP_TO_DISPLAY_TEXT'
exporting
titel
= 'Includere "CI" Costi incrementativi'
textline1
= 'ATTENZIONE hai selezionato il FLAG "CI"'
textline2
= 'Saranno inclusi i costi incrementativi'
start_column = 25
start_row
= 6.
endif.
loop at screen.
if screen-name = 'WA_POS-EIGKZ'.
*
or screen-name = 'WA_POS-ANLUE'.
screen-input = 0.
modify screen.
endif.
endloop.
*

if tb_testata-ztipo = 'DI'.
if not wa_pos-ord41 is initial or
not wa_pos-ord42 is initial or
not wa_pos-ord43 is initial.

select single * from ztaa_fie113_wf_n where bukrs = tb_testata-bukrs


and ord41 = wa_pos-ord41
and ord42 = wa_pos-ord42
and ord43 = wa_pos-ord43
and ord44 = wa_pos-ord44.
if sy-subrc = 0.
loop at screen.
if screen-name = 'WA_POS-EIGKZ'.
screen-input = 0.
screen-required = 1.
if not wa_pos-anlue is initial.
wa_pos-eigkz = 'T'.
screen-input = 0.
endif.
modify screen.
endif.
if screen-name = 'WA_POS-ANLUE'.
screen-input = 1.
screen-required = 0.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = 'WA_POS-EIGKZ'.

or screen-name = 'WA_POS-ANLUE'.
screen-input = 0.
screen-required = 0.
modify screen.
clear: wa_pos-eigkz.
endif.
endloop.
endif.
else.
if screen-name = 'WA_POS-EIGKZ'
or screen-name = 'WA_POS-ANLUE'.
screen-input = 1.
modify screen.
endif.
endif.
* endif.
if wa_pos-ord41 = '44'.
if tb_testata-zzrespbudg+2(2) = 'SR' or
tb_testata-zzrespbudg+2(2) = 'ER'.
loop at screen.
if screen-name = 'WA_POS-ORD44'.
screen-input = 1.
screen-required = 1.
modify screen.
endif.
endloop.
endif.
endif.
endform.

" invio_da

Z1AA_FIE113_01_MOD
*----------------------------------------------------------------------*
*
INCLUDE Z1AA_FIE113_01_MOD
*
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&
Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module status_0100 output.
set pf-status 'FIE113_01_100'.
set titlebar 'FIE113_01_100_T'.
endmodule.
" STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*&
Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module user_command_0100 input.
clear okcode_2.
okcode_2 = okcode.
case okcode_2 .
when 'INVI'.
clear okcode.

when 'DETT'.
perform controlli_100.
if tb_testata-ztipo = 'DI'.
call screen 0200.
elseif tb_testata-ztipo = 'TR'.
call screen 0300.
endif.
when 'BACK'.
clear okcode.
leave program.
when 'EXIT'.
clear okcode.
leave program.
endcase.
endmodule.
" USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*&
Module USER_COMMAND_0200 INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module user_command_0200 input.
data: et_index_rows type lvc_t_row,
l_dynnr
like t082s-dynnr,
et_row_no type lvc_t_roid,
va_answer.
clear okcode_2.
okcode_2 = okcode.
case okcode_2 .
*

*
*
*
*
*
*

when 'INVI'.
CALL METHOD grid->refresh_table_display.
clear okcode.
perform controlli_invio.
when 'INS'.
if tb_testata-ztipo = 'DI'.
perform invio_da.
else.
perform invio_da.
perform invio_a.
endif.
perform controlli_200.
perform inserisci.
when 'SIMU'.
if not tb_pos[] is initial.
perform estrai_cespiti.
if not tb_cespiti[] is initial.
call screen 0400.
else.
message e015(zcaa_wf).
endif.
else.
message e026(zcaa_wf).
endif.

when 'SELZ'.
perform bbs_call_direct.
*

when 'BACK'.
CALL METHOD grid->free.
clear va_answer.
call function 'POPUP_TO_CONFIRM_STEP'
exporting
defaultoption = 'Y'
textline1
= 'Sei sicuro di uscire?'
textline2
= 'I dati non saranno salvati'
titel
= 'Salvataggio'
start_column
= 25
start_row
= 6
cancel_display = 'X'
importing
answer
= va_answer.
if va_answer = 'J'.
clear okcode.
set screen 0.
leave screen.
endif.

when 'EXIT'.
CALL METHOD grid->free.
clear okcode.
leave program.
endcase.

endmodule.

" USER_COMMAND_0200

INPUT

* OUTPUT MODULE FOR TABSTRIP 'STRIP_200': SETS ACTIVE TAB


module strip_200_active_tab_set output.
strip_200-activetab = g_strip_200-pressed_tab.
case g_strip_200-pressed_tab.
when c_strip_200-tab1.
g_strip_200-subscreen = '0201'.
when c_strip_200-tab2.
g_strip_200-subscreen = '0202'.
when others.
*
DO NOTHING
endcase.
endmodule.
* INPUT MODULE FOR TABSTRIP 'STRIP_200': GETS ACTIVE TAB
module strip_200_active_tab_get input.
okcode = sy-ucomm.
case okcode.
when c_strip_200-tab1.
g_strip_200-pressed_tab = c_strip_200-tab1.
when c_strip_200-tab2.
g_strip_200-pressed_tab = c_strip_200-tab2.
when others.
*
DO NOTHING
endcase.
endmodule.
*&---------------------------------------------------------------------*
*&
Module alv_grid OUTPUT

*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module alv_grid output.
va_gjahr = tb_testata-bldat(4).
perform aggiorna_posizione.
perform alv_grid.
endmodule.

" alv_grid

OUTPUT

*&---------------------------------------------------------------------*
*&
Module STATUS_0200 OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module status_0200 output.
set pf-status 'STATUS200'.
set titlebar 'TITLE200'.
endmodule.
" STATUS_0200 OUTPUT
*&---------------------------------------------------------------------*
*&
Module ord41_check INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module ord41_check input.
check not wa_pos-ord41 is initial.
call function 'AISC_CHECK_EVALUATION_GROUP'
exporting
i_ordnr = '1'
i_ord4x = wa_pos-ord41.

*
*
*
*
*
*

if wa_pos-ord41 ne '44'.
concatenate wa_pos-ord41 tb_testata-zzrespbudg+1(1)
into wa_pos-ord44.
else.
if tb_testata-zzrespbudg+2(2) = 'SR' or
tb_testata-zzrespbudg+2(2) = 'ER'.
loop at screen.
if screen-name = 'WA_POS-ORD44'.
screen-input = 1.
modify screen.
endif.
endloop.
else.
concatenate wa_pos-ord41 tb_testata-zzrespbudg+1(2)
into wa_pos-ord44.
endif.
endif.

endmodule.
" ord41_check INPUT
*&---------------------------------------------------------------------*
*&
Module ord42_check INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module ord42_check input.
check not wa_pos-ord42 is initial.

call function 'AISC_CHECK_EVALUATION_GROUP'


exporting
i_ordnr = '2'
i_ord4x = wa_pos-ord42.
endmodule.
" ord42_check INPUT
*&---------------------------------------------------------------------*
*&
Module ordxx_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module ordxx_text_lesen output.
perform ordxx_text_lesen.
endmodule.
" ordxx_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*&
Module invzweck_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module invzweck_text_lesen output.
*
*
*
*
*
*
*
*
*
*
**

clear t087j.
check not wa_pos-izwek

is initial.

select single * from t087j


where spras = sy-langu
and izwek = wa_pos-izwek.
if sy-subrc ne 0.
t087j-txt50 = text-001.
endif.

endmodule.
" invzweck_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*&
Module ord43_check INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module ord43_check input.
check not wa_pos-ord43 is initial.
call function 'AISC_CHECK_EVALUATION_GROUP'
exporting
i_ordnr = '3'
i_ord4x = wa_pos-ord43.
endmodule.
" ord43_check INPUT
*&---------------------------------------------------------------------*
*&
Module ord44_check INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module ord44_check input.
check not wa_pos-ord44 is initial.
call function 'AISC_CHECK_EVALUATION_GROUP'
exporting
i_ordnr = '4'
i_ord4x = wa_pos-ord44.

endmodule.
" ord44_check INPUT
*&---------------------------------------------------------------------*
*&
Module gdlgrp_check INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module gdlgrp_check input.
check not wa_pos-gdlgrp is initial.
call function 'AISC_CHECK_EVALUATION_GROUP'
exporting
i_ordnr = '5'
i_gdlgrp = wa_pos-gdlgrp.
endmodule.
" gdlgrp_check INPUT
*&---------------------------------------------------------------------*
*&
Module anlue_check INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module anlue_check input.
check not wa_pos-anlue is initial.
perform anlue_check.
endmodule.
" anlue_check INPUT
*&---------------------------------------------------------------------*
*&
Module testo OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module testo output.
* data documento esercizio
* tb_testata-budat = sy-datum.
* va_gjahr = sy-datum(4).
* concatenate sy-datum+6(2) '.' sy-datum+4(2) '.' sy-datum(4) into
*va_budat.
tb_testata-budat = tb_testata-bldat.
va_gjahr = tb_testata-bldat(4).
concatenate tb_testata-bldat+6(2) '.' tb_testata-bldat+4(2) '.'
tb_testata-bldat(4) into va_budat.
va_uname = sy-uname.
if not tb_testata-ztipo is initial.
loop at screen.
if screen-name = 'TB_TESTATA-ZTIPO'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
endmodule.

" testo

OUTPUT

*&---------------------------------------------------------------------*
*&
Module anlue_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*
text

*----------------------------------------------------------------------*
module anlue_text_lesen output.
perform anlue_text_lesen.
endmodule.
" anlue_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*&
Module gdlgrp_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module gdlgrp_text_lesen output.
perform gdlgrp_text_lesen.
endmodule.
" gdlgrp_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*&
Module zzrespbudg_check INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module zzrespbudg_check input.
*Unit Richiedente
data e_zzrespbudg(4).
select single zzdescr into va_unita from ztpsrespbudg
where zzrespbudg = tb_testata-zzrespbudg.
if sy-subrc ne 0.
e_zzrespbudg = tb_testata-zzrespbudg.
clear tb_testata-zzrespbudg.
message e009(zcaa_wf) with e_zzrespbudg .
endif.
authority-check object 'I_INGRP'
id 'TCD'
field
sy-tcode
*
ID 'IWERK' FIELD
dummy
id 'INGRP' field tb_testata-zzrespbudg+1(3).
if sy-subrc <> 0.
message e035(zcaa_wf) with sy-uname tb_testata-zzrespbudg.
endif.
endmodule.

" zzrespbudg_check

INPUT

*&---------------------------------------------------------------------*
*&
Module eigkz_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module eigkz_text_lesen output.
if wa_pos-eigkz is initial.
t097t-eigtx = space.
else.
select single * from t097t where eigkz = wa_pos-eigkz and
spras = sy-langu.
if sy-subrc
= 0.
t097t-eigtx
= t097t-eigtx.
else.
t097t-eigtx = text-008.
endif.

*
endif.
endmodule.
" eigkz_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*&
Module menge_pruefen INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module menge_pruefen.
*
*

check g_trtyp <> con_anzei.


perform menge_pruefen.

endmodule.
" menge_pruefen INPUT
*&---------------------------------------------------------------------*
*&
Module meins_pruefen INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module meins_pruefen.
perform meins_pruefen using wa_pos-meins.
perform menge_meins_pruefen using wa_pos-meins wa_pos-menge.
endmodule.
" meins_pruefen INPUT
*&---------------------------------------------------------------------*
*&
Module help_meins INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module help_meins input.
perform help_meins_kaufm using wa_pos-meins.
endmodule.
" help_meins INPUT
*&---------------------------------------------------------------------*
*&
Module STATUS_0400 OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module status_0400 output.
set pf-status 'STATUS400'.
set titlebar 'TITLE400'.
endmodule.
" STATUS_0400 OUTPUT
*&---------------------------------------------------------------------*
*&
Module alv_grid_400 OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module alv_grid_400 output.
perform alv_log.
*
*
*
*

data it_sort type lvc_t_sort.


data is_sort type lvc_s_sort.
refresh it_sort.

*
* is_sort-fieldname = 'BUZEI'.
* is_sort-up = 'X'.
* is_sort-subtot = 'X'.
* append is_sort to it_sort.
*
*
* perform fieldacat_400.
* perform escludi.
*
** PERFORM refresh_alv_log.
*
** loop at tb_cespiti.
**
read table tb_pos with key bukrs = tb_cespiti-bukrs
**
buzei = tb_cespiti-buzei.
**
**
if sy-subrc ne 0.
**
delete tb_cespiti.
**
endif.
** endloop.
* sort tb_cespiti by bukrs buzei anln1 anln2 zujhr.
* delete adjacent duplicates from tb_cespiti.
* if g_custom_container_4 is initial.
*
create object g_custom_container_4
*
exporting container_name = g_container_4.
*
create object grid_4
*
exporting i_parent = g_custom_container_4.
*
** make the ALV Grid Control editable and optimize the width of the
*colum
*
gs_layout_4-edit = ' '.
*
gs_layout_4-cwidth_opt = 'X'.
*
gs_layout_4-zebra = 'X'.
*
*
*
create object gr_event_handler .
*
set handler gr_event_handler->handle_double_click for grid_4 .
*
set handler gr_event_handler->handle_hotspot_click for grid_4 .
*
*
*
** set table for first display
*
call method grid_4->set_table_for_first_display
*
exporting
*
it_toolbar_excluding = it_tooolbar_excluding
*
i_structure_name = 'ZSAA_FIE113_WF_CESPITI'
*
is_layout
= gs_layout_4
*
changing
*
it_sort
= it_sort[]
*
it_outtab
= tb_cespiti[]
*
it_fieldcatalog = gt_fieldcat_lvc_4[].
*
** make the ALV Grid Control ready for input
*
call method grid_4->set_ready_for_input
*
exporting
*
i_ready_for_input = 0.
* else.
*
call method grid_4->refresh_table_display.
*
* endif.
*

* call method cl_gui_control=>set_focus exporting control = grid_4.


*
*
endmodule.
" alv_grid_400 OUTPUT
*&---------------------------------------------------------------------*
*&
Module USER_COMMAND_0400 INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module user_command_0400 input.
clear okcode_2.
okcode_2 = okcode.
case okcode_2 .
*
*
*

when 'SIMU'.
perform old_fvi.
perform babi_check.
when 'SAVE'.
perform save.

when 'BACK'.
clear okcode.
if not gr_container_log is initial.
call method gr_grid_log->free.
call method gr_container_log->free.
call method gr_container_d0100->free.
call method cl_gui_cfw=>flush.
clear: gr_grid_log, gr_container_log.
refresh gt_log.
endif.
set screen 0.
leave screen.
when 'EXIT'.
if not gr_container_log is initial.
call method gr_grid_log->free.
call method gr_container_log->free.
call method cl_gui_cfw=>flush.
clear: gr_grid_log, gr_container_log.
refresh gt_log.
endif.
clear okcode.
leave program.
endcase.

endmodule.
" USER_COMMAND_0400 INPUT
*&---------------------------------------------------------------------*
*&
Module bukrs_check INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module bukrs_check input.

* Controlli Societ
data e_bukrs(4).
select single butxt into va_societa from t001 where
bukrs = tb_testata-bukrs.
if sy-subrc ne 0.
e_bukrs = tb_testata-bukrs.
clear tb_testata-bukrs.
message e002(zcaa_wf) with e_bukrs .
endif.
endmodule.
" bukrs_check INPUT
*&---------------------------------------------------------------------*
*&
Module ztipo_check INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module ztipo_check input.
* Controllo tipo operazione
data e_ztipo(2).
select single ddtext into va_tipo from dd07t
where domname = 'ZDAA_ZTIPO'
and ddlanguage = sy-langu
and domvalue_l = tb_testata-ztipo.
if sy-subrc ne 0.
e_ztipo = tb_testata-ztipo.
clear tb_testata-ztipo.
message e005(zcaa_wf) with e_ztipo .
endif.
endmodule.
" ztipo_check INPUT
*&---------------------------------------------------------------------*
*&
Module zmotivo_check INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module zmotivo_check input.
* Motivo operazione
data e_zmotivo(2).
select single zdescizione into va_motivo from ztaa_fie113_wf_z
where ztipo = tb_testata-ztipo
and zmotivo = tb_testata-zmotivo.
if sy-subrc ne 0.
e_zmotivo = tb_testata-zmotivo.
clear tb_testata-zmotivo.
message e007(zcaa_wf) with e_zmotivo .
endif.
if tb_testata-ztipo = 'DI'.
if tb_testata-zmotivo = 2.
if tb_testata-note is initial.
message w036(zcaa_wf).
endif.
endif.
endif.

endmodule.
" zmotivo_check INPUT
*&---------------------------------------------------------------------*
*&
Module picture OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module picture output.
perform create_picture_control.
perform fill_picture_control.
endmodule.
" picture OUTPUT
*&---------------------------------------------------------------------*
*&
Module logo OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module logo output.
perform create_picture_control_logo.
perform fill_picture_control_logo.
endmodule.
" logo OUTPUT
* OUTPUT MODULE FOR TABSTRIP 'TRASFERIMENTI': SETS ACTIVE TAB
module trasferimenti_active_tab_set output.
trasferimenti-activetab = g_trasferimenti-pressed_tab.
case g_trasferimenti-pressed_tab.
when c_trasferimenti-tab1.
g_trasferimenti-subscreen = '0301'.
when c_trasferimenti-tab2.
g_trasferimenti-subscreen = '0302'.
when c_trasferimenti-tab3.
g_trasferimenti-subscreen = '0303'.
when others.
*
DO NOTHING
endcase.
endmodule.
* INPUT MODULE FOR TABSTRIP 'TRASFERIMENTI': GETS ACTIVE TAB
module trasferimenti_active_tab_get input.
okcode = sy-ucomm.
case okcode.
when c_trasferimenti-tab1.
g_trasferimenti-pressed_tab = c_trasferimenti-tab1.
when c_trasferimenti-tab2.
g_trasferimenti-pressed_tab = c_trasferimenti-tab2.
when c_trasferimenti-tab3.
g_trasferimenti-pressed_tab = c_trasferimenti-tab3.
when others.
*
DO NOTHING
endcase.
endmodule.
*&---------------------------------------------------------------------*
*&
Module gdlgrp_text_lesen_a OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module gdlgrp_text_lesen_a output.
data: ld_t087s like t087s.
*
check not wa_pos-gdlgrp_a is initial.
ld_t087s-gdlgrp = wa_pos-gdlgrp_a.

call function 'T087G_READ'


changing
f_t087s
= ld_t087s
exceptions
not_found = 1
no_entries = 2
others
= 3.
case sy-subrc.
when 0.
t087s = ld_t087s.
when others.
t087s-gdlgrp_txt = text-008.
endcase.
endmodule.
" gdlgrp_text_lesen_a OUTPUT
*&---------------------------------------------------------------------*
*&
Module anlue_text_lesen_a OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module anlue_text_lesen_a output.
data: ld_t087v like t087v.
*
if not wa_pos-anlue_a is initial.
ld_t087v-anlue = wa_pos-anlue_a.
call function 'T087U_READ'
changing
f_t087v
= ld_t087v
exceptions
no_entries = 1
not_found = 2.
t087v-anlue_txt = text-008.
if sy-subrc = 0.
t087v-anlue_txt = ld_t087v-anlue_txt.
endif.
else.
t087v-anlue_txt = space.
endif.
endmodule.
" anlue_text_lesen_a OUTPUT
*&---------------------------------------------------------------------*
*&
Module eigkz_text_lesen_a OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module eigkz_text_lesen_a output.
if wa_pos-eigkz_a is initial.
t097t-eigtx = space.
else.
select single * from t097t where eigkz = wa_pos-eigkz_a and
spras = sy-langu.
if sy-subrc
= 0.
t097t-eigtx
= t097t-eigtx.
else.
t097t-eigtx = text-008.
endif.
*

endif.
endmodule.
" eigkz_text_lesen_a OUTPUT
*&---------------------------------------------------------------------*
*&
Module ord41_check_a INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module ord41_check_a input.
check not wa_pos-ord41_a is initial.
call function 'AISC_CHECK_EVALUATION_GROUP'
exporting
i_ordnr = '1'
i_ord4x = wa_pos-ord41_a.
if wa_pos-zflag is initial.
if wa_pos-ord41_a ne '44'.
concatenate wa_pos-ord41_a tb_testata-zzrespbudg+1(1)
into wa_pos-ord44_a.
else.
if tb_testata-zzrespbudg+2(2) = 'SR' or
tb_testata-zzrespbudg+2(2) = 'ER'.
loop at screen.
if screen-name = 'WA_POS-ORD44_A'.
screen-input = 1.
modify screen.
endif.
endloop.
else.
concatenate wa_pos-ord41_a tb_testata-zzrespbudg+1(2)
into wa_pos-ord44_a.
endif.
endif.
endif.
endmodule.
" ord41_check_a INPUT
*&---------------------------------------------------------------------*
*&
Module ord42_check_a INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module ord42_check_a input.
check not wa_pos-ord42_a is initial.
call function 'AISC_CHECK_EVALUATION_GROUP'
exporting
i_ordnr = '2'
i_ord4x = wa_pos-ord42_a.
endmodule.
" ord42_check_a INPUT
*&---------------------------------------------------------------------*
*&
Module ord43_check_a INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module ord43_check_a input.
check not wa_pos-ord43_a is initial.

call function 'AISC_CHECK_EVALUATION_GROUP'


exporting
i_ordnr = '3'
i_ord4x = wa_pos-ord43_a.
endmodule.
" ord43_check_a INPUT
*&---------------------------------------------------------------------*
*&
Module ord44_check_a INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module ord44_check_a input.
check not wa_pos-ord44_a is initial.
call function 'AISC_CHECK_EVALUATION_GROUP'
exporting
i_ordnr = '4'
i_ord4x = wa_pos-ord44_a.
endmodule.
" ord44_check_a INPUT
*&---------------------------------------------------------------------*
*&
Module gdlgrp_check_a INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module gdlgrp_check_a input.
check not wa_pos-gdlgrp_a is initial.
call function 'AISC_CHECK_EVALUATION_GROUP'
exporting
i_ordnr = '5'
i_gdlgrp = wa_pos-gdlgrp_a.
endmodule.
" gdlgrp_check_a INPUT
*&---------------------------------------------------------------------*
*&
Module anlue_check_a INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module anlue_check_a input.
check not wa_pos-anlue_a is initial.
* prfen der wirtschaftseinheit
data: ld_t087v_a like t087v.
*
check not wa_pos-anlue_a is initial.
ld_t087v_a-anlue = wa_pos-anlue_a.
call function 'T087U_READ'
changing
f_t087v
= ld_t087v_a
exceptions
no_entries = 1
not_found = 2.
if sy-subrc = 2.
message id sy-msgid
type 'E'
number sy-msgno
with
sy-msgv1
sy-msgv2
sy-msgv3
sy-msgv4.
endif.
endmodule.
" anlue_check_a INPUT
*&---------------------------------------------------------------------*

*&
Module gsber_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module gsber_text_lesen output.
if wa_pos-gsber_a is initial.
tgsbt-gtext = space.
else.
perform gsber_text using tgsbt-gtext wa_pos-gsber_a.
endif.
endmodule.
" gsber_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*&
Form gsber_text
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
-->P_TGSBT_GTEXT text
*
-->P_WA_POS_GSBER text
*----------------------------------------------------------------------*
form gsber_text using text gsber.
*
*local: *tgsbt.
*
Geschbereichstext lesen
select single * from tgsbt into tgsbt where gsber = gsber
and
spras = sy-langu.
if sy-subrc = 0.
text
= tgsbt-gtext.
else.
text
= text-001.
endif.
*
endform.
" gsber_text
*&---------------------------------------------------------------------*
*&
Module kostl_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module kostl_text_lesen output.
*
*

Bei Anzeige keine Verarb.


Keine Kostenstelle -> keine Pruef
if wa_pos-kostl_a is initial.
cskt-ktext = space.
exit.
endif.

Aufruf Leseroutine
perform kostl_lesen
using wa_pos-kostl_a wa_pos-gsber_a.
endmodule.
" kostl_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*&
Module ok_code_transmit INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module ok_code_transmit input.
call function 'TABSTRIP_OKCODE_TRANSMIT'
exporting
i_okcode
= okcode
importing
e_first_tab_reached = gs_tab-first_reached
e_last_tab_reached = gs_tab-last_reached.

endmodule.
" ok_code_transmit INPUT
*&---------------------------------------------------------------------*
*&
Module gsber_text_lesen_a OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module gsber_text_lesen_a output.
if wa_pos-gsber_a is initial.
tgsbt-gtext = space.
else.
perform gsber_text using tgsbt-gtext wa_pos-gsber_a.
endif.
endmodule.
" gsber_text_lesen_a OUTPUT
*&---------------------------------------------------------------------*
*&
Module kostl_text_lesen_a OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module kostl_text_lesen_a output.
if wa_pos-kostl_a is initial.
cskt-ktext = space.
exit.
endif.
perform kostl_lesen

using wa_pos-kostl_a wa_pos-gsber_a.

endmodule.
" kostl_text_lesen_a OUTPUT
*&---------------------------------------------------------------------*
*&
Module alv_450 OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module alv_450 output.
*

perform fieldacat_popup.
PERFORM escludi.

if g_custom_container_popup is initial.
create object g_custom_container_popup
exporting container_name = g_container_popup.
create object grid_popup
exporting i_parent = g_custom_container_popup.
* make the ALV Grid Control editable and optimize the width of the colum
gs_layout_popup-no_toolbar = 'X'.
*
gs_layout-cwidth_opt = 'X'.
gs_layout_popup-zebra = 'X'.
* set table for first display
call method grid_popup->set_table_for_first_display
exporting
it_toolbar_excluding = it_tooolbar_excluding
i_structure_name = 'ZSAA_FIE113_WF_VIEW'
is_layout
= gs_layout_popup
changing
it_outtab
= tb_fogli_view[]

it_fieldcatalog

= gt_fieldcat_lvc_popup[].

* make the ALV Grid Control ready for input


else.
call method grid_popup->refresh_table_display.
endif.
call method cl_gui_control=>set_focus exporting control = grid_popup.
endmodule.
" alv_450 OUTPUT
*&---------------------------------------------------------------------*
*&
Module USER_COMMAND_0450 INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module user_command_0450 input.
clear okcode_2.
okcode_2 = okcode.
case okcode_2 .
when 'BACK'.
if not g_custom_container_popup is initial.
call method grid_popup->free.
call method g_custom_container_popup->free.
CALL METHOD g_container_popup->free.
clear: grid_popup, g_container_popup,
g_custom_container_popup.
endif.
clear okcode.
set screen 0.
leave screen.
endcase.

*
*
*
**
*
*
*

endmodule.
" USER_COMMAND_0450 INPUT
*&---------------------------------------------------------------------*
*&
Module STATUS_0450 OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module status_0450 output.
set pf-status 'STATUS450'.
set titlebar 'TITLE450'.
endmodule.
" STATUS_0450 OUTPUT
*&---------------------------------------------------------------------*
*&
Module umwkz_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module umwkz_text_lesen output.
perform umwkz_text_lesen.
endmodule.
" umwkz_text_lesen OUTPUT
*&---------------------------------------------------------------------*
*&
Module screen OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module screen_valori output.

****** Controllo 61
if wa_pos-ord41 = '61' and va_flag_61 is initial.
clear ztaa_fie113_wf_v.
select single * from ztaa_fie113_wf_v where bukrs = tb_testata-bukrs
and gjahr = va_gjahr
and ord41 = wa_pos-ord41
and ord42 = wa_pos-ord42
and ord43 = wa_pos-ord43
and ord44 = wa_pos-ord44.
if ztaa_fie113_wf_v-meins = 'VAL'.
va_flag_61 = 'X'.
call function 'POPUP_TO_DISPLAY_TEXT'
exporting
titel
= 'Controllo per tipologia 61'
textline1
= 'ATTENZIONE Per Tipologia 61, accettarsi'
textline2 = 'di avere inserito il valore nel campo Quantita'''
start_column = 25
start_row
= 6.
endif.
endif.
*** popup CI
if not wa_pos-zflag_ci is initial and va_flag_ci is initial.
va_flag_ci = 'X'.
call function 'POPUP_TO_DISPLAY_TEXT'
exporting
titel
= 'Includere "CI" Costi incrementativi'
textline1
= 'ATTENZIONE hai selezionato il FLAG "CI"'
textline2
= 'Saranno inclusi i costi incrementativi'
start_column = 25
start_row
= 6.
endif.

if tb_testata-ztipo = 'DI'.
if wa_pos-ord41 is initial.
loop at screen.
if screen-name = 'WA_POS-MENGE'
or screen-name = 'WA_POS-PROZS'
or screen-name = 'WA_POS-MEINS'
or screen-name = 'WA_POS-VALORE'.
screen-input = 0.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = 'WA_POS-MENGE'
or screen-name = 'WA_POS-PROZS'
or screen-name = 'WA_POS-MEINS'
or screen-name = 'WA_POS-VALORE'.
screen-input = 1.
modify screen.
endif.
endloop.
endif.
else.
if wa_pos-ord41 is initial.

loop at screen.
if screen-name = 'WA_POS-MENGE'
or screen-name = 'WA_POS-PROZS'
or screen-name = 'WA_POS-MEINS'
or screen-name = 'WA_POS-VALORE'.
screen-input = 0.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-name = 'WA_POS-MENGE'
or screen-name = 'WA_POS-MEINS'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
endif.

if wa_pos-valore > 0.
loop at screen.
if screen-name = 'WA_POS-MENGE'
or screen-name = 'WA_POS-PROZS'
or screen-name = 'WA_POS-MEINS'.
screen-input = 0.
modify screen.
endif.
if screen-name = 'WA_POS-VALORE'.
screen-input = 1.
modify screen.
endif.
endloop.
endif.
if wa_pos-prozs > 0.
loop at screen.
if screen-name = 'WA_POS-MENGE'
or screen-name = 'WA_POS-VALORE'
or screen-name = 'WA_POS-MEINS'.
screen-input = 0.
modify screen.
endif.
if screen-name = 'WA_POS-PROZS'.
screen-input = 1.
modify screen.
endif.
endloop.
endif.
if wa_pos-menge > 0.
loop at screen.
if screen-name = 'WA_POS-VALORE'
or screen-name = 'WA_POS-PROZS'.
screen-input = 0.
modify screen.
endif.
if screen-name = 'WA_POS-MENGE'

or screen-name = 'WA_POS-MEINS'.
screen-input = 1.
modify screen.
endif.
endloop.
endif.
if tb_testata-ztipo = 'DI'.
if not
not
not
not

wa_pos-ord41 is initial or
wa_pos-ord42 is initial or
wa_pos-ord43 is initial or
wa_pos-gdlgrp is initial.

***** PEr dismissioni automatismo percentuale


select single * from ztaa_fie113_wf_u where bukrs = tb_testata-bukrs
and gjahr = va_gjahr
and monat = tb_testata-bldat+4(2)
and ord41 = wa_pos-ord41
and ord42 = wa_pos-ord42
and ord43 = wa_pos-ord43
and ord44 = wa_pos-ord44
and gdlgrp = wa_pos-gdlgrp.
if sy-subrc = 0.
loop at screen.
if screen-name = 'WA_POS-PROZS'.
screen-input = 1.
screen-required = 1.
wa_pos-prozs = ztaa_fie113_wf_u-prozs.
modify screen.
endif.
if screen-name = 'WA_POS-PROZS'
or screen-name = 'WA_POS-VALORE'
or screen-name = 'WA_POS-MENGE'
or screen-name = 'WA_POS-MEINS'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
* Per Dismissioni aumatismo quantit
select single * from ztaa_fie113_wf_v
where
and
and
and
and
and
and
if sy-subrc ne 0.
select single * from ztaa_fie113_wf_v
where
and
and
and
and
and
and

bukrs = tb_testata-bukrs
gjahr = va_gjahr
ord41 = wa_pos-ord41
ord42 = wa_pos-ord42
ord43 = wa_pos-ord43
ord44 = wa_pos-ord44
gdlgrp = wa_pos-gdlgrp.
bukrs = tb_testata-bukrs
gjahr = va_gjahr
ord41 = wa_pos-ord41
ord42 = wa_pos-ord42
ord43 = wa_pos-ord43
ord44 = wa_pos-ord44
gdlgrp = space.

endif.
if sy-subrc = 0.
wa_pos-zflag_t4x = 'X'.
wa_pos-meins = ztaa_fie113_wf_v-meins.
if wa_pos-zujhr is initial .
loop at screen.
if screen-name = 'WA_POS-MENGE'
or screen-name = 'WA_POS-MEINS'.
screen-input = 1.
screen-required = 1.
modify screen.
endif.
if screen-name = 'WA_POS-PROZS'
or screen-name = 'WA_POS-VALORE'.
screen-input = 0.
modify screen.
endif.
endloop.
else.
clear: wa_pos-menge, wa_pos-meins.
loop at screen.
if screen-name = 'WA_POS-MENGE'
or screen-name = 'WA_POS-MEINS'.
screen-input = 0.
modify screen.
endif.
if screen-name = 'WA_POS-PROZS'
or screen-name = 'WA_POS-VALORE'.
screen-input = 1.
modify screen.
endif.
endloop.
endif.
else.
loop at screen.
if screen-name = 'WA_POS-MENGE'
or screen-name = 'WA_POS-MEINS'.
screen-input = 0.
modify screen.
endif.
endloop.
endif.
endif.
endif.
endmodule.
" screen OUTPUT
*&---------------------------------------------------------------------*
*&
Module screen_da OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module screen_da output.
perform invio_da.
endmodule.
" screen_da OUTPUT
*&---------------------------------------------------------------------*
*&
Module screen_a OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module screen_a output.

perform invio_a.
endmodule.
" screen_a OUTPUT
*&---------------------------------------------------------------------*
*&
Module status_0300 OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module status_0300 output.
set pf-status 'STATUS200'.
set titlebar 'TITLE300'.
endmodule.
" status_0300 OUTPUT
*&---------------------------------------------------------------------*
*&
Module controllo_300 OUTPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module controllo_300 output.
if tb_testata-ztipo = 'TR'.
if tb_testata-zmotivo = 8.
wa_pos-zflag = 'X'.
else.
wa_pos-zflag = space.
endif.
endif.
endmodule.
" controllo_300 OUTPUT
*&---------------------------------------------------------------------*
*&
Module help_zzrespbudg INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module help_zzrespbudg input.
data tb_ztpsrespbudg type ztpsrespbudg occurs 0 with header line.
data sel_ztpsrespbudg like tb_ztpsrespbudg occurs 0 with header line.
data htab type help_value occurs 0 with header line.
refresh: tb_ztpsrespbudg, sel_ztpsrespbudg.
select * into table tb_ztpsrespbudg from ztpsrespbudg.
sort tb_ztpsrespbudg by zzrespbudg.
delete adjacent duplicates from tb_ztpsrespbudg comparing zzrespbudg.
refresh htab.
clear htab.
htab-tabname = 'ZTPSRESPBUDG'.
htab-fieldname = 'ZZRESPBUDG'.
htab-selectflag = 'X'.
append htab.
clear htab.
htab-tabname = 'ZTPSRESPBUDG'.
htab-fieldname = 'ZZDESCR'.
htab-selectflag = ' '.
append htab.
* clear htab.
* htab-tabname = 'T024I'.
* htab-fieldname = 'INNAM'.

*
*

htab-selectflag = ' '.


append htab.

call function 'RHP0_POPUP_F4_REQUEST'


exporting
only_display
= ' '
*
MULTI_CHOICE
= 'X'
pop_title
= 'Seleziona Unit Richiedente'
*
pushbutton1
=
cb_repid
= sy-repid
cb_form
= sy-dynnr
*
X1
= 30
*
Y1
= 10
tables
show_fields
= htab
value_tab
= tb_ztpsrespbudg
*
marked_tab
=
select_tab
= sel_ztpsrespbudg
exceptions
cancelled
= 1
nothing_to_display
= 2
others
= 3
.
if not sel_ztpsrespbudg-zzrespbudg is initial.
tb_testata-zzrespbudg = sel_ztpsrespbudg-zzrespbudg.
*
va_ingrp
= sel_ZTPSRESPBUDGi-ZZRESPBUDG.
else.
*
clear va_ingrp.
endif.

endmodule.
" help_zzrespbudg INPUT
*&---------------------------------------------------------------------*
*&
Module kostl_pruefen INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module kostl_pruefen input.
if wa_pos-kostl_a is initial.
exit.
endif.
clear csks.
select single bkzkp into csks-bkzkp from csks
where kokrs = tb_testata-bukrs
and kostl = wa_pos-kostl_a
and datbi => tb_testata-bldat.
if sy-subrc ne 0.
message e074(zcaa_wf) with wa_pos-kostl_a.
else.
if csks-bkzkp = 'X'.
message e074(zcaa_wf) with wa_pos-kostl_a.
endif.
endif.
endmodule.
" kostl_pruefen INPUT
*&---------------------------------------------------------------------*

*&
Module gsber_check_a INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module gsber_check_a input.
if wa_pos-gsber_a is initial.
exit.
endif.
select single * from tgsb where gsber = wa_pos-gsber_a.
if sy-subrc ne 0.
message e075(zcaa_wf) with wa_pos-gsber_a.
endif.
endmodule.
" gsber_check_a INPUT
*&---------------------------------------------------------------------*
*&
Module bldat_check INPUT
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
module bldat_check input.
** controllo data evento > sy-datum
if tb_testata-bldat > sy-datum.
message w076(zcaa_wf) with tb_testata-bldat sy-datum .
endif.
endmodule.

" bldat_check

INPUT

Вам также может понравиться