Hello,
is there a way to make a loop faster or to replace it by something faster? I know of 'for all entries' but what if the two fields aren't compatible?
SELECT rqposname RQIDENT
INTO TABLE t_output
FROM tsp01
WHERE rqposname EQ lv_email.
LOOP AT t_output ASSIGNING FIELD-SYMBOL(<fs2>).
SELECT SINGLE jobname progname variant listident
INTO ( <fs2>-jobname, <fs2>-progname, <fs2>-variant, <fs2>-listident )
FROM tbtcp
WHERE listident EQ <fs2>-rqident
AND listident NE '0'.
ENDLOOP.
This takes a few minutes even though there are "only" 1300 rows in t_output.
Any Tips?
Thanks in advance.
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Two CDS!
First:
define view ztbtcp
as select from tbtcp
{
cast ( listident as abap.int4 ) as listident,
variant,
progname,
jobname
}Second:
define view zoutput
as select from tsp01
left outer join ztbtcp
on tsp01.rqident = ztbtcp.listident
{
rqposname,
listident,
variant,
progname,
jobname
}
where listident <> 0
If you need more fields in the output-structure, define them in the second CDS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.