Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
************************************************************************
* INFORMACIN GENERAL
************************************************************************
*^ Mdulo : FI
************************************************************************
REPORT zfir_fi100.
TYPE-POOLS: zf100.
zf100_tables.
zf100_selection_screen.
zf100_at_selection_screen.
zf100_initialization.
INCLUDE zfir_fi100_definition.
INCLUDE zfir_fi100_implementation.
START-OF-SELECTION.
EXPORTING
a_bukrs = p_bukrs
a_gjahr = p_gjahr
a_monat = r_monat[].
IF obj_fi100 IS BOUND.
obj_fi100->generando_procesos(
EXPORTING
i_bukrs = p_bukrs
i_postm = p_postm
i_gjahr = p_gjahr
1
CDIGO ABAP - Formulario de Libro de Rgimen de Percepcin
i_monat = r_monat[]
i_kunnr = r_kunnr[]
i_witht = r_witht[]
i_withcd = r_withcd[]
CHANGING
i_budat = r_budat[]
).
ENDIF.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
PUBLIC SECTION.
*************************************************************************
METHODS:
*************************************************************************
*************************************************************************
*************************************************************************
2
CDIGO ABAP - Formulario de Libro de Rgimen de Percepcin
*************************************************************************
*************************************************************************
*************************************************************************
*************************************************************************
PRIVATE SECTION.
zf100_types.
ENDCLASS.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
3
CDIGO ABAP - Formulario de Libro de Rgimen de Percepcin
METHOD constructor.
me->obtener_datos_empresa(
EXPORTING
o_bukrs = a_bukrs
o_gjahr = a_gjahr
o_monat = a_monat[]
CHANGING
o_cabecera = gw_cabecera
).
ENDMETHOD.
METHOD obtener_datos_empresa.
***@ Periodo
IF lr_monat-low EQ lr_monat-high
OR lr_monat-high IS INITIAL.
lv_mes = lr_monat-low.
EXPORTING
language = sy-langu
month_number = lv_mes
IMPORTING
langu_back = sy-langu
shorttext = lv_stxt
longtext = lv_ltxt1.
4
CDIGO ABAP - Formulario de Libro de Rgimen de Percepcin
ELSE.
lv_mes = lr_monat-low.
EXPORTING
language = sy-langu
month_number = lv_mes
IMPORTING
langu_back = sy-langu
shorttext = lv_stxt
longtext = lv_ltxt1.
lv_mes = lr_monat-high.
EXPORTING
language = sy-langu
month_number = lv_mes
IMPORTING
langu_back = sy-langu
shorttext = lv_stxt
longtext = lv_ltxt2.
ENDIF.
***@ Ruc
FROM t001z
5
CDIGO ABAP - Formulario de Libro de Rgimen de Percepcin
FROM t001
IF sy-subrc EQ 0.
FROM adrc
IF sy-subrc EQ 0.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD obtener_rango_fechas.
lr_budat-sign = 'I'.
lr_budat-option = 'BT'.
ELSE.
lr_budat_aux-low = lr_budat-low.
ENDIF.
EXPORTING
6
CDIGO ABAP - Formulario de Libro de Rgimen de Percepcin
day_in = lr_budat_aux-low
IMPORTING
last_day_of_month = lr_budat-high
EXCEPTIONS
day_in_no_date = 1
others = 2.
IF sy-subrc EQ 0.
ENDIF.
ENDMETHOD.
METHOD obtener_datos_generales.
EXPORTING
p_sociedad = x_bukrs
wt_inst_contab = x_postm
TABLES
r_budat = x_budat
r_kunnr = x_kunnr
r_witht = x_witht
r_withcd = x_withcd
gt_rfpos_wt = x_rfpos_wt.
ENDMETHOD.
METHOD generando_procesos.
me->obtener_rango_fechas(
EXPORTING
e_gjahr = i_gjahr
e_monat = i_monat[]
CHANGING
e_budat = i_budat[]
).
me->obtener_datos_generales(
EXPORTING
7
CDIGO ABAP - Formulario de Libro de Rgimen de Percepcin
x_bukrs = i_bukrs
x_postm = i_postm
x_kunnr = i_kunnr[]
x_budat = i_budat[]
x_witht = i_witht[]
x_withcd = i_withcd[]
CHANGING
x_rfpos_wt = gt_rfpos_wt[]
).
me->generar_det_percepciones(
EXPORTING
u_kunnr = i_kunnr[]
u_budat = i_budat[]
u_rfpos_wt = gt_rfpos_wt[]
CHANGING
u_det_perc = gt_det_perc[]
).
me->generar_formulario_impr(
EXPORTING
y_cabecera = gw_cabecera
y_det_perc = gt_det_perc[]
).
ENDMETHOD.
METHOD generar_det_percepciones.
lv_rsocial(40) TYPE c.
8
CDIGO ABAP - Formulario de Libro de Rgimen de Percepcin
lt_rfpos_wt[] = u_rfpos_wt[].
*Datos de Compensacin
FROM bsad
IF sy-subrc EQ 0.
ENDIF.
CLEAR: lv_rsocial.
IF <lfs_det_perc> IS ASSIGNED.
* Cod Cliente
<lfs_det_perc>-cod_cli = <lfs_rfpos_wt>-wt_acco.
<lfs_det_perc>-documento = <lfs_rfpos_wt>-belnr.
* Razn Social
IF <lfs_rfpos_wt>-wt_acco_stcd1+0(1) = '1'.
CONDENSE: <lfs_rfpos_wt>-wt_acco_name1,
<lfs_rfpos_wt>-wt_acco_name2,
<lfs_rfpos_wt>-wt_acco_name3.
9
CDIGO ABAP - Formulario de Libro de Rgimen de Percepcin
CONCATENATE <lfs_rfpos_wt>-wt_acco_name3
<lfs_rfpos_wt>-wt_acco_name1
<lfs_rfpos_wt>-wt_acco_name2
INTO <lfs_det_perc>-rsocial
SEPARATED BY space.
ELSE.
CONDENSE: <lfs_rfpos_wt>-wt_acco_name1,
<lfs_rfpos_wt>-wt_acco_name2.
CONCATENATE <lfs_rfpos_wt>-wt_acco_name1
<lfs_rfpos_wt>-wt_acco_name2
INTO <lfs_det_perc>-rsocial
SEPARATED BY space.
ENDIF.
lv_rsocial = <lfs_det_perc>-rsocial.
* F.Transaccin
<lfs_det_perc>-fctrans = <lfs_rfpos_wt>-bldat.
* Serie
<lfs_det_perc>-d_serie = <lfs_rfpos_wt>-xblnr+4(4).
* Nmero
<lfs_det_perc>-d_numero = <lfs_rfpos_wt>-xblnr+9.
* Porcentaje
<lfs_det_perc>-porcent = <lfs_rfpos_wt>-qsatz.
* Doc.Compensacin
<lfs_det_perc>-doc_compe = space.
IF <lfs_rfpos_wt>-wt_qsshh >= 0.
* Debe
ELSE.
* Haber
ENDIF.
* Saldo
* Percepcin
10
CDIGO ABAP - Formulario de Libro de Rgimen de Percepcin
ENDIF.
*****************************************************************************
belnr =
<lfs_rfpos_wt>-belnr.
IF <lfs_bsad> IS ASSIGNED.
UNASSIGN <lfs_det_perc>.
IF <lfs_det_perc> IS ASSIGNED.
* Cod Cliente
<lfs_det_perc>-cod_cli = <lfs_rfpos_wt>-wt_acco.
<lfs_det_perc>-documento = <lfs_rfpos_wt>-belnr.
* Razn Social
<lfs_det_perc>-rsocial = lv_rsocial.
* F.Transaccin
<lfs_det_perc>-fctrans = <lfs_bsad>-augdt.
* Serie
<lfs_det_perc>-d_serie = <lfs_rfpos_wt>-xblnr+4(4).
* Nmero
<lfs_det_perc>-d_numero = <lfs_rfpos_wt>-xblnr+9.
* Porcentaje
<lfs_det_perc>-porcent = space.
* Doc.Compensacin
<lfs_det_perc>-doc_compe = <lfs_bsad>-augbl.
IF <lfs_bsad>-shkzg EQ 'S'.
* Debe
ELSE.
* Haber
ENDIF.
* Saldo
11
CDIGO ABAP - Formulario de Libro de Rgimen de Percepcin
<lfs_det_perc>-saldo = space.
* Percepcin
<lfs_det_perc>-percepcion = space.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD generar_formulario_impr.
ls_control_param-getotf = ''.
ls_control_param-no_dialog = 'X'.
ls_control_param-preview = 'X'.
ls_output_param-tdnoprint = ''.
ls_output_param-tdimmed = ''.
ls_output_param-tddelete = ''.
ls_output_param-tddest = 'LP01'.
ls_output_param-tdnewid = ''.
ls_output_param-tdnoprev = ''.
ls_formname = 'ZSSF_FI100'.
lt_det_perc[] = y_det_perc[].
EXPORTING
formname = ls_formname
12
CDIGO ABAP - Formulario de Libro de Rgimen de Percepcin
IMPORTING
fm_name = ls_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3
IF sy-subrc <> 0.
ELSE.
EXPORTING
control_parameters = ls_control_param
output_options = ls_output_param
w_cabecera = y_cabecera
TABLES
t_detalle = lt_det_perc
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
ENDIF.
ENDMETHOD.
ENDCLASS.
13