Professional Documents
Culture Documents
E4E - A - ES - CO - DT - GAP - CO8 - Reparto Costes Comunes - WAVE To Be v1.0
E4E - A - ES - CO - DT - GAP - CO8 - Reparto Costes Comunes - WAVE To Be v1.0
Comunes
Technical Specification (Architectural design of the
solution)
Technical Specifications
490031245.docx
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was
received. Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
Verified by Enter the name and role of the verifier of the document.
Approved by Enter the name and role of the approval of the document.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
Distribution List
Name Reference
Antonio Bustos antonio.bustos@enel.com
Javier Collado javier.collado@enel.com
Carmen Berro carmen.berro@enel.com
Alicia Caballero alicia.caballero@enel.com
Daniele Iacobelli daniele.iacobelli@enel.com
Jordi Buesa jordi.buesa@enel.com
Jose Manuel Bustos josem.bustos@enel.com
Serafín González sgonzalezl@ayesa.com
The document is sent by mail and is still available on the project repository web site/ FTP.
References
[1] E4E_A_ES_BPR_CostControlling_Business Process Model_v2.0.docx
[2] E4E_A_ES_CO_General Framework_BBP_V0.5 (EN).docx
[3] E4E_A_ES_CO_Distribution_BBP_V0 4 (EN).docx
Inde
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
1. Introduction...........................................................................................................4
1.1. Reference Context.........................................................................................................4
1.2. Summary of the intervection...........................................................................................4
3. Application Arquitecture......................................................................................6
3.1. VALIDACION IMPUTACION COSTES COMUNES EN WBE 2º NIVEL.........................6
3.1.1. Objetos........................................................................................................................ 6
3.1.1.1. Tablas........................................................................................................................ 6
3.2. CONTABILIZACION DE LOS COSTES DE PROYECTACIÓN EXTERNA....................7
3.2.1. Objetos........................................................................................................................ 7
3.2.1.1. Tablas........................................................................................................................ 7
3.2.1.2. Estructuras................................................................................................................ 7
3.2.1.3. Transacción...............................................................................................................9
3.2.1.4. Report........................................................................................................................ 9
3.2.1.5. INCLUDE’s................................................................................................................ 9
3.2.1.6. Subrutinas............................................................................................................... 13
3.2.1.7. Clase de Mensajes..................................................................................................22
3.3. REPARTO DE LOS COSTES COMUNES...................................................................22
3.3.1. Objetos...................................................................................................................... 22
3.3.1.1. Estructuras.............................................................................................................. 22
3.3.1.2. Transacción............................................................................................................. 24
3.3.1.3. Report...................................................................................................................... 24
3.3.1.4. INCLUDE’s.............................................................................................................. 24
3.3.1.5. Subrutinas............................................................................................................... 28
5. Persistence of information.................................................................................32
6. Controls................................................................................................................33
6.1. Security Control........................................................................................................... 33
6.2. Control Mechanisms....................................................................................................33
6.3. Error Management.......................................................................................................33
6.4. Mechanism for information management.....................................................................33
Appendix.........................................................................................................................34
A. Definitions, acronyms, abbreviations............................................................................34
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
1. Introduction
The aim of this document is to describe the technical specification to implement the developments
required in the E4E GEN Project for all the processes involved in it.
Durante la fase de definición del modelo E4E Distribución se ha detectado la necesidad de definir
un procedimiento para la activación de los costes de proyectación externa y para el reparto de los
costes comunes.
Diseño técnico para el desarrollo del procedimiento definido para la activación CAPEX de
los costes de proyectación externa.
Diseño técnico para el desarrollo del procedimiento definido para el reparto de los costes
comunes. licencias y permisos, junto con los activados en el punto anterior.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
3. Application Arquitecture
3.1.1. Objetos.
3.1.1.1. Tablas.
De cara a cubrir el proceso p ara el primera requerimiento, será necesario crear el siguiente
objeto:
Tabla ZCO4D_ES_KSTAR.
o Se define la necesidad de crear una nueva tabla donde los usuarios habrán
definido las clases de coste que pueden imputar sobre el nivel 2 (Solo para
imputación directa de los costes de licencias y tasas) y de los WBEs y los perfiles
de proyecto a los que aplica.
ZCO4D_ES_KSTAR
Campo Elemento Datos Tipo Longitud Dec. Descripción
MANDT MANDT CLNT 3 0 Mandante
BUKRS BUKRS CHAR 4 0 Sociedad
PROFL PROFIDPROJ CHAR 7 0 Perfil de proyecto
KSTARI ZCO4D_ES_ED_KSTAR_D CHAR 10 0 Clase de Coste
Desde
KSTARF ZCO4D_ES_ED_KSTAR_H CHAR 10 0 Clase de Coste
Hasta
BGRKL BGRKL CHAR 3 0 Grupo de
autorización
Clasificación
BGRSE BGRSE CHAR 3 0 Grupo de
autorización
selección objeto
o Características técnicas:
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
3.2.1. Objetos.
3.2.1.1. Tablas.
Tabla ZCO4D_ES_BUKAUAR
ZCO4D_ES_BUKAUAR
Campo Elemento Datos Tipo Longitud Decimales Descripción
MANDT MANDT CLNT 3 0 Mandante
BUKRS BUKRS CHAR 4 0 Sociedad
AUART AUFART CHAR 4 0 Clase de Orden
o Tabla para Autorización para ejecución del proceso en fechas de cierre en base a
fecha de contabilización.
3.2.1.2. Estructuras.
Estructura ZCO4D_ES_S_KSTAR_SEL.
ZCO4D_ES_S_KSTAR_SEL
Campo Elemento Datos Tipo Longitud Dec. Descripción
BUKRS BUKRS CHAR 4 0 Sociedad
PERIODO ZCO4D_ES_ED_PERIO NUMC 2 0 Periodo
DO
GJAHR GJAHR NUMC 4 0 Ejercicio
BUDAT BUDAT DATS 8 0 Fecha de
contabilizació
n en el
documento
AUART AUFART CHAR 4 0 Clase de
Orden
NUM_MESES ZCO4D_ES_ED_MESES DEC 2 0 Número de
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
meses previo
al Cierre
órdenes F9S
OBJ_REP_ZX ZCO4D_ES_ED_OBJ_Z CHAR 1 0 Determinación
X objetos a
repartir por
reales avisos
ZX
MODO_TEST ZCO4D_ES_ED_MODO CHAR 1 0 Ejecución en
_TEST modo test
Estructura ZCO4D_ES_S_C_COST_PROY_EXT_ALV.
ZCO4D_ES_S_C_COST_PROY_EXT_ALV
Campo Elemento Datos Tipo Longitud Dec. Descripción
SEL CHAR1 CHAR 1 0 Indicador de una
posición
KO ZCO4D_ES_ED_ICONO CHAR 4 0 ICONO para ALV
ORDEN AUFNR CHAR 12 0 Número de orden
DESC_ORDEN ZCO4D_ES_ES_AUFTEXT CHAR 40 0 Descripción Orden
OPERACION VORNR CHAR 4 0 Número de
operación
DESC_OPERAC LTXA1 CHAR 40 0 Texto breve
ION operación
CLASE_COSTE KSTAR CHAR 10 0 Clase de coste
DESC_CLASE_ KLTXT CHAR 40 0 Descripción
COSTE
SALDO_ORIG ZCO4D_ES_ED_SALDO_O CURR 15 2 Saldo Original
RIGINAL
AVISO_SERVI QMNUM CHAR 12 0 Número de aviso
CIO
DESC_AVISO QMTXT CHAR 40 0 Texto breve
CLASE_AVISO QMART CHAR 2 0 Clase de aviso
TEXTO_ERRO ZCO4D_ES_ED_TEXT_ERR CHAR 100 0 Descripción Error
R
METODO_REP ZCO4D_ES_ED_REPARTO CHAR 11 0 Método de Reparto
ARTO
WBE4 ZCO4D_ES_ED_WBE CHAR 24 0 WBE Nivel 4
destino
DESC_WBE4 ZCO4D_ES_ED_DESC_WB CHAR 40 0 Descripción del
E WBE
ORDEN_DEST ZCO4D_ES_ED_ORD_DES CHAR 12 0 Orden Destino
T
DESC_ORD_DE ZCO4D_ES_ED_DESC_OR CHAR 40 0 Descripción Orden
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
ST D_DEST destino
OPER_ORD_DE ZCO4D_ES_ED_OPER_DES CHAR 4 0 Operación Orden
ST T destino
CLASE_ORD_D AUFART CHAR 4 0 Clase de Orden
EST
STATUS_ELM_ ZCO4D_ES_ED_STATUS CHAR 4 0 Status elemento
DEST destino
PPTO_OPER_D ZCO4D_ES_ED_PPTO_OPE CURR 15 2 Presupuesto
EST R_DEST operativo elemento
destino
PORCEN_PPTO ZCO4D_ES_ED_PORCEN_ CHAR 8 0 Porcentaje ppto
DEST sobre total
elementos destino
IMP_REPARTO ZCO4D_ES_ED_IMP_CONT CURR 15 2 Importe a
AB contabilizar sobre
elemento destino
DOC_GENERA BELNR_D CHAR 10 0 Número de un
DO documento
contable
POSID PS_POSID CHAR 24 0 Elemento del plan
de estructura de
proyecto (elemento
PEP)
3.2.1.3. Transacción.
Transacción ZZCO4D_TR_COST_COMU.
3.2.1.4. Report.
Report ZCO4D_ES_P_CONTA_COST_PROY_EXT
ZCO4D_ES_I_CONTA_COST_TOP. Definiciones globales
ZCO4D_ES_I_CONTA_COST_SEL. Pantalla de Selección inicial
ZCO4D_ES_I_CONTA_COST_EVE. Eventos
ZCO4D_ES_I_CONTA_COST_SUB. Subrutinas
3.2.1.5. INCLUDE’s.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
o Se incluirán aquí los Tipos, Tablas internas, estructuras, variables, constantes, etc.
que necesitaremos para el desarrollo.
ALV Declarations
TYPE-POOLS: slis.
DATA: gs_fieldcat TYPE slis_fieldcat_alv,
gt_events TYPE slis_t_event WITH HEADER LINE,
gs_layout TYPE slis_layout_alv,
gs_variant TYPE disvariant,
gt_exclude TYPE slis_t_extab,
gs_exclude LIKE LINE OF gt_exclude,
gt_fieldcat TYPE slis_t_fieldcat_alv.
TYPES: BEGIN OF gtype_cosp,
aufnr TYPE aufnr,
qmnum TYPE qmnum,
qmart TYPE qmart,
vornr TYPE vornr,
objnr TYPE j_objnr,
kstar TYPE kstar,
saldo TYPE wertv8,
vbund TYPE rassc,
TYPES: END OF gtype_cosp.
TYPES: BEGIN OF gty_ordcs,
zzaviso TYPE aufk-zzaviso,
pspel TYPE caufv-pspel,
aufnr TYPE aufk-aufnr,
auart TYPE aufk-auart,
objnr TYPE aufk-objnr,
zzest_adeg TYPE proj-zzest_adeg,
ktext TYPE ktext.
TYPES: END OF gty_ordcs.
TYPES: BEGIN OF gty_aufk,
bukrs TYPE bukrs,
aufnr TYPE aufnr,
ktext TYPE auftext,
objnr TYPE j_objnr,
auart TYPE aufart,
kstar TYPE kstar,
idat3 TYPE aufidat3,
waers TYPE waers,
imp_orden TYPE wkgxxx,
vbund TYPE rassc.
TYPES: END OF gty_aufk.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
TYPES: BEGIN OF gty_zaviso,
qmnum TYPE qmnum,
aufnr TYPE aufnr.
TYPES: END OF gty_zaviso.
TYPES: BEGIN OF gty_oper,
aufnr TYPE aufnr,
vornr TYPE vornr,
objnr TYPE j_objnr.
TYPES: END OF gty_oper.
CONSTANTS: gc_x(1) TYPE c VALUE 'X',
gc_cs(4) TYPE c VALUE 'CS',
gc_w1(4) TYPE c VALUE 'W1',
gc_w2(4) TYPE c VALUE 'W2',
gc_w3(4) TYPE c VALUE 'W3',
gc_w4(4) TYPE c VALUE 'W4',
gc_iv(2) TYPE c VALUE 'IV',
gc_01(2) type c VALUE '01',
gc_02(2) type c VALUE '02',
gc_999(2) type c value '999' ,
gc_20(2) type c value '20',
gc_30(2) type c value '30'.
DATA: gv_plan TYPE rvari_val_255,
gv_libe TYPE rvari_val_255,
gv_ctec TYPE rvari_val_255,
gv_cerr TYPE rvari_val_255,
gv_zk TYPE rvari_val_255,
gv_zx TYPE rvari_val_255,
gv_ann TYPE rvari_val_255,
gv_ptc TYPE rvari_val_255,
gv_ril TYPE rvari_val_255,
gv_lib TYPE rvari_val_255,
gv_libp TYPE rvari_val_255,
gv_cte TYPE rvari_val_255,
gv_bloq TYPE rvari_val_255,
gv_ptbo TYPE rvari_val_255,
gv_ptbo1 TYPE rvari_val_255,
gv_ptbo2 TYPE rvari_val_255.
Tablas internas. Se definirán aquí las tablas internas que se necesiten para
el desarrollo marcando su estructura con los Tipos Globales definidos más
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
DATA: BEGIN OF gt_reg OCCURS 1000,
zzaviso TYPE aufk-zzaviso,
posid LIKE prps-posid,
objnr LIKE prps-objnr,
aufnr LIKE aufk-aufnr,
importe LIKE cosp-wkg001,
imp_tras LIKE cosp-wkg001,
signo(1) TYPE c,
porcent(8) TYPE c,
importe_interna TYPE cosp-wkg001,
zzpptoapa TYPE aufk-zzpptoapa,
zzest_adeg TYPE caufv-zzest_adeg,
vornr TYPE vornr,
qmart TYPE qmart,
elemento TYPE char4,
pspnr TYPE ps_posnr,
kstar TYPE kstar,
vbund TYPE rassc.
DATA: END OF gt_reg.
Include ZCO4D_ES_I_CONTA_COST_SEL.
o Definir aqui la pantalla de criterios de selección para que tenga el formato siguiente:
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
PARAMETERS: p_bukrs type ZCO4D_ES_S_KSTAR_SEL-
bukrs. "Sociedad
PARAMETERS: p_perio TYPE ZCO4D_ES_S_KSTAR_SEL-periodo. "Per
iodo
PARAMETERS: p_gjahr type ZCO4D_ES_S_KSTAR_SEL-gjahr. "Eje
rcicio
PARAMETERS: p_budat TYPE ZCO4D_ES_S_KSTAR_SEL-budat. "Fec
ha Contabilización
SELECT-OPTIONS: so_auart FOR ZCO4D_ES_S_KSTAR_SEL-auart.
"Clase de Orden
PARAMETERS: p_numme TYPE ZCO4D_ES_S_KSTAR_SEL-num_meses. "Nº
de meses
PARAMETERS: p_test TYPE ZCO4D_ES_S_KSTAR_SEL-modo_test DEFAUL
T gc_x AS CHECKBOX. “Modo TEST
Include ZCO4D_ES_I_CONTA_COST_SUB.
3.2.1.6. Subrutinas.
o FORM F_INICIALIZAR.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
var_type = 'P'
CHANGING
var_parameter = {variable a cargar}
* VAR_SELOPT =
EXCEPTIONS
var_not_existent = 1
OTHERS = 2.
o FORM F_VALIDAR_CRITERIOS.
o FORM F_PROCESO_PRINCIPAL
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = lv_date
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
days = 00
months = lv_mes
signum = '-'
years = 00
IMPORTING
calc_date = gv_fecini.
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
day_in = lv_date
IMPORTING
last_day_of_month = gv_fecfin
EXCEPTIONS
day_in_no_date = 1
OTHERS = 2.
FREE gt_zaviso.
SELECT a~qmnum a~zobject INTO TABLE gt_zaviso
FROM zcm4d_gl_t_aviso AS a
INNER JOIN aufk AS b
ON b~aufnr = a~zobject
INNER JOIN afih AS c
ON c~aufnr = a~zobject
INNER JOIN qmel AS d
ON a~qmnum = d~qmnum
WHERE a~loekz = space
AND b~auart = 'F9'
AND b~bukrs = p_bukrs
AND c~ilart = 'F9S'
AND d~qmart IN (gv_zk, gv_zx).
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
Comprobar que las ordenes esten en status “LIBE”, “CTEC” o “CERR”. Este
ultimo será válido si la fecha de cierre (campo idat3 de AUFK) se encuantra
en el periodo que calculamos anteriormente.
Obtener los saldos de las ordenes en la tabla lt_cosp accediendo a la tabla
COSP para todos los objetos de gt_aufk con tipo de valor “real” (campo
wrttp = “04”) y que no sean órdenes “liquidadoras” (campo vrgng = “AUAK” o
“KOBRB”.
Obtener descripciones de las Clases de Coste asociadas a las imputaciones
de la tabla CSKU.
Construir la tabla gt_saldos (de tipo gty_cosp, definido en el include TOP)
en base al contenido de lt_cosp y acumulando los campos WKG001 a
WKG012 en el campo “saldo” de la tabla gt_saldos.
Recorrer la tabla de ordenes F9S (gt_aufk) y comprobar si tiene saldo <> 0
en la tabla gt_saldos. Si no lo tuviera, emitir error en este sentido.
Obtener estructuras de trabajo asociadas a los AdS. Para ellos recorrer la
tabla gt_zaviso y, por cada registro:
Recorrer la tabla gt_aufk y, por cada registro cuyo campo aufnr
coincida con el aviso en curso:
o Obtener las ordenes CS en la tabla gt_ordcs mediante la
SELECT ... INNER JOIN siguiente:
SELECT a~qmnum b~pspel b~aufnr b~auart b~objnr
INTO TABLE gt_ordcs
FROM zcm4d_gl_t_aviso AS a
INNER JOIN caufv AS b
ON a~zobject = b~aufnr
WHERE ztype_ob = text-013 "ODM
AND a~qmnum = gs_zaviso-qmnum
AND a~loekz = space
AND a~zobject <> space
AND b~aufnr <> gs_zaviso-aufnr
AND b~scope = gc_iv. "IV
o Si se se obtienen registros, comprobar que el status de
usuario sea “PTC”.
Comprobar que el status de sistema del objeto sea
"LIB." o "CTEC" y no estén marcados para borrar
(PTBO) o bloqueados (BLOQ). Si no se cumple, emitir
error y continuar al inicio del bucle.
Ejecutar la subrutina
F_CARGAR_COSTES_CS_PLANIF, definida mas
adelante.
o Si no se obtienen órdenes CS, buscar Buscar estructuras
WBEs nominativas (Elementos PEP), con la SELECT ...
INNER JOIN:
SELECT b~posid b~objnr b~zzqmnum b~pspnr INTO
TABLE lt_wbes1
FROM zcm4d_gl_t_aviso AS a
INNER JOIN prps AS b
ON a~zobject = b~posid
WHERE a~ztype_ob = text-014
AND a~loekz = space
AND a~qmnum = gs_zaviso-qmnum
AND b~stufe = '1'.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
SELECT a~posid a~objnr a~pspnr INTO
CORRESPONDING FIELDS OF TABLE lt_wbes2
FROM prps AS a INNER JOIN
prhi AS b
ON a~pspnr = b~posnr
WHERE b~up = ls_wbes1-pspnr.
o FORM F_CARGAR_COSTES_CS_PLANIF
SELECT a~aufnr b~vornr b~objnr
INTO CORRESPONDING FIELDS OF TABLE gt_oper
FROM afko AS a
INNER JOIN afvc AS b
ON a~aufpl = b~aufpl
WHERE a~aufnr = p_gs_ordcs-aufnr.
FREE gt_rpsco.
SELECT * INTO TABLE gt_rpsco FROM rpsco
WHERE objnr = p_gt_reg-objnr
AND lednr = '0001'
AND wrttp = '01'
AND versn = '000'.
CHECK sy-subrc = 0.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
o FORM F_CARGAR_COSTES_GRAFO_PLANIF
CONCATENATE p_gt_reg-posid '%' INTO lv_posid.
FREE lt_pep.
SELECT posid pspnr INTO TABLE lt_pep FROM prps
WHERE posid LIKE lv_posid
AND pspnr <> p_gt_reg-pspnr
AND belkz = gc_x.
.
CHECK sy-subrc = 0.
FREE lt_oper.
SELECT b~aufnr b~objnr a~objnr a~vornr a~projn a~ltxa1 INTO T
ABLE lt_oper
FROM afvc AS a
INNER JOIN caufv AS b
ON a~aufpl = b~aufpl
FOR ALL ENTRIES IN lt_pep
WHERE a~projn = lt_pep-pspnr
AND a~projn <> p_gt_reg-pspnr.
CHECK sy-subrc = 0.
gs_alv-posid = p_gt_reg-posid.
* Obtenemos los costes de las operaciones.
FREE gt_rpsco.
CLEAR gs_rpsco.
SELECT * INTO TABLE gt_rpsco FROM rpsco
FOR ALL ENTRIES IN lt_oper
WHERE objnr = lt_oper-objnro "OBJNR de la operación
AND lednr = '0001'
AND wrttp = '01' "Plan
AND versn = '000'.
CHECK sy-subrc = 0.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
o FORM F_CALCULAR_PORCENTAJE
lv_porc = ( gt_reg-zzpptoapa / lv_tot_ppto_aviso ) * 100.
Modificamos gt_reg.
Leemos el registro correspondiente de la tabla del ALV (gt_alv) para
actualizar estos dos campos.
Comparamos la suma de los importes a traspasar con el importe del
aviso. Si hay una diferencia (debida al redondeo), lo añadiremos al
elemento con mayor presupuesto.
o FORM F_LLENAR_REG_DATOS
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
reg_datos-empre = lv_bukrs.
reg_datos-moneda = lv_waers.
reg_datos-feccon = p_budat.
reg_datos-concep = gc_01.
reg_datos-numeq = gc_999.
reg_datos-ctacon = gt_reg_2-kstar.
reg_datos-orden = gs_saldos-aufnr.
reg_datos-vbund = gt_reg_2-vbund.
reg_datos-import = gs_saldos-saldo (sin puntos ni comas)
Recorremos gt_reg_2 para el aviso pasado por parámetro. Por cada registro:
Leer de aufk el registro correspondiente al campo aufnr de gt_reg_2.
Cargar los campos de reg_datos:
reg_datos-empre = lv_bukrs.
reg_datos-moneda = lv_waers.
reg_datos-feccon = p_budat.
reg_datos-concep = gc_01.
reg_datos-numeq = gc_999.
reg_datos-ctacon = gt_reg_2-kstar.
reg_datos-orden = gs_saldos-aufnr.
reg_datos-vbund = gt_reg_2-vbund.
reg_datos-import = gs_saldos-saldo (sin puntos ni comas)
CLEAR ls_status.
ls_status-stat = gv_cerr. "I0046
ls_status-inact = gc_x.
APPEND ls_status TO lt_status.
CLEAR ls_status.
ls_status-stat = gv_ctec. "I0045
ls_status-inact = ' '.
APPEND ls_status TO lt_status.
CALL FUNCTION 'STATUS_CHANGE_INTERN'
EXPORTING
objnr = p_gt_reg-objnr
TABLES
status = lt_status
EXCEPTIONS
object_not_found = 01
status_inconsistent = 02
status_not_allowed = 03.
o FORM F_LANZAR_BI.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
o FORM F_MOSTRAR_ALV.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = 'ZCO4D_ES_S_C_COST_PROY_EXT_ALV'
i_bypassing_buffer = gc_x
i_buffer_active = gc_x
CHANGING
ct_fieldcat = gt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_bypassing_buffer = gc_x
i_callback_program = sy-repid
i_callback_pf_status_set = 'ZMI_STATUS'
i_grid_title = lv_titulo
is_layout = gs_layout
it_fieldcat = gt_fieldcat
TABLES
t_outtab = gt_alv
EXCEPTIONS
program_error = 1
OTHERS = 2.
Diseño parcial del aspecto final del ALV a mostrar (ver ...TOP):
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
3.3.1. Objetos.
3.3.1.1. Estructuras.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
Estructura ZCO4D_ES_S_REPCOST_SEL.
ZCO4D_ES_S_REPCOST_SEL
Campo Elemento Datos Tipo Longitud Dec. Descripción
BUKRS BUKRS CHAR 4 0 Sociedad
PERIODO ZCO4D_ES_ED_PERIO NUMC 2 0 Periodo
DO
GJAHR GJAHR NUMC 4 0 Ejercicio
BUDAT BUDAT DATS 8 0 Fecha de
contabilizació
n en el
documento
MODO_TEST ZCO4D_ES_ED_MODO CHAR 1 0 Ejecución en
_TEST modo test
Estructura ZCO4D_ES_S_REPCOST_ALV.
ZCO4D_ES_S_REPCOST_ALV
Campo Elemento Datos Tipo Longitud Dec. Descripción
KO ZCO4D_ES_ED_ICONO CHAR 4 0 ICONO para ALV
CLASE_COSTE KSTAR CHAR 10 0 Clase de coste
DESC_CLASE_ KLTXT CHAR 40 0 Descripción
COSTE
SALDO_ORIG ZCO4D_ES_ED_SALDO_O CURR 15 2 Saldo Original
RIGINAL
WBE4 ZCO4D_ES_ED_WBE CHAR 24 0 WBE Nivel 4
destino
DESC_WBE4 ZCO4D_ES_ED_DESC_WB CHAR 40 0 Descripción del
E WBE
PPTO_WBE4 ZCO4D_ES_ED_PPTO_NIV CURR 15 2 Presupuesto WBE
EL_4 Nivel 4
PORCEN_PPTO ZCO4D_ES_ED_PORCEN_4 CHAR 8 0 Porcentaje ppto
_4_2 _2 WBE Nivel 4
sobre total WBE
Nivel 2
IMP_TEORICO ZCO4D_ES_ED_IMP_TEOR CURR 15 2 Importe teórico
_4 ICO WBE Nivel 4
ORDEN_DEST ZCO4D_ES_ED_ORD_DES CHAR 12 0 Orden Destino
T
DESC_ORD_DE ZCO4D_ES_ED_DESC_OR CHAR 40 0 Descripción Orden
ST D_DEST destino
OPER_ORD_DE ZCO4D_ES_ED_OPER_DES CHAR 4 0 Operación Orden
ST T destino
DESC_OPERAC LTXA1 CHAR 40 0 Texto breve
ION operación
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
3.3.1.2. Transacción.
Transacción ZCO4D_TR_REPCOSTCOM.
3.3.1.3. Report.
Report ZCO4D_ES_P_REPARTO_COST_COM
ZCO4D_ES_I_REP_COST_TOP. Definiciones globales
ZCO4D_ES_I_REP_COST_SEL. Pantalla de Selección inicial
ZCO4D_ES_I_REP_COST_EVE. Eventos
ZCO4D_ES_I_REP_COST_SUB. Subrutinas
3.3.1.4. INCLUDE’s.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
o Se incluirán aquí los Tipos, Tablas internas, estructuras, variables, constantes, etc.
que necesitaremos para el desarrollo.
ALV Declarations
TYPE-POOLS: slis.
DATA: gs_fieldcat TYPE slis_fieldcat_alv,
gt_events TYPE slis_t_event WITH HEADER LINE,
gs_layout TYPE slis_layout_alv,
gs_variant TYPE disvariant,
gt_exclude TYPE slis_t_extab,
gs_exclude LIKE LINE OF gt_exclude,
gt_fieldcat TYPE slis_t_fieldcat_alv.
TYPES: BEGIN OF gtype_cosp,
objnr TYPE j_objnr,
kstar TYPE kstar,
projn TYPE ps_posnr,
wtg001 TYPE wtgxxx,
wtg002 TYPE wtgxxx,
wtg003 TYPE wtgxxx,
wtg004 TYPE wtgxxx,
wtg005 TYPE wtgxxx,
wtg006 TYPE wtgxxx,
wtg007 TYPE wtgxxx,
wtg008 TYPE wtgxxx,
wtg009 TYPE wtgxxx,
wtg010 TYPE wtgxxx,
wtg011 TYPE wtgxxx,
wtg012 TYPE wtgxxx.
TYPES: END OF gtype_cosp.
TYPES: BEGIN OF gtype_saldos,
wbe2 TYPE ps_posid,
objnr TYPE j_objnr,
objnro TYPE j_objnr,
kstar TYPE kstar,
vornr TYPE vornr,
saldow TYPE wertv8,
saldoo TYPE wertv8.
TYPES: END OF gtype_saldos.
TYPES: BEGIN OF gty_wbe,
posid2 TYPE prps-posid,
objnr2 TYPE prps-objnr,
posid4 TYPE prps-posid,
objnr4 TYPE prps-objnr,
post1 TYPE ps_post1,
aufnr TYPE aufk-aufnr,
objnrg TYPE objnr,
imp_wbe2 TYPE cosp-wkg001,
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
imp_wbe4 TYPE cosp-wkg001,
imp_ope TYPE cosp-wkg001,
imp_rep TYPE cosp-wkg001,
porcent(8) TYPE c,
objnro TYPE j_objnr,
vornr TYPE vornr,
kstar TYPE kstar.
TYPES: END OF gty_wbe.
TYPES: BEGIN OF gty_wbe_3_4,
pspnr TYPE prps-pspnr,
posid TYPE prps-posid,
objnr TYPE prps-objnr,
up TYPE ps_phiup,
post1 TYPE ps_post1.
TYPES: END OF gty_wbe_3_4.
TYPES: BEGIN OF gty_w_c,
posid TYPE ps_posid,
kstar TYPE kstar.
TYPES: END OF gty_w_c.
TYPES: BEGIN OF gty_oper,
objnro TYPE j_objnr,
vornr TYPE vornr,
posid TYPE ps_posid,
objnrw TYPE j_objnr,
aufnr TYPE aufnr,
ktext TYPE auftext,
LTXA1 type LTXA1.
TYPES: END OF gty_oper.
TYPES: BEGIN OF gty_wbe4_pon,
kstar TYPE kstar,
objnr TYPE j_objnr,
wbe2 TYPE ps_posid,
saldo_o TYPE wtgxxx,
saldo_pon TYPE wtgxxx.
TYPES: END OF gty_wbe4_pon.
TYPES: BEGIN OF gty_csku,
kstar TYPE j_objnr,
ltext TYPE kltxt.
TYPES: END OF gty_csku.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
TYPES: BEGIN OF gty_profl,
profl TYPE profidproj.
TYPES: END OF gty_profl.
TYPES: BEGIN OF gty_proy,
pspnr TYPE prps-pspnr.
TYPES: END OF gty_proy.
Constantes:
CONSTANTS: gc_x(1) TYPE c VALUE 'X'.
Tablas globales:
DATA: gt_errores TYPE TABLE OF esp1_message_wa_type,
gt_usuario TYPE TABLE OF zkstatext,
gt_sistema TYPE TABLE OF zkstatint,
gt_alv TYPE TABLE OF zco4d_es_s_repcost_alv,
gt_datos_alv TYPE TABLE OF zco4d_es_s_repcost_alv,
gt_saldos2 TYPE TABLE OF gtype_saldos,
gt_saldos4 TYPE TABLE OF gtype_saldos,
gt_saldos4_aux TYPE TABLE OF gtype_saldos,
gt_cosp TYPE TABLE OF gty_cosp,
gt_cosp2 TYPE TABLE OF gty_cosp,
gt_cosp4 TYPE TABLE OF gty_cosp,
gt_w_c TYPE TABLE OF gty_w_c,
gt_wbe TYPE TABLE OF gty_wbe,
gt_wbe_aux TYPE TABLE OF gty_wbe,
gt_wbe2 TYPE TABLE OF gty_wbe_3_4,
gt_wbe3 TYPE TABLE OF gty_wbe_3_4,
gt_wbe4 TYPE TABLE OF gty_wbe_3_4,
gt_oper TYPE TABLE OF gty_oper,
gt_wbe4_pon TYPE TABLE OF gty_wbe4_pon,
gt_csku TYPE TABLE OF gty_csku
gt_profl TYPE TABLE OF gty_profl,
gt_proy TYPE TABLE OF gty_proy.
Estructuras globales:
DATA: gs_wbe2 TYPE gty_wbe_3_4,
gs_wbe3 TYPE gty_wbe_3_4,
gs_wbe4 TYPE gty_wbe_3_4,
gs_wbe TYPE gty_wbe,
gs_cosp TYPE gty_cosp,
gs_cosp2 TYPE gty_cosp,
gs_cosp4 TYPE gty_cosp,
gs_w_c TYPE gty_w_c,
gs_errores TYPE esp1_message_wa_type,
gs_alv TYPE zco4d_es_s_repcost_alv,
gs_saldos TYPE gtype_saldos,
gs_saldos2 TYPE gtype_saldos,
gs_saldos4 TYPE gtype_saldos,
gs_saldos4_aux TYPE gtype_saldos,
gs_wbe_aux TYPE gty_wbe,
gs_oper TYPE gty_oper,
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
gs_wbe4_pon TYPE gty_wbe4_pon,
gs_wbe4_pon2 TYPE gty_wbe4_pon,
gs_csku TYPE gty_csku.
Include ZCO4D_ES_I_CONTA_COST_SEL.
o Definir aqui la pantalla de criterios de selección para que tenga el formato siguiente:
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs TYPE zco4d_es_s_repcost_sel-bukrs. "Sociedad
PARAMETERS: p_perio TYPE zco4d_es_s_repcost_sel-periodo. "Periodo
PARAMETERS: p_gjahr TYPE zco4d_es_s_repcost_sel-gjahr. "Ejercicio
PARAMETERS: p_budat TYPE zco4d_es_s_repcost_sel-budat. "Fecha Contabilización
PARAMETERS: p_test TYPE zco4d_es_s_repcost_sel-modo_test DEFAULT gc_x AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK bl1.
Include ZCO4D_ES_I_CONTA_COST_SUB.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
3.3.1.5. Subrutinas.
o FORM F_INICIALIZAR.
o FORM F_VALIDAR_CRITERIOS.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
o FORM F_PROCESO_PRINCIPAL
Obtener todos los WBE de nivel 4 en gt_wbe4 para todas las entradas de la
tabla anterior, haciendo el siguiente INNER JOIN con las tablas PRPS Y
PRHI:
SELECT a~pspnr a~posid a~objnr b~up a~post1 INTO CORRESPONDING FIELDS OF TAB
LE gt_wbe4
FROM prps AS a INNER JOIN
prhi AS b
ON a~pspnr = b~posnr
FOR ALL ENTRIES IN gt_wbe3
WHERE b~up = gt_wbe3-pspnr.
Eliminar de la tabla anterior todos los WBE de nivel 4 con status de sistema
‘CERR’.
Cargar los costes de los WBE de nivel 2 en gt_cosp2, para todas las
entradas de la tabla de WBEs de nivel 2 por el campo clave objnr, tipo de
valor (wrttp) = ‘04’, lednr = ‘00’ y versn = ‘000’.
Recorrer esta tabla de costes de los WBE de nivel 2 y construir la tabla
gt_saldos (definida en el INCLUDE ..._TOP) acumulando en el campo saldo
la suma de los campos WTG001 a WTG012 de gt_cosp2 y acumular por
clase de coste.
Recorrer la tabla gt_wbe4 y construir la tabla gt_saldos4, acumulando los
saldos por operación y clase de coste.
Recorrer la tabla de los WBE4 (operaciones) y sus saldos y cargar la tabla
gt_wbe.
Cargar en esta tabla las descripciones de las clases de coste desde CSKU.
Cargar la tabla interna REG-DATOS a partir de la tabla gt_wbe y alimentar
la tabla a mostrar en el ALV.
Llamar al form F_EFECTUAR_REPARTO.
o FORM F_EFECTUAR_REPARTO
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
5. Persistence of information
N.A
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
6. Controls
6.1. Security Control
N.A
This document contains proprietary information of Enel SpA and shall only be used by the recipient in relation to the purposes for which it was received.
Any form of reproduction or disclosure without the express consent of Enel SpA is prohibited.
Appendix
A. Definitions, acronyms, abbreviations
List of definitions of specific terms used in the terms of the document or of ICT that are also used in other
documents.
C.Tables