2011 Nov 07 7:42 AM
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
2011 Nov 07 8:46 AM
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
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
2011 Nov 07 7:49 AM
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.
2011 Nov 07 7:57 AM
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
2011 Nov 07 8:46 AM
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
2011 Nov 07 9:07 AM
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
2011 Nov 07 11:16 AM
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
2011 Nov 07 11:29 AM
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
2011 Nov 07 11:35 AM
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
2011 Nov 07 11:54 AM
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
2011 Nov 07 12:11 PM
> 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'.?
2011 Nov 07 12:12 PM
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
2011 Nov 08 4:05 AM
Hi vijay,
Thanks alot.its working fine.
with best regards
Naresh Bammidi
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |