‎2016 May 26 3:31 PM
Hello,
My requirement is to fetch the spool number from SP01 based on Suffix2, Created by & Date.
I fetch data from TSP01 based on the selection criteria.
The issue here is that, the date field in TSP01(RQCRETIME) is a combination of Date & Time (YYYYMMDDHHMMSS00)
So, I cannot pass the selection field (s_date) to the SELECT statement.
This is my current code.
*--------------------------------------------Start-of-Code--------------------------------------------*
FORM sub_fetch_data.
* to overcome the data type limitation of TSP01-RQCRETIME
LOOP AT s_date.
r_RQCRETIME-SIGN = s_date-SIGN.
r_RQCRETIME-OPTION = s_date-OPTION.
CONCATENATE s_date-LOW '*' INTO r_RQCRETIME-LOW.
IF NOT s_date-HIGH IS INITIAL.
CONCATENATE s_date-HIGH '*' INTO r_RQCRETIME-HIGH.
ENDIF.
APPEND r_RQCRETIME.
ENDLOOP.
* fetch data from tsp01
SELECT RQIDENT RQ2NAME RQOWNER RQCRETIME
FROM TSP01
INTO TABLE lit_tsp01
WHERE RQ2NAME IN s_sufx2 AND
RQOWNER IN s_user AND
RQCRETIME IN r_RQCRETIME.
IF sy-subrc = 0.
SORT lit_tsp01 BY RQIDENT.
ELSE.
err_nospool = 'X'.
ENDIF.
ENDFORM.
*--------------------------------------------End-of-Code--------------------------------------------*
Here I'm trying to add * to the end of the the user input date & passing it to SELECT statement.
This is not working when there is a date range.
Please advice on how to proceed with this.
I want to pass all three fields to the SELECT statement.
I don't want to process the date part separately.
Or, is there any other TABLE-FIELD which has only the Spool Date.
Thanks & Regards,
Balaji Manoharan.
‎2016 May 26 7:43 PM
Hi Balaji Manoharan,
When you're population range R_RQCRETIME you must change OPTION to CP (Contains Pattern) instead of EQ.