Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

copy and modify records in start routine

Hello,

I want to copy the records of the data_package in the start routine. But when I do this I get the dump TSV_TNEW_PAGE_ALLOC_FAILED.

What we want to is, to fill an InfoCube which has the Key Figure "Moving anual total" and therefor I would like to copy a record 11 times so that I get it for 12 months.

Could it be, that I get to much records and the system has not enough memory. How can I solve this problem?

Many thanks in advanced,

Benjamin

Coding in start routine:

*

$$ begin of routine - insert your code only below this line -

  • fill the internal tables "MONITOR" and/or "MONITOR_RECNO",

  • to make monitor entries

DATA: w_sdbeleg like line of DATA_PACKAGE.

DATA: h_calday type /BI0/OICALDAY.

loop at DATA_PACKAGE into w_sdbeleg.

h_calday = w_sdbeleg-calday.

  • h_calmonth = w_sdbeleg-calmonth.

do 11 times.

CALL FUNCTION 'Z_ADD_MONTH_TO_DATE'

EXPORTING

MONTHS = 1

OLDDATE = h_calday

IMPORTING

NEWDATE = h_calday.

w_sdbeleg-calmonth = h_calday(6).

insert w_sdbeleg into table DATA_PACKAGE.

enddo.

endloop.

  • if abort is not equal zero, the update process will be canceled

ABORT = 0.

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

*

Former Member
Former Member replied

Hi Benjamin,

Problem with the code:

$$ begin of routine - insert your code only below this line -

  • fill the internal tables "MONITOR" and/or "MONITOR_RECNO",

  • to make monitor entries

DATA: w_sdbeleg like line of DATA_PACKAGE.

DATA: h_calday type /BI0/OICALDAY.

loop at DATA_PACKAGE into w_sdbeleg.

h_calday = w_sdbeleg-calday.

  • h_calmonth = w_sdbeleg-calmonth.

do 11 times.

CALL FUNCTION 'Z_ADD_MONTH_TO_DATE'

EXPORTING

MONTHS = 1

OLDDATE = h_calday

IMPORTING

NEWDATE = h_calday.

w_sdbeleg-calmonth = h_calday(6).

<b>insert w_sdbeleg into table DATA_PACKAGE.</b>

Insert means you are adding one more record into data_package, inside the loop. It is going into infinite loop.

Remove the <i>insert w_sdbeleg</i> from inside the loop put at after the end of the loop.

or use <b>Modify data_package from w_sdbeleg inside the loop.</b> it will modify the existing record.

enddo.

endloop.

  • if abort is not equal zero, the update process will be canceled

ABORT = 0.

<b>Or</b> create a one more internal table and modify the records and pust into new internal table.

After end loop for data_package refresh the data_packae and insert all the records from the new internal table to data_package.

Hope it works.

Srini

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question