You are on page 1of 1

CALL FUNCTION 'SD_SALES_DOCUMENT_PREFETCH'

EXPORTING
i_sales_view = 'XXXXXXXXXXXXXXXXX'
i_print_mode = '1'
TABLES
i_vbak_keytab = l_i_vbak_keytab
fxvbap = p_it_vbap
fxkomv = p_it_fxkomv
EXCEPTIONS ERROR_MESSAGE = 1.
IF sy-subrc <> 0.
ENDIF.

Atención para evitar que un message de tipo E acabe el flujo de ejecución y poder detectar el
error hay que añadir al call function:

EXCEPTIONS ERROR_MESSAGE = 1.

Ayuda de CALL FUNCTION:

ERROR_MESSAGE: This exception instructs the system to ignore S messages, I messages, and
W messages until return from the function module (although they still appear in the log during
background processing). When an E message or an A message occurs, the called function
module terminates, as if the exception ERROR_MESSAGE has been triggered. If an A message is
handled using ERROR_MESSAGE, the ROLLBACK WORK statement is triggered implicitly

You might also like