Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Performance improving

Former Member
0 Likes
1,072

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?

9 REPLIES 9
Read only

GauthamV
Active Contributor
0 Likes
1,046

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.

Read only

Former Member
0 Likes
1,046

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

Read only

Former Member
0 Likes
1,046

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..

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,046

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

Read only

Former Member
0 Likes
1,046

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.

Read only

Former Member
0 Likes
1,046

Hi,

While selecting data from the table BSAS, select all primary keys and also use FOR ALL ENTRIES statement.

Regards,

Jyothi CH.

Read only

Former Member
0 Likes
1,046

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

Read only

0 Likes
1,046

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.

Read only

Former Member
0 Likes
1,046

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.