cancel
Showing results for 
Search instead for 
Did you mean: 

Getting event counter in own TM event data extraction

former_member194343
Participant
0 Kudos

Hi folks,

I have defined some custom events and want to offer the possibility of reporting them in TM with subsequent transfer to EM. Therefore I have to define a custom event data extraction function to put it into the customizing. However, there's one problem: The standard extraction functions use a global variable gv_evtcnt (defined in include /SCMTMS/LSCEM_TORTOP) to read and increment the event number for each new event which is extracted. I can't use this in custom functions, obviously, because I can't put my function module into the SAP function group. This might lead to problems when standard and custom events are reported together in one update.

How do I ensure that a consistent numbering is achieved in this situation? Or is this event number of no relevance at all, so I don't have to care?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Michael,

1) For your custom Event Type, make sequence number on general data tab to be higher than your standard Event types so that your standard Event Types are processed first.

2) In you custom Event Type, you can define a local LV_EVTCNT. Then you can do the following:

lv_evtcnt = lines( CT_TRACKINGHEADER ) " This is give you num of events in the structure

lv_evtcnt = lv_evtcnt + 1.

Only thing you need to check in CT_TRACKINGHEADER[] before getting count of existing events is to make sure the EVTCNT numbers are in sequence. If they are not in sequence, do not use LINES statement to get total count. Rather use the following logic:

Sort ct_trackingheader  by evtcnt descending.

read ct_trackingheader into wa_temp index 1.

lv_evtcnt = wa_temp-evtcnt + 1.

Now you have your next number ( event count ) for your custom Events.

Thanks,

Vishnu

former_member194343
Participant
0 Kudos

Thanks Vishnu! How I could fetch the current number I thought of already, but the remaining problem was how subsequent standard events could do the same.

F1 help for the sequence number field is rather meaningless, I would never have guessed from that that it determines the processing sequence... Maybe one more question: What happens with events where no sequence number is specified (as this is no mandatory field)? Are they processed before or after all other events?

Former Member
0 Kudos

Hi Michael,

It's not mandatory. If no Sequential Number is provided in Event Type, these Event Types will be processed first.

Thanks,

Vishnu

Answers (0)