Difference between revisions of "SAP SD FAQ"
| Line 48: | Line 48: | ||
Al ejecutar la función en la tabla ZFPLT si aprece más de 2 registros y si es que estos registros tienen la misma fecha liquidación (ZFPLT-NFDAT) se debe sumar los registros del campo “Valor a Fact.” (ZFPLT-FAKWR). | Al ejecutar la función en la tabla ZFPLT si aprece más de 2 registros y si es que estos registros tienen la misma fecha liquidación (ZFPLT-NFDAT) se debe sumar los registros del campo “Valor a Fact.” (ZFPLT-FAKWR). | ||
| − | |||
| − | |||
<nowiki>types: begin of ty_sim_pos, | <nowiki>types: begin of ty_sim_pos, | ||
CUOTA_NRO type RATNR, | CUOTA_NRO type RATNR, | ||
Revision as of 20:18, 5 April 2020
Contents
Autorización grabar variante en Transacción VF05
Para que un usuario pueda grabar una variante, el parámetro de usuario SD_VARIANT_MAINTAIN, tiene que tener el valor ‘A’, los valores posibles son:
SD_VARIANT_MAINTAIN = ' ' => no variant maintenance allowed SD_VARIANT_MAINTAIN = 'U' => only user-specific variants can be maintained SD_VARIANT_MAINTAIN = 'X' => only standard variants can be maintained SD_VARIANT_MAINTAIN = 'A' => both standard variants and user-specific variants may be maintained
ver/actualizar todas las clases de mensaje
transacción: NACU Las clases de mensaje se pueden ver en la tabla T685B TNAPR Programa impresión de mensajes: RSNAST00 , RSNAST0D
Impresión Entregas
- Smartform entrega: LE_SHP_DELNOTE
- Programa impresion Entregas (Smartforms): RLE_DELNOTE
- BADI datos adicionales impresion Entrega: BADI_DLV_PRTDATA
Impresión Facturas
- Actualizar clases de mensaje factura: transacción V/40
- Programa de Impresión de facturas vía SMARTFORM: ver programa RLB_INVOICE
- Smartform Factura: LB_BIL_INVOICE
- Programa de Impresión de facturas vía Adobe forms: ver programa SD_BIL_PRINT01, adobe form SD_INVOICE_FORM01 (tran. SFP)
- Función de obtención de datos para impresión: LB_BIL_INV_OUTP_READ_PRTDATA, esta posee la badi BADI_INV_PRTDATA para adjuntar/modificar datos de la factura, si se desea agregar datos de la factura se debe ampliar la estructura LBBIL_INVOICE.
- Para agregar textos de factura utilizar Texto include como:
Nombre de texto &IS_BIL_INVOICE-HD_GEN-BIL_NUMBER& Objeto de texto VBBK ID del texto Z999 Idioma &CONTROL_PARAMETERS-LANGU&
Factura Cuotas
Para calcular el valor de la cuota es necesario llamar a function BILLING_SCHEDULE_CREATE_T052S y alimentar con los siguientes valores a los Parámetros p.import
ZTERM: VBRK-ZTERM WERT: (suma de todas las posiciones XVBRP-KZWI2) – (suma de todas las posiciones del valor absoluto XVBRP -KZWI1), WAERK: CLP FKDAT: VBKD-FKDAT SKFBT: 0,00 VALTG: 00 VALDT: (vacío) I_COMPANY_CODE: VBRK-BUKRS
Nota: Para obtener el número total de cuotas (XX) filtrar la tabla VBKD por VBELN y traer el campo ZTERM, con este valor filtrar la tabla T052S y listar la tabla por orden ascendente del campo RATNR y trae el último valor.
En la tabla ZFPLT se muestra el valor de las cuotas en el campo ZFPLT -FAKWR .
Se aprecia que todos los registros de ZFPLT -FAKWR son iguales menos el último, por lo cual estos corresponderian a las (XX-1) cuotas y la última a la cuota que falta.
Al ejecutar la función en la tabla ZFPLT si aprece más de 2 registros y si es que estos registros tienen la misma fecha liquidación (ZFPLT-NFDAT) se debe sumar los registros del campo “Valor a Fact.” (ZFPLT-FAKWR).
types: begin of ty_sim_pos,
CUOTA_NRO type RATNR,
MONTO_CUOTA type KZWI1,
WAERK type WAERK,
end of ty_sim_pos.
types ty_t_sim_pos. type table of ty_sim_pos.
data gt_sim_pos type ty_t_sim_pos.
READ TABLE gt_xvbkd INTO g_xvbkd
WITH KEY vbeln = g_vbdka-vbeln
posnr = c_initial. "'000000'"
SELECT ratnr ratpz ratzt FROM t052s INTO TABLE gt_t052s
WHERE zterm = g_vbdka-zterm.
*MONTO_VENTA.MONTO_ABONO.
LOOP AT gt_xvbap INTO ls_xvbap.
ADD ls_xvbap-kzwi2 TO g_monto_venta.
g_monto_abono = g_monto_abono
+ ABS( ls_xvbap-kzwi1 ).
ENDLOOP.
*MONTO_CREDITO.
g_monto_credito = g_monto_venta - g_monto_abono.
*WAERK.
READ TABLE gt_xvbap INTO ls_xvbap INDEX 1.
IF sy-subrc = 0.
g_waerk = ls_xvbap-waerk.
ENDIF.
* Calculo de Cuotas
DATA: lt_zfplt TYPE STANDARD TABLE OF fpltvb,
lt_zfplt_aux TYPE STANDARD TABLE OF fpltvb,
ls_zfplt TYPE fpltvb,
ls_zfplt_aux TYPE fpltvb,
ls_sim_pos TYPE ty_sim_pos.
REFRESH: pt_sim_pos.
CALL FUNCTION 'BILLING_SCHEDULE_CREATE_T052S'
EXPORTING
zterm = g_vbdka-zterm
wert = g_monto_cred
waerk = c_waerk "CLP"
fkdat = g_xvbkd-fkdat
skfbt = c_skfbt "0.00"
valtg = c_valtg "00"
valdt = c_valdt "space"
i_company_code = g_vbdka-bukrs_vf
TABLES
zfplt = lt_zfplt
EXCEPTIONS
no_entry_t052s = 1
no_zfbdt = 2
no_entry_t052 = 3
no_billing_schedule = 4
no_entry_in_t001r_found = 5
OTHERS = 6.
IF sy-subrc NE 0 AND sy-subrc NE 4.
PERFORM protocol_update.
retcode = 1.
EXIT.
ENDIF.
IF g_vbdka-zterm = c_as01
OR g_vbdka-zterm = c_ts01.
lt_zfplt_aux[] = lt_zfplt[].
REFRESH lt_zfplt.
LOOP AT lt_zfplt_aux INTO ls_zfplt_aux.
CLEAR ls_zfplt.
la_zfplt-nfdat = ls_zfplt_aux-nfdat.
ls_zfplt-fakwr = ls_zfplt_aux-fakwr.
COLLECT ls_zfplt INTO lt_zfplt.
ENDLOOP.
ENDIF.
LOOP AT lt_zfplt INTO ls_zfplt.
AT NEW fakwr.
IF sy-tabix NE 1.
ls_sim_pos-cuota_nro = sy-tabix - c_1.
APPEND ls_sim_pos TO gt_sim_pos.
ENDIF.
ENDAT.
ls_sim_pos-monto_cuota = ls_zfplt-fakwr.
ls_sim_pos-waerk = g_waerk.
AT LAST.
*CUOTA_NRO.
IF gt_sim_pos IS NOT INITIAL.
ls_sim_pos-cuota_nro = c_1.
ELSE.
ls_sim_pos-cuota_nro = sy-tabix.
ENDIF.
**MONTO_CUOTA.
* ls_sim_pos-monto_cuota = ls_zfplt-fakwr.
**WAERK.
* ls_sim_pos-waerk = g_waerk.
APPEND ls_sim_pos TO gt_sim_pos.
ENDAT.
ENDLOOP.
ENDFORM. " F_FILL_ITEMS_SIM