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

Program not generating spool in background processing

Former Member
0 Likes
2,217

Hi All,

Hope you are all doing well.

Wish to have your assistance regarding the report 'rsau_tms_show_import'. It is to view import history.

The program is coded for dialog execution only so i've created a customized one for it to be able to run in background. I've set the variant of the program to display import history of the previous month and number of entries is 5. However, when i tried to schedule the background job, the job just kept running for long time so i eventually canceled the job. It is not creating a spool at all.

What did I miss.

Hope to have your advice.

Thanks in advace.

Regards,

Jandi

REPORT Z_TEST2 NO STANDARD PAGE HEADING.

PARAMETERS p_sys TYPE tmssysnam DEFAULT sy-sysid NO-DISPLAY.

SELECTION-SCREEN BEGIN OF BLOCK time WITH FRAME TITLE text-001 NO INTERVALS.
 SELECTION-SCREEN BEGIN OF LINE.
 SELECTION-SCREEN COMMENT 1(25) text-002 FOR FIELD strtdate.
 PARAMETERS strtdate LIKE sy-datum OBLIGATORY DEFAULT sy-datum.
 PARAMETERS strttime LIKE sy-uzeit DEFAULT '000000'.
 SELECTION-SCREEN END OF LINE.
 SELECTION-SCREEN BEGIN OF LINE.
 SELECTION-SCREEN COMMENT 1(25) text-003 FOR FIELD enddate.
 PARAMETERS enddate  LIKE sy-datum DEFAULT sy-datum.
 PARAMETERS endtime  LIKE sy-uzeit DEFAULT '240000'.
 SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK time.

*&---------------------------------------------------------------------*
* END_OF-SELECTION.
*&---------------------------------------------------------------------*
END-OF-SELECTION.

 CALL FUNCTION 'TMS_TU_IMPORT_HISTORY'
 EXPORTING
iv_system  = p_sys
iv_verbose  = 'X'
iv_start_date  = strtdate
iv_start_time  = strttime
iv_end_date  = enddate
iv_end_time  = endtime
 EXCEPTIONS
cancelled_by_user  = 1
import_history_failed = 2
 OTHERS  = 3.
 IF sy-subrc <> 0.
 RETURN. "error was handled in the above dialog, do nothing here
 ENDIF.
1 ACCEPTED SOLUTION
Read only

DoanManhQuynh
Active Contributor
0 Likes
1,646

there is fm: TMS_UIQ_DISPLAY_REQUESTS called in there to show the result in a dynpro, it might be the reason your job keep running, you should debug your job to find out.

for the question about spool, you have to write it in your program. maybe with your requirement, its better to use fm: TMS_TM_GET_HISTORY.

3 REPLIES 3
Read only

former_member259807
Active Participant
1,646

The reason why you do not see any logging is because you do not write any logging in Z_TEST2. Would be nice if you could capture the output of the FM and write that as logging, but that will not work. The thing is that the FM contains calls to other FM's which will only work in dialog (like TMS_UI_POPUP_GET_PERIOD). So I guess you have to find a different approach.

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,646

Spool is created when there is WRITE command or some other output (e.g. ALV). I really doubt an FM would provide such output, that would be odd. There is also no "dialog" in background mode. I'm really not sure what was the expectation here... Want to get a spool - write the code accordingly.

¯\_(ツ)_/¯

Read only

DoanManhQuynh
Active Contributor
0 Likes
1,647

there is fm: TMS_UIQ_DISPLAY_REQUESTS called in there to show the result in a dynpro, it might be the reason your job keep running, you should debug your job to find out.

for the question about spool, you have to write it in your program. maybe with your requirement, its better to use fm: TMS_TM_GET_HISTORY.