Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 34

CO - Technical Specifications - Reparto Costes

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.

Edited by Enrique Carlos Perez Martin 20/07/2017

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.

REPRODUCTION FORBIDDEN Internal Use


Template Document Code Version and Date File ID Total Pages
1. SGI-MTC- 2. 0000- 3. Version, 4. 490031245.docx 5. 34
03C-EN_01 XX00 1.0./Borrado
r
Information and Communication Technology
Unit / Unit

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.

Changes to the document


The changes in the following table refer to the previous version of the document.

Change Description Reference

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

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
2 34
Information and Communication Technology
Unit / Unit

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

2. General system arquitecture...............................................................................5


2.1.1. Solution architecture diagram......................................................................................5
2.1.2. Arquitecture AS-IS.......................................................................................................5
2.1.3. Arquitecture <TO-BE>.................................................................................................5

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

4. Interfaces ande integration flows......................................................................31

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

Index of figures and tables...........................................................................................34


B. Figures......................................................................................................................... 34
C. Tables.......................................................................................................................... 34

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
3 34
Information and Communication Technology
Unit / Unit

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.

1.1. Reference Context

Requisito para el nuevo GAP_CO_008.

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.

1.2. Summary of the intervection

El presente documento detalla:

 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.

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
4 34
Information and Communication Technology
Unit / Unit

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.

2. General system arquitecture


2.1.1. Solution architecture diagram

2.1.2. Arquitecture AS-IS


N.A

2.1.3. Arquitecture <TO-BE>


N.A

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
5 34
Information and Communication Technology
Unit / Unit

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. VALIDACION IMPUTACION COSTES COMUNES EN WBE 2º NIVEL.

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:

Descrip. Breve: Tabla imputaciones permitidas a WBEs nivel 2.


Clase de datos: USER1 Tipo datos cliente
Categ. Tamaño: 4 [Reg.datos esperados 310.000 a 1,200.000]
Clase de entrega: A [Tabla aplicación (datos maestros y de movimiento)]

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
6 34
Information and Communication Technology
Unit / Unit

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. CONTABILIZACION DE LOS COSTES DE PROYECTACIÓN EXTERNA

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.

Descrip. Breve Autorización ejecución proceso Contabiliazación Proy. Ext.


Clase de datos USER1 Tipo datos cliente
Categ. Tamaño 0 [Reg.datos esperados 0 A 27.000]
Clase de entrega A [Tabla aplicación (datos maestros y de movimiento)]

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

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
7 34
Information and Communication Technology
Unit / Unit

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

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
8 34
Information and Communication Technology
Unit / Unit

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.

o Lanzará el Programa ZCO4D_ES_P_CONTA_COST_PROY_EXT

3.2.1.4. Report.

 Report ZCO4D_ES_P_CONTA_COST_PROY_EXT

o Contendrá los siguientes INCLUDES:

 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.

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
9 34
Information and Communication Technology
Unit / Unit

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.

 Include ZCO4D_ES_I_CONTA_COST_TOP. Definiciones globales:

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.

 Tipo para costes de las operaciones y órdenes:

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.

 Tipo para almacenar las órdenes CS

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.

 Tipo para almacenar las órdenes F9/F9S

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.

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
10 34
Information and Communication Technology
Unit / Unit

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.

 Tipo para almacenar los avisos de servicio

TYPES: BEGIN OF gty_zaviso,
         qmnum TYPE qmnum,
         aufnr TYPE aufnr.
TYPES: END OF gty_zaviso.

 Tipo para almacenar las operaciones

TYPES: BEGIN OF gty_oper,
         aufnr TYPE aufnr,
         vornr TYPE vornr,
         objnr TYPE j_objnr.
TYPES: END OF gty_oper.

 Constantes. Definir las siguientes constantes para evitar hard-code:

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'.

 Variables. Definir las siguientes variables para evitar hard-code. Se


cargarán con los valores correspondientes mediante una llamada al Módulo
de Función ZALL4D_FM_GET_TVARVC en el evento de inicialización (Ver
subrutina F_INICIALIZAR):

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

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
11 34
Information and Communication Technology
Unit / Unit

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.

arriba. A destacar, la tabla interna que contendrá el resultado final de los


importes a contabilizar por cada una de las órdenes/operaciones /WBEs,
gt_reg (tabla con header line)

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_EVE. Definiciones globales:

o Evento INICIALIZATION. Invocar la subrutina F_INICIALIZAR, definida mas


adelante.
o Evento START-OF-SELECTION. Invocar la subrutina F_VALIDAR_CRITERIOS,
definida mas adelante.
 Si la subrutina no devuelve error, invocar a la subrutina
F_PROCESO_PRINCIPAL, definida mas adelante.
 Se devuelve error, vovler a la pantalla de Criterios de Selección y mostrar el
error recibido.
 Si no se está ejecutando en job de fondo (variable del sistems sy-batch sin
valor informado), invocar a la subrutina F_MOSTRAR_ALV, definida más
adelante.

 Include ZCO4D_ES_I_CONTA_COST_SEL.

o Definir aqui la pantalla de criterios de selección para que tenga el formato siguiente:

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
12 34
Information and Communication Technology
Unit / Unit

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 Definir los PARAMETERS y SELECT-OPTIONS siguientes:

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.

Definir las subrutinas siguientes y su contenido:

3.2.1.6. Subrutinas.

o FORM F_INICIALIZAR.

 Llamar repetidamente al MF “ZALL4D_FM_GET_TVARVC” pasándole los


distintos valores con objeto de cargar en las variables definidas en el TOP
para contener los valores de la tabla de HARDCODE.
 
 CALL FUNCTION 'ZALL4D_FM_GET_TVARVC'
    EXPORTING
      var_name         = {valor clave del hardcode}

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
13 34
Information and Communication Technology
Unit / Unit

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.

Según los valores de la tabla siguiente:

VAR_NAME VAR_PARAMETER VARIABLE


ZCO4D_ST_SI_BLOQ I0043 GV_BLOQ
ZCO4D_ST_SI_CTE CTEC GV_CTE
ZCO4D_ST_SI_LIB LIB. GV_LIB
ZCO4D_ST_SI_LIBP LIBP GV_LIBP
ZCO4D_ST_SI_PTBO PTBO GV_PTBO
ZCO4D_ST_SI_PTBO1 I0076 GV_PTBO1
ZCO4D_ST_SI_PTBO2 I0805 GV_PTBO2
ZCO4D_ST_US_ANN ANN GV_ANN
ZCO4D_ST_US_CERR I0046 GV_CERR
ZCO4D_ST_US_CTEC I0045 GV_CTEC
ZCO4D_ST_US_LIBE I0002 GV_LIBE
ZCO4D_ST_US_PTC PTC GV_PTC
ZCO4D_ST_US_RIL RIL GV_RIL
ZCO4D_TIP_ADS_ZK ZK GV_ZK
ZCO4D_TIP_ADS_ZX ZX GV_ZX

o FORM F_VALIDAR_CRITERIOS.

 Si la Sociedad no ha sido informada (p_bukrs), emitir mensaje de error.


 Si está informada validar su existencia contra la tabla
ZCO4D_ES_BUKAUAR.
 Si no existe, emitir error.
 Si el Periodo no está informado (p_perio), emitir mensaje de error.
 Si el Ejercicio no está informado (p_gjahr), emitir mensaje de error.
 Si el Nº de meses no está informado (p_numme), emitir mensaje de error.

o FORM F_PROCESO_PRINCIPAL

 Calcular, en función del campo p_numme de pantalla el periodo dentro del


cual se admiten los objetos con status “CERR”.

 Día de inicio del periodo: Llamar al MF


“RP_CALC_DATE_IN_INTERVAL” con los parámetros:

  CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
    EXPORTING
      date      = lv_date

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
14 34
Information and Communication Technology
Unit / Unit

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.

Siendo lv_date el primer día del periodo/año informado en pantalla.

 Día de fin del periodo: Llamar al MF “LAST_DAY_OF_MONTHS” con


los parámetros:

  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.

 Obtener los avisos con el siguiente SELECT ... INNER JOIN:

  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).

 Si no se obtienen registros, salir.

 Obtener la información de los avisos de la tabla QMEL en gt_qmel para


todas las entradas de la tabla interna obtenida en el paso anterior.
 Obtener las órdenes asociadas a los avisos de la tabla AUFK en lt_aufk
para todas las entradas de la tabla interna obtenida en el paso anterior.
 Si no se obtienen registros, emitir el mensaje de error
“No existen ordenes de Clase F9/F9S para los criterios de selección”
 Obtener los estados de la tabla JEST en gt_jest para todas las entradas de
la tabla interna obtenida lt_aufk y cuyo campo stat tenga los valores
“LIBRE”, “CTEC” O “CERR”.
 Comprobar los status de ls ordenes contenidas en la tabla gt_zaviso
cargado las tablas de status de los objetos para usuario y sistema, mediante
el MF “Z_XK_STATUS_OBJETO”. Si el status de usuario no es “ANN
(Anulado)”, continuar, si no, volver siguiente en el bucle.

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
15 34
Information and Communication Technology
Unit / Unit

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'.

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
16 34
Information and Communication Technology
Unit / Unit

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 Recorrer estos WBEs de nivel 1 y, por cada registro que


tenga status “PTC”, obtener los WBEs de nivel 2 de la
estructura (los que no sean “PTC” se ignorarán). 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.
Para ello, usar la SELECT ... INNER JOIN:

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 Recorrer estos WBEs de nivel 2 y ejecutar el MF


“F_CARGAR_COSTES_GRAFO_PLANIF”, definida mas
adelante.

 Si no se han obtenido registros en la tabla gt_reg de importes a imputar,


emitir el error correspondiente.
 Recorrer la tabla gt_reg y, por cada nuevo código de aviso (qmnum), llamar
a los MF siguientes: “F_CALCULAR_PORCENTAJE” y
“F_LLENAR_REG_DATOS US”, definidos más adelante y llamar a la
subrutina “F_LANZAR_BI” del INCLUDE “ZCO4D_ES_I_CC_ZWCIF795”,
cuyo diseño técnico excede del ámbito de este documento por pertenecer a
otro desarrollo, al tratarse de una copia del “ZWCIF795” ya existente.

o FORM F_CARGAR_COSTES_CS_PLANIF

 Seleccionar las operaciones asociadas a la orden CS y sus costes


planificados con las SELECT INNER ... JOIN siguientes:

  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.

 Recorrer la tabla gt_rpsco y acumular los costes contenidos en los campos


WLPXX, donde “XX” irá de 01 a 12.
 Si el importe es cero, continuar la siguiente iteración.

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
17 34
Information and Communication Technology
Unit / Unit

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.

 Si no es cero, cargar un registro del ALV de la tabla gt_alv (con la estructura


“ZCO4D_ES_S_C_COST_PROY_EXT_ALV”) con toda la información de la
estructura definida mas arriba con los datos del aviso, orden cs,
descripciones de las mismas, importes, etc. y cargar un registro en la tabla
GT_REG con la información obtenida.

o FORM F_CARGAR_COSTES_GRAFO_PLANIF

 Seleccionar los WBEs asociados al WBE de nivel 2 recibido por parámetro, y


los costes planificados de sus opperaciones, con las SELECT INNER ... JOIN
siguientes:

  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.

 Recorrer la tabla de operaciones y, por cada registro:

 Comprobar que el status de sistema del objeto sea "LIB." o "CTEC"


y no estén marcados para borrar (PTBO) o bloqueados (BLOQ).

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
18 34
Information and Communication Technology
Unit / Unit

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.

 Recorrer la tabla gt_rpsco para cada operación y acumular los


costes contenidos en los campos WLPXX, donde “XX” irá de 01 a
12.
 Si el importe es cero, continuar la siguiente iteración.
 Si no es cero, cargar un registro del ALV de la tabla gt_alv (con la
estructura “ZCO4D_ES_S_C_COST_PROY_EXT_ALV”) con toda la
información de la estructura definida mas arriba con los datos del
aviso, orden cs, descripciones de las mismas, importes, etc. y cargar
un registro en la tabla GT_REG con la información obtenida.

o FORM F_CALCULAR_PORCENTAJE

 Recorrer la tabla gt_reg obtenida para el aviso, clase de coste y sociedad gl


del registro pasado por parámetro e ir acumulando en una variable los costes
plan de los registros seleccionados (lv_tot_ppto_aviso).
 Recorrer la tabla gt_saldos para el código de aviso pasado por parámetro y
acumular en una variable (lv_imp_tot_aviso).
 Recorrer de nuevo la tabla gt_reg para el aviso pasado por parámetro. Por
cada registro:
 Leer de la tabla gt_aufk el registro para la orden F9S del aviso y la
clase de coste y sociedad gl del registro pasado por parámetro.
 Si el importe leído en gt_aufk es menor que cero, cargar el campo
“signo” de gt_reg con “-“.
 Cargamos en el campo importe a contabilizar el resultado de la
fórmula:

gt_reg-imp_tras = gs_aufk_imp-imp_orden * ( gt_reg-zzpptoapa /


lv_tot_ppto_aviso ).

 Cargamos el campo procentaje con el resultado de la fórmula:

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

 Copiaremos gt_reg en otra tabla interna gt_reg_2 y la ordenaremos por


zzaviso+kstar+vbund.
 Recorremos gt_reg_2 para el aviso pasado por parámetro. Por cada registro,
y cada vez que cambie la clase de coste (kstar) p la Sociedad GL (vbund):
 Leemos el registro en gt_saldos para el aviso, clase de coste y
sociedad GL.
 Obtendremos los campos sociedad (bukrs) y moneda (waers) de aufk
para la orden F9S del aviso.
 Cargar los campos de reg_datos:

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
19 34
Information and Communication Technology
Unit / Unit

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)

 Si el campo gt_reg_2-vornr está vacío, cargar el campo aufnr en el


campo orden de reg_datos.
reg_datos-import = gs_saldos-saldo (sin puntos ni comas)
 Si el campo autyp de aufk es ‘20’, cargar los campos graf y oper de
reg_datos con aufnr y vornr de gt_reg_2, respectivamente
 Si el campo autyp de aufk es ‘30’ y no estamos en modo Test,
comprobar que el status del objnr de gt_reg_2 no es ‘CERR’. Si lo
fuera, revertir el status a “CTEC’ mediante la función:

  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.

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
20 34
Information and Communication Technology
Unit / Unit

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.

 Si la tabla reg_datos tiene registros, realizar llamadas a las subrutinas:


* Borramos los batch input erróneos antiguos
    CONCATENATE 'E' '%' sy-repid+3(5) INTO w_batch.    PE
RFORM borrar_batch_err USING w_batch.
* Lanzamos el programa de contabilidad
    PERFORM interfase_zwcif795.

o FORM F_MOSTRAR_ALV.

 Cargar el catálogo de campos mediante la llamada al MF:

  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.

 Mostrar el ALV mediante la llamada al MF:

  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):

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
21 34
Information and Communication Technology
Unit / Unit

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.7. Clase de Mensajes.

o Definir una Clase de mensajes ZCO4D_ES_CM_C_P_EXT, con el siguiente


contenido:

Nº Texto breve de Mensaje


000 &&&&
001 El campo & es obligatorio
002 La sociedad & no está activa
003 La sociedad & no está permitida
004 No existen Ordenes de Clase F9/F9S para los criterios de selección
005 Orden & sin Aviso de Servicio ZX/ZK informado
006 Ninguna Orden cumple los criterios de Status y/o Aviso
007 Imposible determinar status para el aviso & Orden &
008 No hay saldo acumulado pa la Orden &
009 No existen clases de ordenes autorizadas para Contabilización Proy. Ext.
010 No se ha encontrado ningún objeto de reparto final para el Aviso &
011 No hay costes reales para la Orden & y se han tomado planificados
012 No hay costes reales para el WBE niv.2 & y se han tomado planificados
013 Orden CS & rechazada por status de sistema &
014 WBE Nivel & & rechazado por status de sistema &
015 Imposible determinar status para el aviso & WBE &
016 Imposible determinar status para la operación &
017 Operación & Orden & rechazada por status de sistema &
018 Operación & WBE & rechazada por status de sistema &

3.3. REPARTO DE LOS COSTES COMUNES.

3.3.1. Objetos.

3.3.1.1. Estructuras.

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
22 34
Information and Communication Technology
Unit / Unit

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

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
23 34
Information and Communication Technology
Unit / Unit

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.

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
TEXTO_ERRO ZCO4D_ES_ED_TEXT_ERR CHAR 100 0 Resultado final
R
CLASE_ORD_D AUFART CHAR 4 0 Clase de Orden
EST
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.3.1.2. Transacción.

 Transacción ZCO4D_TR_REPCOSTCOM.

o Lanzará el Programa ZCO4D_ES_P_REPARTO_COST_COM

3.3.1.3. Report.

 Report ZCO4D_ES_P_REPARTO_COST_COM

o Contendrá los siguientes INCLUDES:

 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.

 Include ZCO4D_ES_P_REPARTO_COST _TOP. Definiciones globales:

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
24 34
Information and Communication Technology
Unit / Unit

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.

 Tipo para costes de las operaciones y órdenes:

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.

 Tipo para saldos de peps:

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.

 Tipo para WBEs:

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,

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
25 34
Information and Communication Technology
Unit / Unit

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.

 Tipo para WBEs niveles 3 y 4:

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.

 Tipo para WBE-Clase de Coste:

TYPES: BEGIN OF gty_w_c,
         posid TYPE ps_posid,
         kstar TYPE kstar.
TYPES: END OF gty_w_c.

 Tipo para Operaciones:

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.

 Tipo para Ponderación de WBE4:

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.

 Tipo para Descripciones de clases de coste:

TYPES: BEGIN OF gty_csku,
         kstar TYPE j_objnr,
         ltext TYPE kltxt.
TYPES: END OF gty_csku.

 Tipo para Perfiles:

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
26 34
Information and Communication Technology
Unit / Unit

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.

 Tipo para Proyectos:

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,

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
27 34
Information and Communication Technology
Unit / Unit

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_EVE. Definiciones globales:

o Evento INICIALIZATION. Invocar la subrutina F_INICIALIZAR, definida mas


adelante.
o Evento START-OF-SELECTION. Invocar la subrutina F_VALIDAR_CRITERIOS,
definida mas adelante.
 Si la subrutina no devuelve error, invocar a la subrutina
F_PROCESO_PRINCIPAL, definida mas adelante.
 Se devuelve error, vovler a la pantalla de Criterios de Selección y mostrar el
error recibido.
 Si no se está ejecutando en job de fondo (variable del sistems sy-batch sin
valor informado), invocar a la subrutina F_MOSTRAR_ALV, definida más
adelante.

 Include ZCO4D_ES_I_CONTA_COST_SEL.

o Definir aqui la pantalla de criterios de selección para que tenga el formato siguiente:

o Definir los PARAMETERS y SELECT-OPTIONS siguientes:

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.

Definir las subrutinas siguientes y su contenido:

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
28 34
Information and Communication Technology
Unit / Unit

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.

 Llamar repetidamente al MF “ZALL4D_FM_GET_TVARVC” pasándole los


distintos valores con objeto de cargar en las variables definidas en el TOP
para contener los valores de la tabla de HARDCODE.
 
 CALL FUNCTION 'ZALL4D_FM_GET_TVARVC'
    EXPORTING
      var_name         = {valor clave del hardcode}
      var_type         = 'P'
    CHANGING
      var_parameter    = {variable a cargar}
*     VAR_SELOPT       =
    EXCEPTIONS
      var_not_existent = 1
      OTHERS           = 2.

Según los valores de la tabla siguiente:

VAR_NAME VAR_PARAMETER VARIABLE


ZCO4D_ST_SI_BLOQ I0043 GV_BLOQ
ZCO4D_ST_SI_CTE CTEC GV_CTE
ZCO4D_ST_SI_LIB LIB. GV_LIB
ZCO4D_ST_SI_LIBP LIBP GV_LIBP
ZCO4D_ST_SI_PTBO PTBO GV_PTBO
ZCO4D_ST_SI_PTBO1 I0076 GV_PTBO1
ZCO4D_ST_SI_PTBO2 I0805 GV_PTBO2
ZCO4D_ST_US_ANN ANN GV_ANN
ZCO4D_ST_US_CERR I0046 GV_CERR
ZCO4D_ST_US_CTEC I0045 GV_CTEC
ZCO4D_ST_US_LIBE I0002 GV_LIBE
ZCO4D_ST_US_PTC PTC GV_PTC
ZCO4D_ST_US_RIL RIL GV_RIL
ZCO4D_TIP_ADS_ZK ZK GV_ZK
ZCO4D_TIP_ADS_ZX ZX GV_ZX

o FORM F_VALIDAR_CRITERIOS.

 Si la Sociedad no ha sido informada (p_bukrs), emitir mensaje de error.


 Si está informada validar su existencia contra la tabla ZCO4D_ES_KSTAR.
 Si no existe, emitir error.
 Si el Periodo no está informado (p_perio), emitir mensaje de error.
 Si el Ejercicio no está informado (p_gjahr), emitir mensaje de error.

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
29 34
Information and Communication Technology
Unit / Unit

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 los perfiles para la Sociedad de la tabla ZCO4D_ES_KSTAR.


 Obtener los proyectos para todas la sentradas de la tabla de perfiles.
 Obtener los WBE de nivel 2 en gt_wbe2 de la tabla PRPS para todas las
entradas de la tabla anterior cuyo campo belkz sea = abap_true y psphi =
pspnr de dicha tabla.
 Obtener todos los WBE de nivel 3 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 TA
BLE gt_wbe3
    FROM prps AS a INNER JOIN
         prhi AS b
    ON a~pspnr = b~posnr
    FOR ALL ENTRIES IN gt_wbe2
    WHERE b~up = gt_wbe2-pspnr.
  CHECK sy-subrc = 0.

 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

 Ejecutar los performs siguientes del INCLUDE “ZWCIF795”, cuyo diseño


técnico excede del ámbito de este documento por pertenecer a otro
desarrollo.

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
30 34
Information and Communication Technology
Unit / Unit

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.

4. Interfaces ande integration flows


N.A

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
31 34
Information and Communication Technology
Unit / Unit

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

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
32 34
Information and Communication Technology
Unit / Unit

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

6.2. Control Mechanisms


N.A

6.3. Error Management


N.A

6.4. Mechanism for information management


N.A

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
33 34
Information and Communication Technology
Unit / Unit

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.

List of acronyms. Full description of each abbreviation adopted.


Acrónimo Descripción
VPN Virtual Private Network
ICT Information and Communication Technology
IDS Intrusion Detection System
WLS WebLogic Server
Windows XP Windows XP Service Pack2/Service Pack 3
SP2/SP3
IE8 Internet Explorer 8
SOA Service-Oriented Architecture
SAP RFC SAP Remote Function Call
SAP IDOC SAP Intermediate Document
SAP JCO SAP Java Connector
SOAP Simple Object Access Protocol
XML eXtensible Markup Language
ETL Extraction, Transformation and Loading
WS Web Service

Tabla 1 – Definitions, acronyms, abbreviations

Index of figures and tables


B.Figures

Tabla 1 – Definiciones, acrónimo, abreviatura...........................................................................11

C.Tables

Table 1 – Definitions, acronyms, abbreviations..........................................................................10

REPRODUCTION FORBIDDEN Internal Use


Template Document Type Document Title Document Code Version and Date File ID Pag. Of
SGI-MTC-03C-EN_01 490031245.docx 0000-XX00 Version, 1.0./Borrador CR_ES_A_018
34 34

You might also like