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

Problem calling function in background

danielpalacios3
Explorer
0 Likes
1,606

Hi all!

I've a problem calling a function in background task. This is the involved code:


                            CALL FUNCTION 'ZRECEP_COMPRA_DIRECTA_MMPP' IN BACKGROUND TASK
                              EXPORTING
                                num_pedido   = wg_24_temp-pedido
                                entrega_exp  = wg_24_temp-entrega
                                estado         = wg_24_temp-estado
                              TABLES
                                datos_pedido = wt_sd_105_temp[]
                                wt_ltap      = wt_ltap_temp[].

The problem is that function is not executed on background. I execute this code and check SM50, and the process is not there. But the most incredible is that sometimes the background process is executed fine.

I've this code at the beginning of the funcion ZRECEP_COMPRA_DIRECTA_MMPP to ensure the background process could be seen (and debugged) on SM50 (my user is DANIP)


  if sy-uname = 'DANIP'.
    data: aux value '2'.

    while aux = '2'.

    endwhile.
  endif.

I'm on SAP ECC 6.0

Anybody knows if exists any system parameter which maybe controls something related to background processing?

Thanks and Regards

Dani

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
913

Hi

The function module calling in BACKGROUND TASK way runs only if a COMMIT WORK is forced: so have u inserted a COMMIT WORK after calling your fm?

Max

2 REPLIES 2
Read only

Former Member
0 Likes
914

Hi

The function module calling in BACKGROUND TASK way runs only if a COMMIT WORK is forced: so have u inserted a COMMIT WORK after calling your fm?

Max

Read only

0 Likes
913

Hi Max

There was a COMMIT after this code but inside a LOOP that not always was executed. This is the reason why sometimes it works fine. Now i've put another COMMIT inmediately after the CALL FUNCTION

You've solved my problem

Thanks and regards!!

Dani