Hi guys
I have problem with FM runing in background task!!
ıts suppsed to update the table zmm_t_so_001, it works well when run without background task
I have ran FMs like BAPis in background before and it was ok
Here is the code!!
Function Module --- ZZ_TEST_BACKGROUND
function zz_test_background.
break solend.
data(lr_satinalma_header) = new zmm_t_so_001( ).
call method zcl_mm_so=>get_next_number_appid
importing
appid = lr_satinalma_header->appid.
lr_satinalma_header->belnr = value #( ).
lr_satinalma_header->kalnr = value #( ).
*Aktarım durumu Yeni
lr_satinalma_header->bstyp = value #( ).
*Aktarım durumu
lr_satinalma_header->akdur = 'YK'.
lr_satinalma_header->frgst = value #( ).
*Onay Tipi
lr_satinalma_header->ontip = value #( ).
lr_satinalma_header->ontur = value #( ).
lr_satinalma_header->erdat = sy-datum.
lr_satinalma_header->erzet = sy-uzeit.
lr_satinalma_header->ernam = sy-uname.
**Gonderim durumu
lr_satinalma_header->gondr = ' '.
**İnsert here!!
insert zmm_t_so_001 from lr_satinalma_header->*.
commit work.
endfunction.
then this Fm is called from the report here
report z_learnıng.
START-OF-SELECTION.
call FUNCTION 'ZZ_TEST_BACKGROUND'
in BACKGROUND TASK
.
the interesting part is it works ok when its ran without the BACKGROUND TASK