cancel
Showing results for 
Search instead for 
Did you mean: 

data package no. through (start) routine into an attribute

Former Member
0 Kudos
121

Hi all,

does anyone have an idea of reading the no. of the processed data package into a variable in a start routine and hand over to routine?

my code:

<b>start routine:</b>

[code]PROGRAM UPDATE_ROUTINE.

$$ begin of global - insert your declaration only below this line -

  • TABLES: ...

<b> DATA: DP(10) TYPE N,

RN(10) TYPE N.

</b>

$$ end of global - insert your declaration only before this line -

...

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

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

  • to make monitor entries

<b>DP = DATA_PACKAGE-RECNO.

</b>

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

ABORT = 0.

...

[/code]

<b> routine:</b>

[code]PROGRAM UPDATE_ROUTINE.

$$ begin of global - insert your declaration only below this line -

  • TABLES: ...

<b>DATA: DP(10) TYPE N,

RN(10) TYPE N.</b>

$$ end of global - insert your declaration only before this line -

...

  • fill the internal table "MONITOR", to make monitor entries

<b>RN = RECORD_NO.

CONCATENATE RN RN INTO RESULT.

</b>

  • if the returncode is not equal zero, the result will not be updated

RETURNCODE = 0.

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

ABORT = 0.

...[/code]

Somehow there is no data in my global variable (DP), so nothing is transfered.

The Record_No works, but not the Datapack-No.

Any idea?

Thanks in advance.

Cu, stefan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Stefan,

there is no data package no. in this start routine. The field recno should be the record number within the data package but not the data package no.

May be you can try the following in the form startup:

statics: s_count(10) type n value 0.

s_count = s_count + 1.

dp = s_count.

Hope this helps

regards

Siggi

Former Member
0 Kudos

Thanks Siggi,

IT WORKS! and now i understand that there is no data_package No.

thanks a lot!

regards

Stefan

Former Member
0 Kudos

Hi Siggi,

somehow it works, but for how long does value of the static variable remain in the memory?

do you have any solution how it can be set to 0 after the load?

the problem is that when i load more than 1x the static variable will remain in the memory and continue counting.

so it's not really a correct and satisfying solution.

any other ideas?

cu, stefan

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

could you explain what do you want to get by this code?

start routine:

it is executed only once for each idoc (so you can get only one value)

and to fill data_package header (to have data_package-recno) you have to head it first e.g. with read-table command. (check syntax by typing read-table in editor, set cursor on that wordand hit F1)

Only then you get data for your DP

routine:

you concatenate same variable twice, it is ok?

CONCATENATE RN RN INTO RESULT.

Regards,

Andrzej

ps. type-in Gary Nolan in SDN search for all areas and you will get document named Advanced data transformations in BW, there is some tricks on working with BW (eg debugging transfer/update rules)