Versiones comparadas

Clave

  • Se ha añadido esta línea.
  • Se ha eliminado esta línea.
  • El formato se ha cambiado.

Este escenario aplica cuando se tiene emisión de facturas desde SD. Se deben utilizar las funcionalidades del paquete This scenario applies when there is invoice issuance from SD (Sales and Distribution module). The functionalities of the package /EDGE/FC_SAPSD_INT should be used.

Para dar inicio a un intérprete de esta naturaleza se deben seguir los siguientes pasos:

...

To initiate a business unit of this nature, the following steps must be followed:

  1. Configure the class /EDGE/CL_FC_START_PROCESS_EXT como inicio externo. Revisar configuración del capítulo "Configuración de parámetros generales".
    Configurar el intérprete o los intérpretes en cuestión. Revisar toda la configuración del capítulo "Configuración específica para cada proceso/intérprete". Al igual que toda la configuración del proceso "Configuración funcional del b+ Core Framework".
    Configurar la determinación automática de los intérpretes. Revisar el capítulo "Configuración de la determinación automática de intérpretes". 
    Configurar el canal de entrada para esta funcionalidad, el cual está implementado en la clase as an external start in the system's general parameters. Refer to the configuration in the chapter "Configuration of general parameters".

  2. Configure the specific business unit(s) in question. Review all the configuration in the chapter "Specific configuration for each process/business unit". Also, review the entire configuration process in "Functional configuration of the b+ dgtal eInvoice".

  3. Set up the automatic determination of business units. Refer to the chapter "Configuration automatic determination of business unit.". 

  4. Configure the input channel for this functionality, which is implemented in the class /EDGE/CL_FC_SAPSD_INT_CHAN_IN. Si se requieren guardar datos adicionales a los que se guardan mediante esta funcionalidad, se puede hacer una clase que herede de ésta y reimplementar el método SAVE_INVOICE_ADITIONAL_DATA, llamando adentro el método de la super clase y luego se implementa lo que se requieren guardar adicional.
    Un ejemplo de esta implementación se puede encontrar en la clase If additional data needs to be saved beyond what is stored by this functionality, a class can be created that inherits from this one and re-implements the method SAVE_INVOICE_ADDITIONAL_DATA. This method should call the superclass method first and then implement the additional data to be saved.
    An example of this implementation can be found in the class /EDGE/CL_FC_CRVJL_SD_CHAN_IN.

  5. Al haber importado el paquete When importing the package /EDGE/FC_SAPSD_INT, se creó en el sistema la implementación de la BADI SD_CIN_LV60AU02, la cual se ejecuta al realizarse cualquier cambio sobre una factura SD. En esta implementación the implementation of the BADI SD_CIN_LV60AU02 was created in the system. This BADI is executed whenever any change is made to an SD invoice. In the implementation /EDGE/FC_BADI_IMP_SD, se obtienen todas las tablas internas del proceso de facturación que llegan a este punto y se envían al proceso de inicio externo de intérpretes.
    En teoría no se tienen que hacer modificaciones sobre esta implementación, ya que toda la lógica ya quedó implementada, solo habrían que realizarse los pasos de configuración funcional para determinar automáticamente el intérprete.
    El código fuente de la implementación es el siguienteall the internal tables of the billing process that reach this point are obtained and sent to the external start process of business units.
    In theory, no modifications need to be made to this implementation, as all the logic is already implemented. Only the functional configuration steps need to be performed to automatically determine the business unit.
    The source code of the implementation is as follows:

  METHOD if_ex_sd_cin_lv60au02~excise_invoice_create.
*----------------------------------------------------------------------*
* Descripción : Inicia procesos de facturación electrónica, de acuerdo
* a condiciones configuradas en /EDGE/FC_SPRO
* Desarrollador : Julián Andrés Sánchez Castro - JULIANS               *
* Diseño y Arquitectura : Julián Andrés Sánchez Castro                 *
* Consultor Funcional : Julián Andrés Sánchez Castro                   *
* Fecha: 27/02/2018
*----------------------------------------------------------------------*
* LOG DE MODIFICACIONES                                                *
*----------------------------------------------------------------------*
* Descripción : Detalle el objetivo del cambio *
* Funcional : Consultor Funcional. *
* Desarrollador : Nombre del programador y user *
* Fecha Modificación : DD.MM.YYYY *
* ID Componente : *
* Número de Req. : Ejemplo LN#### *
*----------------------------------------------------------------------*
    FIELD-SYMBOLS<fs_xvbrk> TYPE vbrk_tab,
                   <fs_xvbrp> TYPE vbrp_tab,
                   <fs_xvbpa> TYPE vbpa_tab,
                   <fs_xkomv> TYPE komv_tab.
    DATAlr_params  TYPE REF TO /edge/cl_fc_start_process_para,
          lt_data    TYPE abap_trans_resbind_tab,
          wa_data   LIKE LINE OF lt_data,
          lr_exc    TYPE REF TO /edge/cx_fc_einvoice_exception,
          lr_cxroot TYPE REF TO cx_root,
          lr_cx2    TYPE REF TO cx_root,
          lr_log    TYPE REF TO /edge/cl_fc_einvoice_util_logs.

    TRY .
        wa_data-name 'VBRK_TAB'.
        CREATE DATA wa_data-value TYPE vbrk_tab.
        ASSIGN wa_data-value->TO <fs_xvbrk>.
        <fs_xvbrk> xvbrk.
        APPEND wa_data TO lt_data.

        wa_data-name 'VBRP_TAB'.
        CREATE DATA wa_data-value TYPE vbrp_tab.
        ASSIGN wa_data-value->TO <fs_xvbrp>.
        <fs_xvbrp> xvbrp.
        APPEND wa_data TO lt_data.

        wa_data-name 'VBPA_TAB'.
        CREATE DATA wa_data-value TYPE vbpa_tab.
        ASSIGN wa_data-value->TO <fs_xvbpa>.
        <fs_xvbpa> xvbpa.
        APPEND wa_data TO lt_data.

        wa_data-name 'KOMV_TAB'.
        CREATE DATA wa_data-value TYPE komv_tab.
        ASSIGN wa_data-value->TO <fs_xkomv>.
        <fs_xkomv> xkomv.
        APPEND wa_data TO lt_data.

        CREATE OBJECT lr_params
          EXPORTING
            pi_data lt_data.

        /edge/cl_fc_start_process_ext=>start_process_syncEXPORTING pi_do_commit abap_false
                                                            CHANGING pc_params lr_params ).
      CATCH /edge/cx_fc_einvoice_exception INTO lr_exc.
        TRY .
            CREATE OBJECT lr_log
              EXPORTING
                pi_object    /edge/cl_fc_constants=>log_object
                pi_subobject /edge/cl_fc_constants=>sublog_startp
                pi_alprog    sy-cprog.
            lr_log->add_messages_from_exceptionlr_exc ).
          CATCH cx_root INTO lr_cx2.
*           Nothing to do!!!
        ENDTRY.

      CATCH cx_root INTO lr_cxroot.
        TRY .
            CREATE OBJECT lr_log
              EXPORTING
                pi_object    /edge/cl_fc_constants=>log_object
                pi_subobject /edge/cl_fc_constants=>sublog_startp
                pi_alprog    sy-cprog.
            lr_log->add_messages_from_exceptionlr_cxroot ).
          CATCH cx_root INTO lr_cx2.
*           Nothing to do!!!
        ENDTRY.

    ENDTRY.

  ENDMETHOD.