Skip to Content
0
Former Member
Jun 10, 2013 at 05:10 AM

Endroutine in BW, datapackage size

69 Views

Hi ABAP experts

I hope I am at the discussion place.

In SAP BW I wrote an endroutine. There exists a few contracts FC_VTREF which starts with "F" at the first place. All contracts FC_VTREF are normally assigned to an "old" contract ZCD_VT_Q. But the "F"-contracts don't have such an assignment, which can and must be corrected in SAP BW. The logic can be seen below.

Source is a normal table (DSO), target is also a DSO.

The object to transfer data from source to target is called data transfer process (DTP). It has a standard package size of 50.000 records. Unfortunately with this standard size the ABAP logic doesn't work. The total quantity of records is around 8 Mio. If you increase the package size from 50.000 to 10Mio. records then the logic works. But this should be not the "normal" case...any ideas where the coding might be incorrect for the standard package size of 50.000?

TYPES: BEGIN OF CONTRACT,
FC_VTREF TYPE /BI0/OIFC_VTREF,
/BIC/ZCD_VT_Q TYPE /BIC/OIZCD_VT_Q,
END OF CONTRACT.


DATA: ITAB TYPE STANDARD TABLE OF CONTRACT, WA TYPE CONTRACT.
DATA: KEY_CONTRACT TYPE /BI0/OIFC_VTREF.

SELECT FC_VTREF /BIC/ZCD_VT_Q FROM /BIC/AZFC_DS1000 INTO TABLE ITAB
FOR ALL ENTRIES IN RESULT_PACKAGE WHERE
FC_VTREF = RESULT_PACKAGE-FC_VTREF

and

/BIC/ZCD_VT_Q = RESULT_PACKAGE-/BIC/ZCD_VT_Q.

SORT ITAB BY FC_VTREF.
LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
IF <RESULT_FIELDS>-FC_VTREF+0(1) = 'F'.

CONCATENATE '000000000000' <RESULT_FIELDS>-FC_VTREF+1(8) into KEY_CONTRACT.
READ TABLE ITAB INTO WA WITH KEY FC_VTREF = KEY_CONTRACT BINARY SEARCH.

IF SY-SUBRC EQ 0.
<RESULT_FIELDS>-FC_VTREF = <RESULT_FIELDS>-FC_VTREF.
<RESULT_FIELDS>-/BIC/ZCD_VT_Q = WA-/BIC/ZCD_VT_Q.
ENDIF.
ELSE.
<RESULT_FIELDS>-FC_VTREF = <RESULT_FIELDS>-FC_VTREF.
<RESULT_FIELDS>-/BIC/ZCD_VT_Q = <RESULT_FIELDS>-/BIC/ZCD_VT_Q.

ENDIF.
ENDLOOP.