Skip to Content
avatar image
Former Member

improve abap code in start routine in bw

TYPES: BEGIN OF TY_SOURCE,
CALMONTH TYPE /BI0/OICALMONTH,
COMP_CODE TYPE /BI0/OICOMP_CODE,
MATERIAL TYPE /BI0/OIMATERIAL,
/BIC/zsales TYPE /BIC/zsales,
/BIC/zvolume TYPE /BIC/zvolume,
END OF TY_SOURCE.
DATA: T_SOURCE TYPE TABLE OF TY_SOURCE,
WA_SOURCE TYPE TY_SOURCE,
T_SOURCE_F TYPE TABLE OF TY_SOURCE WITH HEADER LINE,
WA_SOURCE_F TYPE TY_SOURCE,
W_SOURCE LIKE LINE OF T_SOURCE,
W_SOURCE_F LIKE LINE OF T_SOURCE_F.


LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.

MOVE: <SOURCE_FIELDS>-CALMONTH TO W_SOURCE-CALMONTH,
<SOURCE_FIELDS>-COMP_CODE TO W_SOURCE-COMP_CODE,
<SOURCE_FIELDS>-MATERIAL TO W_SOURCE-MATERIAL,
<SOURCE_FIELDS>-/BIC/zsales TO W_SOURCE-/BIC/zsales,
<SOURCE_FIELDS>-/BIC/zvolume TO W_SOURCE-/BIC/zvolume.

APPEND W_SOURCE TO T_SOURCE.
ENDLOOP.

SORT T_SOURCE BY CALMONTH COMP_CODE MATERIAL.

LOOP AT T_SOURCE INTO WA_SOURCE.
COLLECT WA_SOURCE INTO T_SOURCE_F.
ENDLOOP.
SORT T_SOURCE BY CALMONTH COMP_CODE MATERIAL.
CLEAR T_SOURCE_F.
LOOP AT T_SOURCE_F[] INTO T_SOURCE_F.

ENDLOOP.
SORT T_SOURCE_F BY CALMONTH COMP_CODE MATERIAL.

Add comment
10|10000 characters needed characters exceeded

  • Please attach the full short dump (TXT zipped).

    Please don't provide the details as "answers", instead edit the original question and add an "addendum" section.

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 20, 2017 at 09:37 PM

    I have this code in my start routine, but when I load all the records it wont finish and is giving a memory dump, can somebody help me out pointing me where do I need an improvement in my code?? thanks

    Add comment
    10|10000 characters needed characters exceeded