Difference between revisions of "SAP SD BTE"

From SapWiki
Line 1: Line 1:
 
==00503303 Maintain conditions: Transfers==
 
==00503303 Maintain conditions: Transfers==
Como crear BTE: ver [http://sapwiki.cl/wiki/index.php?title=SAP_FI_BAPI#Implementing_the_Business_Transaction_Event_.28BTE.2C_also_OPEN_FI.29_RWBAPI01_with_enhancement_structure_EXTENSION1_at_BAPI_ACC_DOCUMENT_POST]
+
Como crear BTE: ver [http://sapwiki.cl/wiki/index.php?title=SAP_FI_BAPI#Implementing_the_Business_Transaction_Event_.28BTE.2C_also_OPEN_FI.29_RWBAPI01_with_enhancement_structure_EXTENSION1_at_BAPI_ACC_DOCUMENT_POST]
 
* ejemplo: validación en trn. VK11 VK12
 
* ejemplo: validación en trn. VK11 VK12
 
  <nowiki>FUNCTION Z_SD_CALL_00503303_E.
 
  <nowiki>FUNCTION Z_SD_CALL_00503303_E.

Revision as of 20:40, 5 April 2020

00503303 Maintain conditions: Transfers

Como crear BTE: ver [1]

  • ejemplo: validación en trn. VK11 VK12
FUNCTION Z_SD_CALL_00503303_E.
*"--------------------------------------------------------------------
*"*"Interfase local
*"  IMPORTING
*"     REFERENCE(KOMG_OLD) TYPE  KOMG
*"     REFERENCE(KOMG_NEW) TYPE  KOMG
*"     REFERENCE(VAKE_OLD) TYPE  VAKE
*"     REFERENCE(VAKE_NEW) TYPE  VAKE
*"  EXPORTING
*"     REFERENCE(TRANSITION_FORBIDDEN) TYPE  XFELD
*"--------------------------------------------------------------------
  data ls_vake type VAKEVB.
  data: c_dlimit type p value 60,
        l_dlimit(2) type n.
  data l_d type p.
  data l_m(50) type c VALUE 'p.planificación mayor a & días'.
  FIELD-SYMBOLS: <fs_number> TYPE any table.
  FIELD-SYMBOLS <fs> type any.
  DATA: lw_var(40) TYPE c.

  CHECK sy-tcode = 'VK11' or sy-tcode = 'VK12' or sy-tcode = 'VK13'.
  check sy-title(1) <> 'V'. "Visualisar
  check VAKE_NEW-KSCHL = 'ZAB1' or vake_new-KSCHL = 'ZAB2'
         or VAKE_NEW-KSCHL = 'ZAB0'
         or VAKE_NEW-KSCHL = 'ZAB3'
         or VAKE_NEW-KSCHL = 'ZAB4'
         or VAKE_NEW-KSCHL = 'ZAB5'.

  l_dlimit = c_dlimit.
  REPLACE '&' INTO l_m WITH l_dlimit.

  l_d = vake_new-datbi - vake_new-datab.

  if l_d > c_dlimit.

    lw_var = '(SAPMV13A)FCODE'.
    ASSIGN (lw_var) TO <fs>.
    IF sy-subrc = 0 AND <fs> IS ASSIGNED.
      <fs> = ''.
    endif.

    MESSAGE i000(0k) WITH 'Período de validez'
                       VAKE_NEW-datab
                       VAKE_NEW-datbi
                       l_m DISPLAY LIKE 'E'.

  endif.

ENDFUNCTION.