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

function module to get spool request number

Former Member
0 Likes
5,458

Hi Experts,

Is there a FM which basically returns the Spool Request Number generated by a particular Program / User ?

System: 4.6C

Thanks a lot.

10 REPLIES 10
Read only

former_member182779
Active Contributor
0 Likes
2,921

I don't think so...But you can do this...


    SELECT RQIDENT
    INTO (T_TSP01-RQIDENT)
    FROM TSP01
    WHERE RQOWNER EQ SY-UNAME
      AND RQCLIENT EQ SY-MANDT.
    APPEND T_TSP01.
    ENDSELECT.

You will had the last spool number generated by a particular user...

Greetigns,

Blag.

Read only

0 Likes
2,921

Hey Thanks for the reply.

I was already using this select statement before in my previous programs. But was wondering if there is a FM.

Thanks.

Read only

0 Likes
2,921

Try with this SO_WIND_SPOOL_LIST

Greetings,

Blag.

Read only

0 Likes
2,921

I have done it with this function module: RSPO_FIND_SPOOL_REQUESTS passing AUTHORITY = RSPO_GET_TEMSEOBJ_OF and RQOWNER = user. It returns a list of spool requests with creation date and time.

Read only

0 Likes
2,921

call this function module 'set_print_parameters'

and pass the subsequent values .

regards ,

Amit shandilya

Read only

0 Likes
2,921

one more is there

'RSPO_OPEN_SPOOLREQUEST'

it will give the appropriate solution to your query.

Read only

0 Likes
2,921

or try this,

SUBMIT (p_repid) TO SAP-SPOOL

SPOOL PARAMETERS mstr_print_parms

WITHOUT SPOOL DYNPRO

AND RETURN.

but it will create infinite loop , so use abap memory and export a flag variable with

a value to restricted the excution of the above submit only once and all the internal

table and other data which you want in your program . below is the example .

  • importing variable value set at first time to restrict the infinite loop .

IMPORT var FROM MEMORY ID 'abc' .

var = var + 1 .

*checking variable to restricted scecond time exction of this block of code

  • *IF var = 1 .

v_memid = 1 .

EXPORT var TO MEMORY ID 'abc' . (flag variable to restrict the excution only once )

EXPORT it_pernr it_pernr_quali v_memid TO MEMORY ID 'bcd'.(internal table and otherdata)

  • submitting the spool request

SUBMIT (p_repid) TO SAP-SPOOL

SPOOL PARAMETERS mstr_print_parms

WITHOUT SPOOL DYNPRO

AND RETURN.

ENDIF.

Read only

0 Likes
2,921

one more is there

'RSPO_OPEN_SPOOLREQUEST'

it will give the appropriate solution to your query.

Read only

Former Member
0 Likes
2,921

one more is there

'RSPO_OPEN_SPOOLREQUEST'

it will give the appropriate solution to your query.

another one ,

SUBMIT (p_repid) TO SAP-SPOOL

SPOOL PARAMETERS mstr_print_parms

WITHOUT SPOOL DYNPRO

AND RETURN.

but it will create infinite loop , so use abap memory and export a flag variable with

a value to restricted the excution of the above submit only once and all the internal

table and other data which you want in your program . below is the example .

  • importing variable value set at first time to restrict the infinite loop .

IMPORT var FROM MEMORY ID 'abc' .

var = var + 1 .

*checking variable to restricted scecond time exction of this block of code

  • *IF var = 1 .

v_memid = 1 .

EXPORT var TO MEMORY ID 'abc' . (flag variable to restrict the excution only once )

EXPORT it_pernr it_pernr_quali v_memid TO MEMORY ID 'bcd'.(internal table and otherdata)

  • submitting the spool request

SUBMIT (p_repid) TO SAP-SPOOL

SPOOL PARAMETERS mstr_print_parms

WITHOUT SPOOL DYNPRO

AND RETURN.

ENDIF.

Read only

naresh_bammidi
Contributor
0 Likes
2,921

Hi Venu,

Use this FM to get spool numbers by passing owner Parameter

RSPO_RINIT_SPOOL_SP01