Skip to Content
1
Former Member
May 27, 2013 at 03:02 PM

Optimize BW start and end routine

211 Views

Hello,

I created start and end routine from dso to cube to enhance some other data.

In developement system everything works fine. But in production system there are too much data. Because of that dtp needs a lot of time.

Can you tell me how I can optimize coding?

Global:

*$*$ begin of global - insert your declaration only below this line *-*
* 20130517 2462
* Deklaration der internen Tabellen und Workareas

* Lieferköpfe inkl. Lieferpriorität
TYPES:
BEGIN OF gs_dlv_head,
deliv_numb TYPE /bi0/oideliv_numb,
dlv_prio TYPE /bi0/oidlv_prio,
END OF gs_dlv_head.

DATA: lt_dlv_head TYPE STANDARD TABLE OF gs_dlv_head
WITH KEY deliv_numb.
"interne Tabelle
DATA: ls_dlv_head LIKE LINE OF lt_dlv_head. "Workarea

*$*$ end of global - insert your declaration only before this line *-*

Start routine:

* 20130517 2462
* Füllen der internen Tabellen aus Lieferköpfen (ZSD_D28).

BREAK-POINT.

* Auftragspositionen

LOOP AT SOURCE_PACKAGE ASSIGNING <source_fields>.
SELECT deliv_numb
dlv_prio

FROM /bic/azsd_d2800
INTO ls_dlv_head
WHERE deliv_numb = <source_fields>-refer_doc.
ENDSELECT.
APPEND ls_dlv_head TO lt_dlv_head.
ENDLOOP.

BREAK-POINT.

SORT lt_dlv_head ASCENDING BY deliv_numb.
DELETE ADJACENT DUPLICATES FROM lt_dlv_head COMPARING deliv_numb.

*$*$ end of routine - insert your code only before this line *-*

End routine:

*$*$ begin of routine - insert your code only below this line *-*
... "insert your code here
*-- fill table "MONITOR" with values of structure "MONITOR_REC"
*- to make monitor entries
... "to cancel the update process
* raise exception type CX_RSROUT_ABORT.

* 20110124 IT_CBO
* Füllen der fehlenden Felder im Ziel mit Daten aus den
* Auftragskpoepfen und Lieferpositionen.

DATA: lt_rp LIKE RESULT_PACKAGE.
DATA: lv_count TYPE i.
DATA: lv_ship_point(10) TYPE c,
lv_sales_off(10) TYPE c.

LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.

* Auftragspositionen

BREAK-POINT.

READ TABLE lt_dlv_head
INTO ls_dlv_head
WITH KEY deliv_numb = <result_fields>-deliv_numb.

IF sy-subrc = 0.
<result_fields>-dlv_prio = ls_dlv_head-dlv_prio.
<result_fields>-deliv_numb = ls_dlv_head-deliv_numb.
ELSE.
<result_fields>-deliv_numb = ''.
<result_fields>-deliv_item = ''.
IF <result_fields>-bill_type = 'ZBV' OR
<result_fields>-bill_type = 'ZBVR'.
<result_fields>-dlv_prio = '50'.
ENDIF.
ENDIF.

CONCATENATE '000000' <result_fields>-sales_off INTO lv_sales_off.
CONCATENATE '000000' <result_fields>-ship_point INTO lv_ship_point
.

IF <result_fields>-ship_point IS INITIAL.
<result_fields>-profit_ctr = lv_sales_off.
ELSE.
<result_fields>-profit_ctr = lv_ship_point.
ENDIF.

ENDLOOP.

I hope you can help me!

Regards

Jesper