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

запрос из chpos



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



Joined: 27 Sep 2007
Posts: 61

PostPosted: Thu Apr 17, 2008 3:42 pm    Post subject: запрос из chpos Reply with quote

Здравствуйте!
Есть ли возможность ускорить select? При интервале больше месяца стал падать в дамп по таймауту.

Code:
TABLES: mara, cdhdr.

SELECT-OPTIONS: so_matnr FOR mara-matnr,
                so_udate FOR cdhdr-udate.

DATA: lt_cdhdr TYPE TABLE OF cdhdr,
      lt_cdpos TYPE TABLE OF cdpos,
      ls_cdpos TYPE cdpos.

SELECT objectclas objectid changenr username udate utime
       planchngnr act_chngno change_ind
INTO CORRESPONDING FIELDS OF TABLE lt_cdhdr
FROM cdhdr
WHERE objectclas EQ 'MATERIAL'
  AND objectid IN so_matnr
  AND udate IN so_udate.

IF NOT lt_cdhdr[] IS INITIAL.
  SORT lt_cdhdr BY objectclas objectid changenr.

  SELECT objectclas objectid changenr tabname
         tabkey fname chngind text_case
  INTO CORRESPONDING FIELDS OF TABLE lt_cdpos
  FROM cdpos
  FOR ALL ENTRIES IN lt_cdhdr
  WHERE objectclas EQ lt_cdhdr-objectclas
    AND objectid EQ lt_cdhdr-objectid
    AND changenr EQ lt_cdhdr-changenr
    AND tabname EQ 'MVKE'
    AND fname EQ 'KEY'
    AND chngind IN ('I', 'D').
ENDIF.
Back to top
View user's profile Send private message
Alex80
Старший специалист
Старший специалист


Age: 44
Joined: 24 Jan 2008
Posts: 129

PostPosted: Thu Apr 17, 2008 4:03 pm    Post subject: Re: запрос из chpos Reply with quote

Максим wrote:
Здравствуйте!
Есть ли возможность ускорить select? При интервале больше месяца стал падать в дамп по таймауту.

Может так пропробовать?
Code:
  SELECT objectclas objectid changenr tabname
         tabkey fname chngind text_case
  APPENDING CORRESPONDING FIELDS OF TABLE lt_cdpos
  FROM cdpos
  PACKAGE SIZE 10000

  FOR ALL ENTRIES IN lt_cdhdr
  WHERE objectclas EQ lt_cdhdr-objectclas
    AND objectid EQ lt_cdhdr-objectid
    AND changenr EQ lt_cdhdr-changenr
    AND tabname EQ 'MVKE'
    AND fname EQ 'KEY'
    AND chngind IN ('I', 'D').

    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
      EXPORTING
  ...

  ENDSELECT.
Back to top
View user's profile Send private message
Максим
Специалист
Специалист



Joined: 27 Sep 2007
Posts: 61

PostPosted: Thu Apr 17, 2008 5:54 pm    Post subject: Reply with quote

Alex80, спасибо за реплику. замеры показали ускорение только на 2%
Back to top
View user's profile Send private message
Alex80
Старший специалист
Старший специалист


Age: 44
Joined: 24 Jan 2008
Posts: 129

PostPosted: Thu Apr 17, 2008 5:56 pm    Post subject: Reply with quote

Максим wrote:
Alex80, спасибо за реплику. замеры показали ускорение только на 2%

Пожалуй я поспешил
Quote:
If the addition PACKAGE SIZE is specified together with FOR ALL ENTRIES, it is not passed to the database system, but is applied to the result set on the application server, after all selected rows have been read.
Back to top
View user's profile Send private message
Armann
Модератор
Модератор



Joined: 01 Jan 2008
Posts: 422
Location: Moscow

PostPosted: Fri Apr 18, 2008 9:55 am    Post subject: Reply with quote

Периодический вызов ФМ 'SAPGUI_PROGRESS_INDICATOR' вам поможет избежать тайм-аута, а вот сильно быстрее сделать вам навряд ли удастся - посмотрите сколько строк в таблице CDPOS, а она еще и кластерная.
Может быть немного поможет архивация и/или удаление старых и предположительно ненужных документов изменений
Back to top
View user's profile Send private message Blog
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.