Skip to Content
0

code for 1st data package only in start routine

Mar 14 at 03:02 AM

26

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Cleo James Mar 14 at 09:11 AM
0

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?

Share
10 |10000 characters needed characters left characters exceeded
Andrey Uryukin Mar 14 at 09:24 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded