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

Former Member
0 Likes
739

hi sap,

i have to display the CHARACTERISTIC values based on the combination of the 2 characterisctic values namely,

1. cc-handlingcat

2. cc-handlingsubcat

to get values for that combianation what am doing is......i do a select like this

SELECT matnr FROM mara APPENDING CORRESPONDING FIELDS OF TABLE ly_mara. then i loop each material number

LOOP AT ly_mara INTO lw_mara.

object1 = lw_mara-matnr.

CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'

EXPORTING

classtype = '001'

object = object1

TABLES

t_class = t_class

t_objectdata = object_data1

EXCEPTIONS

no_classification = 1

no_classtypes = 2

invalid_class_type = 3

OTHERS = 4.

IF sy-subrc <> 0.

CASE sy-subrc.

WHEN 1.

WRITE 'No Classification found'.

WHEN 2.

WRITE 'No Class type found'.

WHEN OTHERS.

WRITE 'Invalid class type'.

ENDCASE.

ENDIF.

now i get the all the characteristic values and i make a check like this

CHECK wa_cawn-atwrt eq var12 ( screen value)

CHECK wa_cawn-atwrt eq var13 ( screen value)

if sy-subrc = 0.

display or else display nothing

endloop.

BUT IT IS TAKE TOO LONG TIME MAY BE 30M IN DAV ITSELF .

What can i do to improve the performance? your help is highly appriciated.

thank you,

pasala.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
585

Hi

You can assign field symbols.It will improve the performance.

Sample code is given below:

*--field symbols declarations

FIELD-SYMBOLS: <FS_KNA1> TYPE T_KNA1.

*--usage in loop

LOOP AT IT_kna1 ASSIGNING <FS_kna1>.

*--in read statements

READ TABLE IT_KNA1 ASSIGNING <FS_KNA1> WITH KEY KUNNR = <FS_COMBINE>-KUNNR BINARY SEARCH.

Do F1 on field symbols and you will get more examples.

Thanks

Khushboo

Edited by: K rathi on Jan 12, 2010 9:28 AM

5 REPLIES 5
Read only

Former Member
0 Likes
586

Hi

You can assign field symbols.It will improve the performance.

Sample code is given below:

*--field symbols declarations

FIELD-SYMBOLS: <FS_KNA1> TYPE T_KNA1.

*--usage in loop

LOOP AT IT_kna1 ASSIGNING <FS_kna1>.

*--in read statements

READ TABLE IT_KNA1 ASSIGNING <FS_KNA1> WITH KEY KUNNR = <FS_COMBINE>-KUNNR BINARY SEARCH.

Do F1 on field symbols and you will get more examples.

Thanks

Khushboo

Edited by: K rathi on Jan 12, 2010 9:28 AM

Read only

Former Member
0 Likes
585

Hi pasalabasker,

Avoid using INTO CORRESPONDING fields. Instead select only the required fields. This will improve the perfromance a bit. And try to find out an FM wher you can send all the matnr as a table, if not go for a Z copy of the same FM and change accordingly.

Thanks,

Saravanan Rajan

Read only

Former Member
0 Likes
585

Hi,

do not read each characteristic values separately in a loop. Read all of them with one select from AUSP table.

Very simplified a select will look like this:

SELECT objek INTO CORRESPONDING-FIELDS OF TABLE ly_mara
   FROM ausp AS a1
  INNER JOIN ausp AS a2
  ON a1~objek EQ a2~objek
   WHERE a1~atwrt EQ var12
       AND a2~atwrt EQ var13
.

When You look at entries of AUSP table for some materials (OBJEK = MATNR), You will surely find also how to provide some other restrictions to select to improve it's performance( at least ATINN, MAFID, KLART ).

Regards,

Adrian

Read only

Former Member
0 Likes
585

sorted by self but few answers were really helpful.

Read only

0 Likes
585

>

> sorted by self but few answers were really helpful.

If they wre really helpful, why not mark them as such?

And please use code tags to format your code.

Rob

Edited by: Rob Burbank on Jan 15, 2010 9:42 AM