Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 14.01 KB | None | 0 0
  1. *&---------------------------------------------------------------------*
  2. *&  Include           Z_AF_AJUSTES_NIIF_ENEL_TOP                       *
  3. *&---------------------------------------------------------------------*
  4.  
  5.  
  6. "--------------------------------------------------------------------
  7. * ------------------ Definición de tablas------------------ .
  8. "--------------------------------------------------------------------
  9.  
  10. TABLES: anla, anlav, anlc.
  11.  
  12.  
  13. "--------------------------------------------------------------------
  14. " ------------------ Definición de variables ------------------
  15. "--------------------------------------------------------------------
  16.  
  17. TYPE-POOLS: slis.
  18.  
  19. " Permite utilizar el encoding de abap.
  20. TYPE-POOLS: abap.
  21.  
  22. DATA:
  23.   "gv_af_it_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
  24.   gv_af_it_fieldcat TYPE STANDARD TABLE OF slis_fieldcat_alv,
  25.   gv_af_wa_fieldcat TYPE slis_fieldcat_alv,
  26.   gs_layout TYPE slis_layout_alv,
  27.   repid LIKE sy-repid,
  28.   gv_events TYPE slis_t_event,
  29.   gs_disvariant LIKE disvariant,
  30.   gv_af_mes_en_curso(2) TYPE N,
  31.   d_sortcat TYPE slis_t_sortinfo_alv,
  32.   wa_sort TYPE slis_sortinfo_alv.
  33.   "gv_af_fecha_imputacion TYPE sy-datum.
  34.  
  35. DATA: gv_af_anio_en_curso LIKE sy-datum."#EC NEEDED
  36. DATA: gv_exit."#EC NEEDED
  37.  
  38. DATA: gv_pool_trabajo(2) TYPE c. "Valor único
  39. DATA: gv_variante_clasificacion TYPE c.
  40. "--------------------------------------------------------------------
  41. " Permite llevar la cuenta  de los distintos periodos, info útil a la
  42. " hora de armar el reporte.
  43. "--------------------------------------------------------------------
  44. DATA: gv_cont_periodo TYPE i.
  45.  
  46. "--------------------------------------------------------------------
  47. " Rango que contiene la cant. de ejercicios contables.
  48. "--------------------------------------------------------------------
  49. RANGES : gv_rango_ejercicios FOR anla-bukrs.
  50.  
  51. "--------------------------------------------------------------------
  52. " Rango para comparar los AF de un ejercicio.
  53. "--------------------------------------------------------------------
  54. RANGES: r_periodo FOR anlp-gjahr.
  55.  
  56. "--------------------------------------------------------------------
  57. " Constantes.
  58. "--------------------------------------------------------------------
  59. CONSTANTS:
  60.   gc_af_explo_inicio TYPE p VALUE 300000000000,
  61.   gc_af_explo_fin TYPE p VALUE 400000000000,
  62.   gc_fecini(8) TYPE c VALUE '20090101',
  63.   gc_datab_aei(8) TYPE c VALUE '20071001',
  64.   gc_afabe_aei_low(2) TYPE c VALUE '01',
  65.   gc_afabe_aei_high(2) TYPE c VALUE '40',
  66.   gc_datab_aes(8) TYPE c VALUE '20090107',
  67.   gc_afabe_aes_low(2) TYPE c VALUE '51',
  68.   gc_afabe_aes_high(2) TYPE c VALUE '54',
  69.   gc_datab_ans_low(8) TYPE c VALUE '20100101',
  70.   gc_datab_ans_high(8) TYPE c VALUE '99991231',
  71.   gc_afabe_ans_low(2) TYPE c VALUE '52',
  72.   gc_afabe_ans_high(2) TYPE c VALUE '54'.
  73.  
  74. "--------------------------------------------------------------------
  75. " Definimos estructuras.
  76. "--------------------------------------------------------------------
  77. TYPES: BEGIN OF estructura ,
  78.     bukrs   LIKE anla-bukrs,      " Sociedad
  79.     anln1   LIKE anla-anln1,      " Nro. AF
  80.     anln2   LIKE anla-anln2,      " Sub. AF
  81.     gjahr   LIKE anlc-gjahr,      " Ejercicio
  82.     afabe   LIKE anlc-afabe,      " Área de Valoración
  83.     anlkl   LIKE anla-anlkl,      " Clase AF
  84.     gsber   LIKE anlav-gsber,     " Division
  85.     kostl   LIKE anlav-kostl,     " CeCo
  86.     werks   LIKE anlav-werks,     " Centro
  87.     stort   LIKE anlav-stort,     " Emplazamiento
  88.     anlue   LIKE anlav-anlue,     " Supra Activo
  89.     pspid   LIKE anlav-pspid,     " PEP
  90.     kansw   LIKE anlc-kansw,      " Valor adq. acumulado
  91.     kinvz   LIKE anlc-kinvz,      " Subvención acum.
  92.     answl   LIKE anlc-answl,      " Movimientos cuenta balance
  93.     invzm   LIKE anlc-invzm,      " Subvención
  94.     nafap   LIKE anlp-nafap,      " Amort. planificada.
  95.     nafag   LIKE anlp-nafag,      " Amort. contabilizada en el eje.
  96.     nafaz   LIKE anlp-nafaz,      " Amort. normal a contabilizar.
  97.     "belnr   LIKE anlp-belnr,     " Nro. de documento.
  98.     inversion LIKE anlc-kansw,    " Inversion del periodo
  99.     amortizacion LIKE anlp-nafag, " Amortizacion acum.
  100.     budat LIKE bkpf-budat,        " Fecha de contab.
  101.     lnran LIKE anek-lnran,        " Nº actual de partida individual de activo fijo en ejercicio
  102.     monat LIKE anek-monat,        " Mes Contable
  103.     glvor LIKE anek-glvor,        " Operación empresarial
  104.     obart LIKE anek-obart,        " Clase del objeto emisor en la liquidación
  105.     objid LIKE anek-objid,        " Número del objeto emisor
  106.     belnr LIKE anek-belnr,        " Número documento de referencia
  107.     buzei LIKE anek-buzei,        " Número del apunte contable dentro del documento contable
  108.     bzdat LIKE anek-bzdat,        " Fecha de referencia
  109.     awtyp LIKE anek-awtyp,        " Operación de referencia
  110. END OF estructura.
  111.  
  112. " Gestion consulta c
  113. TYPES: BEGIN OF estructura_cc ,
  114.   bukrs LIKE anla-bukrs,  " Sociedad
  115.   anln1 LIKE anla-anln1,  " Nro. AF
  116.   anln2 LIKE anla-anln2,  " Sub. AF
  117.   lnran LIKE anek-lnran,  " Nº actual de partida individual de activo fijo en ejercicio
  118.   monat LIKE anek-monat,  " Mes Contable
  119.   glvor LIKE anek-glvor,  " Operación empresarial
  120.   obart LIKE anek-obart,  " Clase del objeto emisor en la liquidación
  121.   objid LIKE anek-objid,  " Número del objeto emisor
  122.   belnr LIKE anek-belnr,  " Número documento de referencia
  123.   buzei LIKE anek-buzei,  " Número del apunte contable dentro del documento contable
  124.   bzdat LIKE anek-bzdat,  " Fecha de referencia
  125.   awtyp LIKE anek-awtyp,  " Operación de referencia
  126.   END OF estructura_cc.
  127.  
  128. " Gestion consulta d: pep
  129. TYPES: BEGIN OF estructura_cd_pep ,
  130.   pspel LIKE AUFK-PSPEl,
  131.   aufnr LIKE AUFK-AUFNR,
  132. END OF estructura_cd_pep.
  133.  
  134. " Gestion consulta d: ord
  135. TYPES: BEGIN OF estructura_cd_ord,
  136.   pspel LIKE AUFK-PSPEl,
  137.   objnr LIKE AUFK-OBJNR,
  138.   relevante(2) TYPE c,
  139. END OF estructura_cd_ord.
  140.  
  141. " Gestion consulta d: ord
  142. TYPES: BEGIN OF estructura_cd_cosp,
  143.   objnr LIKE AUFK-OBJNR,
  144. END OF estructura_cd_cosp.
  145.  
  146. " Gestion consulta e - f
  147. TYPES: BEGIN OF estructura_e_f,
  148.   BUKRS LIKE ANEP-BUKRS,
  149.   ANLN1 LIKE ANEP-ANLN1,
  150.   ANLN2 LIKE ANEP-ANLN2,
  151.   AFABE LIKE ANEP-AFABE,
  152.   BELNR LIKE ANEP-BELNR ," Nº documento
  153.   BWASL LIKE ANEP-BWASL ," Clase mov.
  154.   ANBTR LIKE ANEP-ANBTR ," Importe Contabilizado
  155. END OF estructura_e_f.
  156.  
  157. "--------------------------------------------------------------------
  158. " Definimos tabla interna para el área de selección.
  159. "--------------------------------------------------------------------
  160. TYPES: BEGIN OF estructura_informe ,
  161.   "--------------------------------------------------------------------
  162.   " Datos comunes I.
  163.   "--------------------------------------------------------------------
  164.     bukrs   LIKE anla-bukrs,  " Sociedad
  165.     anln1   LIKE anla-anln1,  " Nro. AF
  166.     anln2   LIKE anla-anln2,  " Sub. AF
  167.     anlkl   LIKE anla-anlkl,  " Clase AF
  168.     gsber   LIKE anlav-gsber, " Division
  169.     kostl   LIKE anlav-kostl, " CeCo
  170.     werks   LIKE anlav-werks, " Centro
  171.     stort   LIKE anlav-stort, " Emplazamiento
  172.     anlue   LIKE anlav-anlue, " Supra Activo
  173.     pspid   LIKE anlav-pspid, " PEP
  174.     afabe   LIKE anlc-afabe,  " Área de Valoración
  175.     gjahr   LIKE anlc-gjahr,  " Ejercicio
  176.   "--------------------------------------------------------------------
  177.   " Datos del ejercicio
  178.   "--------------------------------------------------------------------
  179.     " 1
  180.     inversion_curso_1 LIKE anlc-kansw,
  181.     inversion_explo_1 LIKE anlc-kansw,
  182.     amortiza_explo_1 LIKE anlp-nafag,
  183.     " 2
  184.     inversion_curso_2 LIKE anlc-kansw,
  185.     inversion_explo_2 LIKE anlc-kansw,
  186.     amortiza_explo_2 LIKE anlp-nafag,
  187.     " 3
  188.     inversion_curso_3 LIKE anlc-kansw,
  189.     inversion_explo_3 LIKE anlc-kansw,
  190.     amortiza_explo_3 LIKE anlp-nafag,
  191.     " 4
  192.     inversion_curso_4 LIKE anlc-kansw,
  193.     inversion_explo_4 LIKE anlc-kansw,
  194.     amortiza_explo_4 LIKE anlp-nafag,
  195.     " 5
  196.     inversion_curso_5 LIKE anlc-kansw,
  197.     inversion_explo_5 LIKE anlc-kansw,
  198.     amortiza_explo_5 LIKE anlp-nafag,
  199.     " 6
  200.     inversion_curso_6 LIKE anlc-kansw,
  201.     inversion_explo_6 LIKE anlc-kansw,
  202.     amortiza_explo_6 LIKE anlp-nafag,
  203.     " 7
  204.     inversion_curso_7 LIKE anlc-kansw,
  205.     inversion_explo_7 LIKE anlc-kansw,
  206.     amortiza_explo_7 LIKE anlp-nafag,
  207.     " 8
  208.     inversion_curso_8 LIKE anlc-kansw,
  209.     inversion_explo_8 LIKE anlc-kansw,
  210.     amortiza_explo_8 LIKE anlp-nafag,
  211.     " 9
  212.     inversion_curso_9 LIKE anlc-kansw,
  213.     inversion_explo_9 LIKE anlc-kansw,
  214.     amortiza_explo_9 LIKE anlp-nafag,
  215.     " 10
  216.     inversion_curso_10 LIKE anlc-kansw,
  217.     inversion_explo_10 LIKE anlc-kansw,
  218.     amortiza_explo_10 LIKE anlp-nafag,
  219.     " Actual
  220.     inversion_curso_actual LIKE anlc-kansw,
  221.     inversion_explo_actual LIKE anlc-kansw,
  222.     amortiza_explo_actual_p1 LIKE anlp-nafag,
  223.     amortiza_explo_actual_p2 LIKE anlp-nafag,
  224.     amortiza_explo_actual_p3 LIKE anlp-nafag,
  225.     amortiza_explo_actual_p4 LIKE anlp-nafag,
  226.     amortiza_explo_actual_p5 LIKE anlp-nafag,
  227.     amortiza_explo_actual_p6 LIKE anlp-nafag,
  228.     amortiza_explo_actual_p7 LIKE anlp-nafag,
  229.     amortiza_explo_actual_p8 LIKE anlp-nafag,
  230.     amortiza_explo_actual_p9 LIKE anlp-nafag,
  231.     amortiza_explo_actual_p10 LIKE anlp-nafag,
  232.     amortiza_explo_actual_p11 LIKE anlp-nafag,
  233.     amortiza_explo_actual_p12 LIKE anlp-nafag,
  234.   "--------------------------------------------------------------------
  235.   " Datos comunes II.
  236.   "--------------------------------------------------------------------
  237.     inversion_curso_total LIKE anlc-kansw,  " Inversion del periodo
  238.     inversion_explo_total LIKE anlc-kansw,
  239.     amortizacion_total LIKE anlp-nafag,     " Amortizacion acum.
  240.     porcentaje_amortizacion LIKE anlp-nafag,
  241.     amortizacion LIKE anlp-nafag,           " Amortizacion acum.
  242.     kansw   LIKE anlc-kansw,                " Valor adq. acumulado
  243.     kinvz   LIKE anlc-kinvz,                " Subvención acum.
  244.     answl   LIKE anlc-answl,                " Movimientos cuenta balance
  245.     invzm   LIKE anlc-invzm,                " Subvención
  246.     nafap   LIKE anlp-nafap,                " Amort. planificada.
  247.     nafag   LIKE anlp-nafag,                " Amort. contabilizada en el eje.
  248.     nafaz   LIKE anlp-nafaz,                " Amort. normal a contabilizar.
  249.     belnr   LIKE anlp-belnr,                " Nro. de documento.
  250.     inversion LIKE anlc-kansw,              " Inversion del periodo
  251.     budat LIKE bkpf-budat,                  "Fecha de contab.
  252. END OF estructura_informe.
  253.  
  254. "--------------------------------------------------------------------
  255. " ------------- Declaracion de tipos tabla internas -----------------
  256. "--------------------------------------------------------------------
  257.  
  258. TYPES: it_estructura          TYPE STANDARD TABLE OF estructura.
  259. TYPES: it_estructura_informe  TYPE STANDARD TABLE OF estructura_informe.
  260. TYPES: it_estructura_cc       TYPE STANDARD TABLE OF estructura_cc.
  261. TYPES: it_estructura_cd_pep   TYPE STANDARD TABLE OF estructura_cd_pep.
  262. TYPES: it_estructura_cd_ord   TYPE STANDARD TABLE OF estructura_cd_ord.
  263. TYPES: it_estructura_cd_cosp  TYPE STANDARD TABLE OF estructura_cd_cosp.
  264. TYPES: it_estructura_ce_cf    TYPE STANDARD TABLE OF estructura_e_f.
  265.  
  266. "--------------------------------------------------------------------
  267. " ----------------- Declaracion de tablas internas -----------------
  268. "--------------------------------------------------------------------
  269. DATA:
  270.       gv_it_tabla_af TYPE it_estructura,
  271.       gv_it_tabla_af_aux TYPE it_estructura,
  272.       gv_it_tabla_af_aux_dos TYPE it_estructura,
  273.       gv_it_tabla_af_informe TYPE it_estructura_informe,
  274.       gv_wa_tabla_af_informe TYPE estructura_informe,
  275.       gv_wa_tabla_af TYPE estructura.
  276.  
  277. FIELD-SYMBOLS: <fs_gv_it_tabla_af> LIKE LINE OF gv_it_tabla_af.
  278. FIELD-SYMBOLS: <fs_gv_it_tabla_af_tmp> LIKE LINE OF gv_it_tabla_af.
  279. FIELD-SYMBOLS: <fs_gv_it_tabla_af_aux> LIKE LINE OF gv_it_tabla_af.
  280.  
  281. DATA: BEGIN OF  gv_it_tabla_af_cabecera OCCURS 0,
  282.   titulo(20) TYPE c,
  283. END OF gv_it_tabla_af_cabecera.
  284.  
  285.  
  286.  
  287. "--------------------------------------------------------------------
  288. " -------------- Definición de parámetros de selección --------------
  289. "--------------------------------------------------------------------
  290.  
  291. SELECTION-SCREEN BEGIN OF BLOCK b_cero WITH FRAME TITLE text-001.
  292.  
  293. SELECT-OPTIONS so_bukrs FOR anla-bukrs
  294.   NO-EXTENSION NO INTERVALS OBLIGATORY.
  295. SELECT-OPTIONS so_anln1 FOR anla-anln1.
  296. SELECT-OPTIONS so_anln2 FOR anla-anln2.
  297. SELECT-OPTIONS so_anlkl FOR anla-anlkl.
  298. SELECT-OPTIONS so_gsber FOR anlav-gsber.
  299. SELECT-OPTIONS so_kostl FOR anlav-kostl.
  300. SELECT-OPTIONS so_werks FOR anlav-werks.
  301. SELECT-OPTIONS so_stort FOR anlav-stort.
  302. SELECT-OPTIONS so_anlue FOR anlav-anlue.
  303. SELECT-OPTIONS so_pspid FOR anlav-pspid.
  304. PARAMETERS pa_pool LIKE gv_pool_trabajo .
  305.  
  306. SELECT-OPTIONS datab FOR sy-datum MODIF ID fc OBLIGATORY.
  307. SELECT-OPTIONS so_afabe FOR anlc-afabe MODIF ID av OBLIGATORY.
  308. SELECTION-SCREEN SKIP.
  309.  
  310. SELECTION-SCREEN BEGIN OF BLOCK b_tres WITH FRAME TITLE text-004.
  311. PARAMETERS variant LIKE disvariant-variant.
  312. PARAMETERS strvr LIKE gv_variante_clasificacion.
  313. SELECTION-SCREEN END   OF BLOCK b_tres.
  314. SELECTION-SCREEN END   OF BLOCK b_cero.
  315.  
  316. "--------------------------------------------------------------------
  317. " Opción de listado
  318. "--------------------------------------------------------------------
  319. SELECTION-SCREEN BEGIN OF BLOCK b_uno WITH FRAME TITLE text-002.
  320. PARAMETERS:
  321.   r_op_af RADIOBUTTON GROUP uno USER-COMMAND u_uno,
  322.   r_op_np RADIOBUTTON GROUP uno, "Sólo números principales.
  323.   r_op_tg RADIOBUTTON GROUP uno. "Sólo totales grupo.
  324. SELECTION-SCREEN END   OF BLOCK b_uno.
  325.  
  326. "--------------------------------------------------------------------
  327. " Ajustes de Informe
  328. "--------------------------------------------------------------------
  329. SELECTION-SCREEN BEGIN OF BLOCK b_dos WITH FRAME TITLE text-003.
  330. PARAMETERS:
  331.   r_aei RADIOBUTTON GROUP dos MODIF ID aei USER-COMMAND u_dos,
  332.   r_aes RADIOBUTTON GROUP dos MODIF ID aes,
  333.   r_ans RADIOBUTTON GROUP dos MODIF ID ans.
  334. PARAMETERS: fecini LIKE sy-datum VALUE CHECK MODIF ID fit.
  335. SELECTION-SCREEN END   OF BLOCK b_dos.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement