Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error in background process.

Former Member
0 Likes
539

I have a report that lets you choose between executing in background or not. As far as I see, in both cases the same subroutines are executed, though if you choose to execute directly a list is shown on screen and you are asked to push exec to have the last part of the program executed.

I am getting an error when choosing background, and so far I get a time-out error whenever I try to debug.

Is it possible that a variable is not being cleared because the process is in background?

I paste below the report's code, in case someone sees any difference I'm missing...

Thanks in advance,

S.

CODE:

REPORT ZFI_GENERACION_UTE_AF

MESSAGE-ID ZFI

NO STANDARD PAGE HEADING

LINE-SIZE 116.

************************************************************************

*Declaración de includes

************************************************************************

INCLUDE .

INCLUDE ZFI_BATCH_INPUT.

INCLUDE ZFI_UTE_TOP_AF.

************************************************************************

  • Definición de la pantalla de selección

************************************************************************

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS: P_KOKRS LIKE TKA01-KOKRS OBLIGATORY.

SELECT-OPTIONS: P_BURKSN FOR SKB1-BUKRS OBLIGATORY.

SELECT-OPTIONS: P_GSBERN FOR BSIS-GSBER.

SELECT-OPTIONS: P_BURKSU FOR SKB1-BUKRS.

SELECT-OPTIONS: P_GSBERU FOR BSIS-GSBER.

PARAMETERS: P_GAJHR LIKE BKPF-GJAHR OBLIGATORY,

S_MONAT LIKE BSIS-MONAT OBLIGATORY,

P_BLDAT LIKE BKPF-BLDAT OBLIGATORY.

SELECTION-SCREEN END OF BLOCK B1.

  • Bloque1 'Tipo de procesamiento: Online - Background'

SELECTION-SCREEN BEGIN OF BLOCK BLOQUE1 WITH FRAME TITLE TEXT-004.

PARAMETERS:

X_ONLINE NO-DISPLAY, " RADIOBUTTON GROUP TYPE, " Ejecutar on-line

X_BATCH NO-DISPLAY. "RADIOBUTTON GROUP TYPE. " Ejecutar en fondo

SELECTION-SCREEN END OF BLOCK BLOQUE1.

SELECTION-SCREEN BEGIN OF BLOCK BLOQUE3 WITH FRAME TITLE TEXT-016.

PARAMETERS:

P_PARC RADIOBUTTON GROUP TIPO,

P_TOTAL RADIOBUTTON GROUP TIPO DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK BLOQUE3.

PARAMETERS: NUM_DOCS TYPE I DEFAULT '1000'.

PARAMETERS: P_CODIGO TYPE ZCODIGO_NEGOCIO.

************************************************************************

*Declaración de includes

************************************************************************

INCLUDE ZFI_UTES_F001_AF.

************************************************************************

  • LOGICA DEL PROGRAMA

************************************************************************

************************************************************************

*Definición de inicializaciones

************************************************************************

INITIALIZATION.

PERFORM INICIALIZAR_DATOS.

************************************************************************

*Proceso principal

************************************************************************

START-OF-SELECTION.

PERFORM INI_CABECERA.

  • Procesamiento Online

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

EXPORTING

PERCENTAGE = 0

TEXT = TEXT-011.

CLEAR CONTABILIZADO.

PERFORM: INICIALIZAR_ESTRUCTURAS,

CONFECCION_ASIENTOS,

  • Si UTEs impuras se crearan los siguientes asientos

      • En la empresa ZZZI sólo se generarán apuntes para las cuentas

      • de la tabla ZHKONT_IMPURAS en las empresas ZZZ8 y ZZZ9.

  • add sis3e 14/01/05

  • CONFECCION_ASIENTO_NOD_FERR,

  • fin add sis3e 14/01/05

CREAR_ASIENTOS_CONTRARIOS.

CLEAR SALIR.

************************************************************************

*Acciones de final de proceso

************************************************************************

END-OF-SELECTION.

PERFORM VISUALIZAR_TI_APUNTES.

IF NOT SY-BATCH IS INITIAL.

PERFORM CONTABILIZAR_DOCUMENTOS.

ENDIF.

************************************************************************

*Definición de cabeceras del listado

************************************************************************

TOP-OF-PAGE.

PERFORM BATCH-HEADING(RSBTCHH0).

PERFORM CABECERA_INICIAL.

TOP-OF-PAGE DURING LINE-SELECTION.

PERFORM BATCH-HEADING(RSBTCHH0).

************************************************************************

*Definición y control de acciones a tomar según entrada del usuario

************************************************************************

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'EJEC'. " Ejecutar Contabilizaciones

PERFORM CONTABILIZAR_DOCUMENTOS.

WHEN 'ENDE'.

  • Finalizar

LEAVE PROGRAM.

WHEN 'ABR'.

  • Cancelar

LEAVE PROGRAM.

ENDCASE.

************************************************************************

*Validaciones de los parámetros de entrada

************************************************************************

AT SELECTION-SCREEN.

KOKRS = P_KOKRS.

  • moneda de la sociedad

SELECT SINGLE WAERS FROM TKA01 INTO TKA01-WAERS

WHERE KOKRS = KOKRS.

MONEDA_FERR = TKA01-WAERS.

IF CONTROL_SELECTION = '1'.

PERFORM VALIDACIONES_SCREEN_SELECCION.

CONTROL_SELECTION = 2.

ENDIF.

2 REPLIES 2
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
429

Hi,

Did you mean to say 'last part' of the program is executed after pressing button on application toolbar?

So even if you execute in background the list should appear and after that you need to see what the program is doing,

Rgds,

Sandeep

Read only

0 Likes
429

Only if you choose not to execute in background. If you choose to execute the whole process in background no list is shown. I can go to al11 and check it (where it is with those errors...).