Validaciones - OB28

Las validaciones están regidas por Sociedad y por evento.

Evento:

  1. Cabecera de documento
  2. Posición de documento
  3. Documento Completo

image

Grado de activ. significa si está activo o no (1 = ACTIVO)

image

Ahí vemos todos los pasos, cada uno con sus respectivas condiciones, verificaciones y mensajes.

En el caso de necesitar usar un user exit, en la solapa user exit. seleccionamos una y le damos al botón de visualizar código.

Necesitamos crear el modulo dentro del siguiente FORM

*----------------------------------------------------------------------*
*       FORM GET_EXIT_TITLES                                           *
*----------------------------------------------------------------------*
*       returns name and title of all available standard-exits         *
*       every exit in this formpool has to be added to this form.      *
*       You have to specify a parameter type in order to enable the    *
*       code generation program to determine correctly how to          *
*       generate the user exit call, i.e. how many and what kind of    *
*       parameter(s) are used in the user exit.                        *
*       The following parameter types exist:                           *
*                                                                      *
*       TYPE                Description              Usage             *
*    ------------------------------------------------------------      *
*       C_EXIT_PARAM_NONE   Use no parameter         Subst. and Valid. *
*                           except B_RESULT                            *
*       C_EXIT_PARAM_CLASS  Use a type as parameter  Subst. and Valid  *
*----------------------------------------------------------------------*
*  -->  EXIT_TAB  table with exit-name and exit-titles                 *
*                 structure: NAME(5), PARAM(1), TITEL(60)
*----------------------------------------------------------------------*
FORM get_exit_titles TABLES etab.

  DATA: BEGIN OF exits OCCURS 50,
          name(5)   TYPE c,
          param     LIKE c_exit_param_none,
          title(60) TYPE c,
        END OF exits.
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* PLEASE DELETE THE FIRST '*' FORM THE BEGINING OF THE FOLLOWING LINES *
*        IF THE ACCOUNTING MODULE IS INSTALLED IN YOUR SYSTEM:         *
*  EXITS-NAME  = 'U101'.
*  EXITS-PARAM = C_EXIT_PARAM_CLASS.
*  EXITS-TITLE = TEXT-100.                 "Posting date check
*  APPEND EXITS.

  exits-name  = 'U100'.
  exits-param = c_exit_param_none.        "Complete data used in exit.
  exits-title = text-101.                 "Posting date check
  APPEND exits.

REFRESH etab.
  LOOP AT exits.
    etab = exits.
    APPEND etab.
  ENDLOOP.

ENDFORM.                    "GET_EXIT_TITLES

 

Ahora creamos la subrutina U100

*---------------------------------------------------------------------*
*      form U941                                                      *
*---------------------------------------------------------------------*
*  Valida las retenciones de la clase de doc.
*---------------------------------------------------------------------*
* <--  b_result    t = true  f = false                                *
*---------------------------------------------------------------------*
FORM U941  USING B_RESULT.
DATA: l_ind TYPE WITH_ITEM-WT_WITHCD VALUE 'RB'.

  B_RESULT = B_TRUE.
  SELECT SINGLE * FROM WITH_ITEM
          WHERE WT_WITHCD = l_ind.

  IF sy-subrc <> 0.
    B_RESULT = B_FALSE.
* Mensaje de error
    MESSAGE E067(z1) WITH BKPF-BLART l_ind.
  Endif.
CLEAR WITH_ITEM.
ENDFORM.

Si necesitamos crear SET ( rangos o juegos de datos) los creamos con la transacción GS01

Creamos el SET, guardamos y manualmente hay que agregarlo a Orden de transporte al igual que las validaciones.

Para transportar éstas hay que posicionarnos sobre la validación, Menu Validación -> Transportar.