‎2009 Jan 07 5:43 AM
Hi All,
I have written a select statement. It takes more time for execution.
eq: I am selecting GL acounts from SKB1 based on company code and Open Item management set = 'X'
After getting GL Accounts from SKB1.
I need to find out the record in BSIS for each GL Account.
based on selection Company code , GL account for all entries from SKB1 and Document Number of the Clearing Document (AUGBL) NE space. In this BSIS table, if any one entry satisfies the condition i have to say Failure else success.
taking data from BSIS is taking long time.
Performance getting affected. hw can I incrs the performace?
‎2009 Jan 07 5:48 AM
hi,
do like this.
if not it_skb1[] is initial.
SELECT bukrs
hkont
augdt
augbl
zuonr
gjahr
belnr
buzei
blart
auggj
FROM bsas
INTO TABLE it_bsas
FOR ALL ENTRIES IN it_skb1
WHERE bukrs = it_skb1-bukrs AND
hkont = it_skb1-hkont .
endif.
‎2009 Jan 07 5:54 AM
Hi Praveen,
The selection from BSIS should not give you problem since you are passing 3 primary keys of the table.
Could you please pass your piece of code.
Regards,
Swati
‎2009 Jan 07 5:57 AM
1.Before fetching data from BSIS check whether SKB1 table is not initial..
if skb1 is not initial.
select ....from BSIS..
end if..
2.After getting the data from BSIS,
check the sy-subrc and then proceed.
if sy-subrc = 0.
endif..
‎2009 Jan 07 6:05 AM
Hello Praveen,
If you can provide us the code, then we can comment on it.
But my issue is with Fiscal year (BSIS-GJAHR) not being used. If you are not using it, the query will search for all the Fiscal Yrs and it will take time.
Waiting for your input.
BR,
Suhas
‎2009 Jan 07 6:08 AM
it wud be better if u provide us with ur code.
anyways if u using For all entries replace it with inner joins.
they are much better in performance.
‎2009 Jan 07 6:11 AM
Hi,
While selecting data from the table BSAS, select all primary keys and also use FOR ALL ENTRIES statement.
Regards,
Jyothi CH.
‎2009 Jan 07 6:16 AM
Hi Praveen,
You have to check for one entry alone use 'UPTO 1 ROWS' statement in your select query this improves the performance of your query.
it is like this......
SELECT XXX from BSIS
up to 1 rows
for all etries in GL
where gl = ..........
.
ENDSELECT.
if sy-subrc = 0.
FAILURE.
else.
SUCCESS.
endif.
Regards Madhu
‎2009 Jan 07 6:41 AM
Hi Madhavi,
Can i use
select single statement within SKB1 internal table loop.
eq: Get the Gl Acc from SKB1.
loop at skb1.
select single hknot from bsis for where condition.
if sy-subrc eq 0.
exit.
endif.
endloop.
‎2009 Jan 07 6:20 AM
if it_skb1[] is not initial.
SELECT F1 F2 ... FROM bsis
INTO TABLE it_bsis
FOR ALL ENTRIES IN it_skb1
WHERE bukrs = it_skb1-bukrs
AND hkont = it_skb1-hkont
AND AUGBL NE ' '.
If sy-subrc = 0.
Failure message
ELSE
Success msg
ENDIF.
ENDIF.