cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Counter Routine

Former Member
0 Kudos

Hi all,

can anyone help me with the following problem:

I want to load Data into an ODS. I have to count the documents but not the positions. (Both are key fields)

Example:

Char1 Char2(pos) Char3 (Counter)

4700_______1________1 (or x)

4700_______2________0

4700_______3________0

The Problem is, that also this example could be

Char1 Char2(pos) Char3 (Counter)

4700_______3________1 (or x)

4700_______4________0

Thank you very much for your help, best regards

Frank

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

is Header always position 1? The you could do a routine for counter field.

if pos = 1.

result = 1.

endif.

Former Member
0 Kudos

Hi Oscar,

thanks for your reply, but position is not always "1".

It could be that the first pos. is e.x. "3"

Thank you very much for your help, regards

Frank.

Former Member
0 Kudos

then in update rules you have a problem. One document can be firsts positions in one package and the next one in the following package, then you can identify two header for same document. One posible solution is this:

define static variable with doc number, then it is mainteined for all update process, along different infopackage. If current doc number is the same that your doc number stored in static variable do anything else count = 1 and update static variable.