Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Tracking Events

Former Member
0 Kudos
144

Hi All,

I have requirement where I need to call a subroutine in different events and according to the event the subroutine will behave differently. Is there a way in ABAP to capture the current event of the program?

Regards,

Prashant.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
60

hi, the simplest thing would be,

you can set different flags in each event before calling subroutine.

write logic of subroutine based on these flags. Make sure you are clearing the flags appropraitely.

But anysways this is not a good programming style and you would need to craefully design it.

5 REPLIES 5

Former Member
0 Kudos
60

Hi Prashant,

If it is a report use the write statement and print the event name when you are processing the subroutine for that event.

IF you want to know, which event you are processing then use the FM SAPGUI_PROGRESS_INDICATOR.

The import parameters are PERCENTAGE and TEXT. pass the percentage as required between 0 to 100 and pass the event name in the TEXT. the text will be displayed in the status bar.

Hope this will solve your problem.

Regards,

Phani.

Former Member
0 Kudos
61

hi, the simplest thing would be,

you can set different flags in each event before calling subroutine.

write logic of subroutine based on these flags. Make sure you are clearing the flags appropraitely.

But anysways this is not a good programming style and you would need to craefully design it.

Former Member
0 Kudos
60

Hi:

have a look

[Event|http://help.sap.com/saphelp_nw2004s/helpdata/en/8d/25f972454311d189430000e829fbbd/content.htm]

Regards

Shashi

Former Member
0 Kudos
60

Hi,

I was also thinking on the same line as what Santosh has suggested, but is there a standard way of doing it.

Regards,

Prashant.

Former Member
0 Kudos
60

Closed.