ā2014 Sep 09 4:47 AM
Hi all,
Good day!
I would like to ask for your assistance on this,
SELECT SINGLE *
FROM zcp_dt_spas_main
INTO CORRESPONDING FIELDS OF wa_spasmain
WHERE pa_partner EQ m_crn-partner and ( penstat = 'A' or ( penstat = 'S' and parfs in ('C','N') ) ).
using SAT transaction code, it has a large execution time/run time.
How can tune this select statement to make it run faster than it is doing now?
Thank you so much.
Best regards.
ā2014 Sep 09 4:51 AM
Hi Almighty,
It's nearly imposible to help you if we don't know your Z table. What's the primary key? Is there any index? Is it a transparent table?
Cheers,
Custodio
ā2014 Sep 09 4:54 AM
ā2014 Sep 09 5:01 AM
ā2014 Sep 09 4:54 AM
You can try with removing 'INTO CORRESPONDING FIELDS ' and
SELECT single field name
FROM zcp_dt_spas_main
INTO wa_spasmain
WHERE pa_partner EQ m_crn-partner
and penstat in ('A' 'S')
and parfs in ('C','N').
ā2014 Sep 09 4:57 AM
How do you know this is a better option without knowing the structure of zcp_dt_spas_main and wa_spasmain? This could easily generate a short dump, i.e. if the structures are different and a numeric target field is receiving a non numeric character.
ā2014 Sep 09 5:05 AM
Hi,
I have tune your select statement.
Try using the code below code.
data : wa_spasmain type zcp_dt_spas_main.
select single *
FROM zcp_dt_spas_main
into wa_spasmain
WHERE pa_partner EQ m_crn-partner
if sy-subrc eq 0.
if penstat = 'A' or ( penstat = 'S' and parfs in ('C','N') )
............ write further code here.
endif.
endif.
Regards,
Dev