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

Spool Id

Former Member
0 Likes
419

Hello Everybody

I am calling a standard from my z program using SUBMIT and converting that report output into spool.

I Have a plan to convert that spool data into internal table using a function module.

But My problem is, How to get spool Id created by submit.

Even to use a standard function module for the same, i need job details.

So, please suggest me a way to get spool id or job details.

Regards

Ravi

1 REPLY 1
Read only

Former Member
0 Likes
377

HI,

Use this Fm 'RSPO_FIND_SPOOL_REQUESTS' to get the spool id...

While populating the Print_params populate the spool request name...through whcih u can find the spool request. Check this code

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

copies = '1'

  • destination = sy-pdest

line_count = sy-linct

line_size = sy-linsz

list_name = l_text

new_list_id = 'X'

no_dialog = 'X'

IMPORTING

out_parameters = wa_param

valid = l_valid

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

IF sy-subrc EQ 0.

ENDIF.

IF l_valid EQ 'X'.

IF wa_param-pdest IS INITIAL.

wa_param-pdest = sy-pdest.

ENDIF.

wa_param-primm = space.

NEW-PAGE PRINT ON PARAMETERS wa_param

NO DIALOG.

PERFORM display_individual_report TABLES li_ev_st_lg .

NEW-PAGE PRINT OFF.

  • I have generated the spool and now getting the spool if using Fm

CALL FUNCTION 'RSPO_FIND_SPOOL_REQUESTS'

EXPORTING

rq2name = p_text

rqdest = p_pdest

rqowner = sy-uname

TABLES

spoolrequests = li_rsporq

EXCEPTIONS

no_permission = 1

OTHERS = 2.

IF sy-subrc EQ 0.

SORT li_rsporq BY rqcretime DESCENDING.

READ TABLE li_rsporq INTO li_rsporq_line INDEX 1.

ENDIF.