‎2019 Mar 10 3:24 PM
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.
‎2019 Mar 12 12:40 AM
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.
‎2019 Mar 11 12:21 PM
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.
‎2019 Mar 11 9:29 PM
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.
¯\_(ツ)_/¯
‎2019 Mar 12 12:40 AM
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.