Application Development and Automation 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: 
Read only

IN UPDATE TASK -> get calling transaction / stack ?

Former Member
0 Likes
1,707

hi,

when we are inside a "IN UPDATE TASK" (or "IN NEW TASK") processing, is there any way to find some information about the caller / the calling transaction or even some information about the execution stack (like via FM SYSTEM_CALLSTACK) ?


Thanks a lot,

Roland

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,425

Hello Roland,

Is it a local update (SET UPDATE TASK LOCAL) or is it executed in an update workprocess?

If the update task is executed in a separate WP, i don't think SYSTEM_CALLSTACK will help.

BR,

Suhas

8 REPLIES 8
Read only

suresh_kutam
Participant
0 Likes
1,425

Hello Roland,

You can check in debug by switching on update debugging.

Thanks,

SK

Read only

Former Member
0 Likes
1,425

Hi Roland,

Did you check FM SYSTEM_CALLSTACK?

R

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,426

Hello Roland,

Is it a local update (SET UPDATE TASK LOCAL) or is it executed in an update workprocess?

If the update task is executed in a separate WP, i don't think SYSTEM_CALLSTACK will help.

BR,

Suhas

Read only

Former Member
0 Likes
1,425

It is an update work process.

I did check FM SYSTEM_CALLSTACK. It does not return the full stack (as we are in an update work process). But I wonder whether it is maybe possible to get some information about the process which started the update one.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,425

But I wonder whether it is maybe possible to get some information about the process which started the update one.

I don't think update function modules need to know who the caller, they should only be doing the C(R)UD operations. The data checks should be done beforehand.

If you can explain your business requirement, may be we can suggest some alternative solution.

Read only

Former Member
0 Likes
1,425

Technically you can get the information.

1. SYSTEM_CALLSTACK will give you the FM name where the code is being executed.

2. VBMOD table will give you the VBKEY - VBMOD-VBFUNC is your FM name.

3. VBHDR will give you the PROGRAM name in  VBHDR-VBREPORT and Tcode details in VBTCODE

R

Read only

Former Member
0 Likes
1,425

I need to collect some detailed statistics where some database entries are created from (which transaction, GUI or RFC call, use..). These entries are usually created in update task by a single function module. Instead of adding code to each place where the function module is called, I was hoping there is a way to collect these statistics inside the update task.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,425

What if the update FM is called by multiple sources? How will you determine which is the relevant update key?