SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Ускорение CLAF_CLASSIFICATION_OF_OBJECTS



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
Влад
Специалист
Специалист



Joined: 26 Dec 2007
Posts: 63

PostPosted: Wed Sep 30, 2009 2:42 pm    Post subject: Ускорение CLAF_CLASSIFICATION_OF_OBJECTS Reply with quote

Здравствуйте, трассировка работы функции CLAF_CLASSIFICATION_OF_OBJECTS показала большое количество запросов к таблице UST12, из-за чего отчет тормозит.
Если нужно получить данные, как ниже, какую более быструю функцию использовать?

Code:
DATA: e_matkl TYPE mtart.
DATA:
  t_class_p    TYPE sclass OCCURS 0,
  t_objectdata_p TYPE clobjdat OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
  EXPORTING
    class              = 'IPDM_F0101'   "Product Category
    classtext          = 'X'
    classtype          = '001'
    clint              = '0000000032'
    language           = sy-langu
    object             = 'FA000600'
    key_date           = sy-datum
    initial_charact    = 'X'
    no_value_descript  = 'X'
    inherited_char     = 'X'
    objecttable        = 'MARA'
  TABLES
    t_class            = t_class_p
    t_objectdata       = t_objectdata_p
  EXCEPTIONS
    no_classification  = 1
    invalid_class_type = 2.
IF sy-subrc IS INITIAL.
  READ TABLE t_objectdata_p WITH KEY atnam = 'IPDM_PRDCT'.
  IF sy-subrc IS INITIAL.
    e_matkl = t_objectdata_p-ausp1.
  ENDIF.
ENDIF.
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


Age: 45
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Wed Sep 30, 2009 2:52 pm    Post subject: Reply with quote

Наверное, напрямую из таблиц значения считывать быстрее будет. Поищите по форуму, Удав уже рассказывал как практичнее классификацию считывать.
Back to top
View user's profile Send private message Blog
vga
Мастер
Мастер


Age: 95
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Wed Sep 30, 2009 4:42 pm    Post subject: Reply with quote

Добавьте ограничивающий параметр i_sel_characteristic, должно ускорить.

Code:
DATA: e_matkl TYPE mtart.
DATA:
  t_class_p    TYPE sclass OCCURS 0,
  t_objectdata_p TYPE clobjdat OCCURS 0 WITH HEADER LINE.
DATA:
  t_sel_char TYPE sel_char OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'
     EXPORTING
          input  = 'IPDM_PRDCT'
     IMPORTING
          output = t_sel_char-atinn.

APPEND t_sel_char.

CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
     EXPORTING
          class                = 'IPDM_F0101'  "Product Category
          classtext            = 'X'
          classtype            = '001'
          features             = 'X'
          clint                = '0000000032'
          language             = sy-langu
          object               = 'FA000600'
          key_date             = sy-datum
          initial_charact      = 'X'
          no_value_descript    = 'X'
          inherited_char       = 'X'
          objecttable          = 'MARA'
     TABLES
          t_class              = t_class_p
          t_objectdata         = t_objectdata_p
          i_sel_characteristic = t_sel_char
     EXCEPTIONS
          no_classification    = 1
          invalid_class_type   = 2.

IF sy-subrc IS INITIAL.
  READ TABLE t_objectdata_p INDEX 1.
  IF sy-subrc IS INITIAL.
    e_matkl = t_objectdata_p-ausp1.
  ENDIF.
ENDIF.

WRITE: e_matkl.
Back to top
View user's profile Send private message Blog Visit poster's website
Влад
Специалист
Специалист



Joined: 26 Dec 2007
Posts: 63

PostPosted: Thu Oct 01, 2009 10:27 am    Post subject: Reply with quote

Стало в 5 раз быстрее, спасибо.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.