09-21-2015 1:57 PM
Hi Team,
Can you please help me in the below select query. It is causing performance issue if i select the record based on aedtm field.
select pernr begda endda aedtm massn massg begda endda stat1 stat2
into CORRESPONDING FIELDS OF TABLE gt_pa00
from pa0000
for ALL ENTRIES IN itab
where pernr = itab-low and
aedtm IN s_seldt.
The functional need the latest employees record or the last changed on aedtm based on employee.
If i add the above select query it is creatinga performance issue. The functional doesnt want to select the record based on the endda and begda.
Thanks and Regards,
Pavithrra
09-22-2015 7:38 AM
Hi,
Instead of ' into CORRESPONDING FIELDS OF TABLE gt_pa00' , create a types for the selection fileds and move the same to the internal table..
check before the select statement , where itab is not initial.
if again performance issue there , i will suggest one more solution...
thanks,
Vijay SR
09-21-2015 2:34 PM
Hi.
You can:
1 - assign PNP logical database to your report and make a read like
INFOTYPES: 0000.
NODES: pernr.
TABLES: t001p.
get pernr.
rp-provide-from-last p0000 space pn-begda pn-endda. "In your case enlarge BEGDA and ENDDA
2 - Use function module HR_READ_INFOTYPE
3 - Try with a SELECT DISTINCT and ORDER option during SELECT instruction.
Hope to help.
Bye
09-21-2015 3:01 PM
Hi Roberto,
Thanks for your immediate reply. It is not for one pernr i need multiple pernrs based on the selection date range.
Will the above query work for this requirement.
Thanks,
Pavithrra
09-21-2015 3:32 PM
Hi.
In that case your "aedtm filter" should be applied after internal table it's loaded.
You could then sort and search first occurence of PERNR with a BINARY SEARCH.
Hope to help
09-22-2015 7:38 AM
Hi,
Instead of ' into CORRESPONDING FIELDS OF TABLE gt_pa00' , create a types for the selection fileds and move the same to the internal table..
check before the select statement , where itab is not initial.
if again performance issue there , i will suggest one more solution...
thanks,
Vijay SR
09-24-2015 9:32 AM
Hi Vijayakumar,
Sorry for replying late. I was sick for the past 2 days.
Thanks for the suggestion but I am already using the similar thing.
data: begin of gt_pa00 occurs 0,
pernr like pa0000-pernr,
begda like pa0000-begda,
endda like pa0000-endda,
AEDTM like pa0000-aedtm,
stat1 like pa0000-stat1,
stat2 like pa0000-stat2,
massn like pa0000-massn,
massg like pa0000-massg,
end of gt_pa00.
still it caused me the performance issue. Can you please provide the other solution.
Thanks.
Pavithrra
09-24-2015 1:55 PM
09-24-2015 2:51 PM
Hi Vijay,
Below is my code:
data: begin of gt_pa00 occurs 0,
pernr like pa0000-pernr,
begda like pa0000-begda,
endda like pa0000-endda,
AEDTM like pa0000-aedtm,
stat1 like pa0000-stat1,
stat2 like pa0000-stat2,
massn like pa0000-massn,
massg like pa0000-massg,
end of gt_pa00.
select pernr begda endda aedtm massn massg begda endda stat1 stat2
into CORRESPONDING FIELDS OF TABLE gt_pa00
from pa0000
for ALL ENTRIES IN itab
where pernr = itab-low and
aedtm IN s_seldt.
09-24-2015 5:39 PM
Hi,
Two Options...
1.Create a secondary index for the aedtm in pa0000
or
2.in select statement use only penr for select query
select pernr begda endda aedtm massn massg begda endda stat1 stat2
into TABLE gt_pa00
from pa0000
for ALL ENTRIES IN itab
where pernr = itab-low .
sort the gt_pa00 using pernr and aedtm
delete gt_pa00 where aedtm in selection screen
hope it helps
Please paste the code for the itab-low...where you populate the itab-low..Whether it have any balnk values???
Thanks,
Vijay SR
09-25-2015 9:58 AM
Hi Vijay,
Thanks for the suggestion. the itab has some values. I have done the changes and sent for testing.
Regards,
Pavithrra
09-24-2015 2:28 PM
Hi,
I believe you just need to select the maximun value contained in AEDTM field.
Please try as given below.
select pernr begda endda max(aedtm) massn massg begda endda stat1 stat2
into CORRESPONDING FIELDS OF TABLE gt_pa00
from pa0000
for ALL ENTRIES IN itab
where pernr = itab-low and
aedtm IN s_seldt.
09-24-2015 2:54 PM
Hi Jayati saha,
Thanks for your time. I have added the same logic in my code.
Anyways now I am trying with endda and begda in the query.
I will let you know whether that works fine.
THanks,
Pavithrra
09-24-2015 3:08 PM
Hi Pavithrra,
how many entries has your internal table itab?
Please read this note http://service.sap.com/sap/support/notes/48230
and check your profile parameters!
Good luck
By from Germany
09-25-2015 10:00 AM