Skip to Content
0
Former Member
May 26, 2014 at 09:31 AM

Routine with intervall in lookup DSO

87 Views

Hi ABAP experts

We need to fill up the results with master data from a source DSO. This source DSO has the following character:

ZZBRAR1 and ZZBRAR describe an interval, also ZZBRARW1 and ZZBRARW.

The source DSO which delivers the result package doesn't have an interval on these two characteristics, only a valid value which lies between the interval of the lookup DSO.

The following coding has been applied as endroutine. Execution of DTP ends in a short dump TSV_TNEW_PAGE_ALLOC_FAILED.

Any ideas where to optimize the coding?

Thanks

TABLES: /BIC/AZFC_DS9600.
DATA: ITAB TYPE STANDARD TABLE OF /BIC/AZFC_DS9600 WITH HEADER LINE.
DATA: WA LIKE LINE OF ITAB.

*$*$ end of 2nd part global - insert your code only before this line *

*---------------------------------------------------------------------*
* CLASS routine IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_transform IMPLEMENTATION.

*----------------------------------------------------------------------*
* Method end_routine
*----------------------------------------------------------------------*
* Calculation of result package via end routine.
* Note: Update of target fields depends on rule assignment in
* transformation editor. Only fields that have a rule assigned,
* are updated to the data target.
*----------------------------------------------------------------------*
* <-> result package
*----------------------------------------------------------------------*
METHOD end_routine.
*=== Segments ===

FIELD-SYMBOLS:
<RESULT_FIELDS> TYPE _ty_s_TG_1.

DATA:
MONITOR_REC TYPE rstmonitor.

*$*$ 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.

DATA: ITAB_REFRESH TYPE STANDARD TABLE OF _ty_s_TG_1.
DATA: ITAB_TARGET TYPE STANDARD TABLE OF _ty_s_TG_1.
DATA: WA_TARGET LIKE LINE OF ITAB_TARGET.
DATA: ICOUNT TYPE RSARECORD.

IF RESULT_PACKAGE[] IS NOT INITIAL.
ICOUNT = 1.
REFRESH ITAB.

SELECT * FROM /BIC/AZFC_DS9600 INTO TABLE ITAB.

REFRESH ITAB_TARGET.

LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
LOOP AT ITAB INTO WA.

IF WA-/BIC/ZZBRA1 <= <RESULT_FIELDS>-/BIC/ZZBRA3
AND WA-/BIC/ZZBRA >= <RESULT_FIELDS>-/BIC/ZZBRA3
AND WA-/BIC/ZZBRARW1 <= <RESULT_FIELDS>-/BIC/ZZBRARW
AND WA-/BIC/ZZBRARW >= <RESULT_FIELDS>-/BIC/ZZBRARW.

<RESULT_FIELDS>-/BIC/ZWWSIC = WA-/BIC/ZWWSIC.
<RESULT_FIELDS>-/BIC/ZWWPRD = WA-/BIC/ZWWPRD.

ICOUNT = ICOUNT + 1.
APPEND <RESULT_FIELDS> TO ITAB_TARGET.

ELSE.
"keep ZZWWSIC and ZZWWPRD initial and transfer result package.


ICOUNT = ICOUNT + 1.
APPEND <RESULT_FIELDS> TO ITAB_TARGET.

ENDIF.


ENDLOOP.
ENDLOOP.

REFRESH RESULT_PACKAGE.
RESULT_PACKAGE[] = ITAB_TARGET[].
ENDIF.

Attachments

Capture.JPG (71.7 kB)