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

displaying spool requests

naresh_bammidi
Contributor
0 Likes
3,232

Dear experts ,

My requirement is ,displaying the spool requests according to user name ,date created ,and Title.for that i am using the following two function modules.

RSPO_RINIT_SPOOL_SP01

RSPO_RDISPLAY_SPOOLREQ

i appended the title of spool request to the internal table and passed that interanal table to RSPO_RINIT_SPOOL_SP01 ,up to now its working fine .but what my requirement is ,i should pass the username and date through selection screen.in the same way i have appended data from the selection screen to respective internal tables and passed through the internal table.if i give wrong 'username ' in selection screen it should not display any spool job.even though its showing spool requests based on title.what was wrong?please help me out.

Thanks and regards

naresh bammidi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,754

hi naresh ,

Use select querry and fetch the spool no. from tsp01 table just before the two function module .

then pass that fetched spool request into the function module in the column of spool no .

regards

ranjan

11 REPLIES 11
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
2,754

Hi,

you can use this fm instead of the fm's mentioned by you and from the output returned filter it by date and title.


data:it type table of RSPORQ.

CALL FUNCTION 'RSPO_FIND_SPOOL_REQUESTS'
* EXPORTING
   ALLCLIENTS                = '010' "Leave it blank if required
   AUTHORITY                 = 'RSPO_GET_TEMSEOBJ_OF' "Leave it blank if required
*   DATATYPE                  = '*'
*   HAS_OUTPUT_REQUESTS       = '*'
*   RQ0NAME                   = '*'
*   RQ1NAME                   = '*'
*   RQ2NAME                   = '*'
*   RQDEST                    = '*'
*   RQIDENT                   = 0
   RQOWNER                   = '*' "Pass user name here
  TABLES
    spoolrequests             = it
* EXCEPTIONS
*   NO_PERMISSION             = 1
*   OTHERS                    = 2
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Read only

former_member209696
Participant
0 Likes
2,754

Dear NARESH,

riyas here.....

If u want the spool number by giving username and date as input. Don't use any function module. Instead just use select query as follows.

SELECT <fields> FROM TSP01 INTO <ITAB> WHERE <Condition>

TSP01 is the database table which store the spool numbers and details

Read only

Former Member
0 Likes
2,755

hi naresh ,

Use select querry and fetch the spool no. from tsp01 table just before the two function module .

then pass that fetched spool request into the function module in the column of spool no .

regards

ranjan

Read only

0 Likes
2,754

Hi Naresh,

Use below report for your porpose.

TABLES : RQIDEN_T,RQOWNE_T,RQCRED_T,RQTITL_T.

SELECT-OPTIONS : s_spool for RQIDEN_T.

SELECT-OPTIONS : s_owner for RQOWNE_T.

SELECT-OPTIONS :s_date for RQCRED_T.

SELECT-OPTIONS : s_rqtitl for RQTITL_T.

type-POOLs : slis.

data : lt_SPORQ TYPE TABLE OF tsp01sys,

ws_SPORQ TYPE tsp01sys,

goto_sel.

data : lw_sel TYPE SLIS_SELFIELD.

data: lt_sysid type TABLE OF ALSYSID,

ws_sysid type ALSYSID.

ws_sysid-SYSID = SY-SYSID.

append ws_sysid to lt_sysid.

CALL FUNCTION 'RSPO_RINIT_SPOOL_SP01'

EXPORTING

SAVEFLAG = 'A'

SUMMARY = 'X'

LOCAL = 'X'

OWNER = ' '

CLIENT = ' '

RQNONE = 'X'

RQPROC = 'X'

RQSUCC = 'X'

RQERR = 'X'

PJPROC = 'X'

PJSUCC = 'X'

PJPROB = 'X'

PJERR = 'X'

TABLES

SYSLIST = lt_sysid

S_RQIDEN = s_spool

S_RQOWNE = s_owner

s_rqcred = s_date

s_rqtitl = s_rqtitl.

call function 'RSPO_RDISPLAY_SPOOLREQ'

exporting

use = ' '

importing

goto_sel = goto_sel

  • TABLES

  • SPORQ = lt_SPORQ

  • OUTRQ =

changing

rs_selfield = lw_sel

exceptions

others = 1.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

Thanks,

Vijay

Read only

0 Likes
2,754

Hi vijay ,

This code is working for only 'user name'(owner ).if i enter user name and Title in selection screen ,its showing nothing .what would be the problem.did you try this code with your test data ? Is this working for you ?

Thanks and regards

Naresh Bammidi

Read only

0 Likes
2,754

This code is working for only 'user name'(owner ).if i enter user name and Title in selection screen ,its showing nothing .what would be the problem.did you try this code with your test data ? Is this working for you ?

Please note that field TSP01-RQTITLE is case sensitive. It must be given as its stored in Db table.

Provide the same input in the transaction SP01 and check if gives any output.

Kesav

Read only

0 Likes
2,754

Hi Keshav ,

I am giving as it is in DB table ,but no use.even for spool request number also not working .any idea ?i tried your code also.but i couldn't find any date field to export in that FM.

Thanks and regards

Naresh Bammidi

Read only

0 Likes
2,754

i tried your code also.but i couldn't find any date field to export in that FM.

Loop at the fm output and filter based on the selection screen values.

Kesav

Read only

0 Likes
2,754

> Loop at the fm output and filter based on the selection screen values.

>

> Kesav

You are saying 'Loop at the fm '.but which function module?you mean to say 'RSPO_RDISPLAY_SPOOLREQ'.?

Read only

0 Likes
2,754

Hi Naresh,

Try this code this is workinh as expected.

TABLES : RQIDEN_T,RQOWNE_T,RQCRED_T,RQTITL_T,TSP01SYS,RSPOTYPE.

data : rqident like tsp01_sp0r-rqid_char.

SELECT-OPTIONS : s_rqiden for rqident no intervals."s_spool for RQIDEN_T.

SELECT-OPTIONS : s_rqowne for tsp01sys-rqowner default sy-uname

no intervals."s_rqowne for tsp01sys-rqowner."s_owner for RQOWNE_T.

SELECT-OPTIONS :s_rqcred for rspotype-credate default sy-datlo to

sy-datlo."s_date for RQCRED_T.

SELECT-OPTIONS : s_rqtitl for tsp01sys-rqtitle no intervals."s_rqtitl for RQTITL_T.

type-POOLs : slis.

data : lt_SPORQ TYPE TABLE OF tsp01sys,

ws_SPORQ TYPE tsp01sys,

goto_sel.

data : lw_sel TYPE SLIS_SELFIELD.

data: lt_sysid type TABLE OF ALSYSID,

ws_sysid type ALSYSID.

ws_sysid-SYSID = SY-SYSID.

append ws_sysid to lt_sysid.

CALL FUNCTION 'RSPO_RINIT_SPOOL_SP01'

EXPORTING

SAVEFLAG = 'A'

SUMMARY = 'X'

LOCAL = 'X'

OWNER = ' '

CLIENT = ' '

RQNONE = 'X'

RQPROC = 'X'

RQSUCC = 'X'

RQERR = 'X'

PJPROC = 'X'

PJSUCC = 'X'

PJPROB = 'X'

PJERR = 'X'

TABLES

SYSLIST = lt_sysid

S_RQIDEN = s_rqiden

S_RQOWNE = s_rqowne

s_rqcred = s_rqcred

s_rqtitl = s_rqtitl.

call function 'RSPO_RDISPLAY_SPOOLREQ'

exporting

use = ' '

importing

goto_sel = goto_sel

  • TABLES

  • SPORQ = lt_SPORQ

  • OUTRQ =

changing

rs_selfield = lw_sel

exceptions

others = 1.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

Thanks,

Vijay

Read only

0 Likes
2,754

Hi vijay,

Thanks alot.its working fine.

with best regards

Naresh Bammidi