Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9236

Re: Customer Aging Report ( Select Statement Issue)

$
0
0

Hi Tejdeep,

 

Kindly revise the code as I found Performance Tuning should be done. Such as

 

1.Please dont use CORRESPONDING INTO in SELECT statements.

2. Please dont use SELECT statement in a LOOP..ENDLOOP.

3. Whenever it's possible avoid SELECT DISTINCT, instead select data into internal table, sort and use DELETE ADJACENT DUPLICATES.

 

Coming to the Customer Name :

 

 

 

First fetch the from KNA1 table where KUNNR in Select-options and sort the data from KNA1 & ITAB with KUNNR . Then at write a READ statement in the below loop reading KUNNR as a key.

 

LOOP AT ITAB.

IF ITAB-SHKZG = 'H'.

    ITAB-DMBTR = ITAB-DMBTR * -1.

    MODIFY ITAB.

ELSE.

       ITAB-DMBTR = ITAB-DMBTR * 1.

    MODIFY ITAB.

ENDIF.

Please let me know if any quieries.

 

Thanks & Regards,

Seshadri

 


Viewing all articles
Browse latest Browse all 9236

Trending Articles