Skip to Content

code for 1st data package only in start routine

Hi,

I am running an update database statement in the start routine since I need to run this code before other pieces of code in transformation.

But issue is this update statement is executed for every data package which is unnecessary.

How can I restrict the update statement to be executed only once, just for the first data package execution perhaps?

Regards,

Cleo

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 14 at 09:11 AM

    Should I use any other place to put the update statement? I need the update statement to run before any code in the start routine and only execute the update statement once. Is there any place before start routine, that I could place this update statement so that It does not run for every data package?

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14 at 09:24 AM

    Hi,

    In principle you can define some global variable in global part of transformation:

    *$*$ begin of global - insert your declaration only below this line *-*
     data: lv_packages type i.
    *$*$ end of global - insert your declaration only before this line *-*

    then at the start of start routine do the next:

    lv_packages= lv_packages+ 1.
    if lv_packages = 1.
    do insert ...
    endif.

    BR

    Add comment
    10|10000 characters needed characters exceeded