Application Development 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: 

function module to get spool request number

Former Member
0 Kudos

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

former_member182779
Active Contributor
0 Kudos

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.

0 Kudos

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.

0 Kudos

Try with this SO_WIND_SPOOL_LIST

Greetings,

Blag.

0 Kudos

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.

0 Kudos

call this function module 'set_print_parameters'

and pass the subsequent values .

regards ,

Amit shandilya

0 Kudos

one more is there

'RSPO_OPEN_SPOOLREQUEST'

it will give the appropriate solution to your query.

0 Kudos

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.

0 Kudos

one more is there

'RSPO_OPEN_SPOOLREQUEST'

it will give the appropriate solution to your query.

Former Member
0 Kudos

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.

naresh_bammidi
Contributor
0 Kudos

Hi Venu,

Use this FM to get spool numbers by passing owner Parameter

RSPO_RINIT_SPOOL_SP01