2009 Jun 15 5:46 PM
Hi
I need to get the initial tcode from a second called tcode.
That is , F-43 calls FB01 ; i'm doing some enhancement where i need to detect wich tcode is being executed , but i need the initial tcode F-43 not FB01.
Does somebody knws how can i get that initial tcode executed by user from the second tcode called ?
Thanks
Frank
2009 Jun 16 5:00 AM
Hi,
I guess you can determine this with the help of call stack. Use FM SYSTEM_CALLSTACK to get the current call stack and try to find the called tcode from this.
I hope this may be useful.
Regards
Karthik D
2009 Jun 15 5:52 PM
try getting the sy-cprog and use that to hit TSTC table to get the T code of it.
2009 Jun 15 6:14 PM
2009 Jun 15 6:20 PM
Thanks Joy
The point is that both Tcodes call the same program SAPMF05A .
There are several FI tcodes wich calls the FB01 tcode , the 'alternate' tcodes like F-43 are for post documents for specific posting keys then calls FB01 (wich are for all differents posting keys) restricting the posting key values.
Do you know if there is a way for get the initial Tcode executed by user from the second tcode called ?
Regards
Frank
2009 Jun 15 6:24 PM
if u know the first possible tcodes, u can store the value from them into a parameter id in SAP memory and retrieve them in the second tcode exits.
2009 Jun 15 6:47 PM
Thanks Soumya
How can i store the inital Tcode in the parameter id ? , since i execute F-43 i'm inside FB01 because
F-43 (and the others possible tcodes) are just tcodes for call FB01.
And the purposse is when the enhancement is executed i can filter the desired users tcodes.
So i need , being in FB01, to get the initial tcode F-43 (or others) executed by user for can filter this.
Best Regards
Frank
2009 Jun 15 6:58 PM
frank,
jsut check if any exit exist in these initial tcodes... u can check them by keeping a break point in
cl_exithandler->get_instance method.
after keeping this break point, run ur tcode..u will definitely come across a exit.(i am not in front of SAP system, else i cud have checked for u). if u get an exit. write the code to store the tcode id in a paramater
will this do??
2009 Jun 15 10:45 PM
Thanks Soumya
I got already the exit but this exit is called inside FB01 , there are several FI tcodes wich calls FB01:
F-43 -> FB01 -> program SAPMF05A
F-02 -> FB01 -> program SAPMF05A
FB05 -> FB01 -> program SAPMF05A
FB22 -> FB01 -> program SAPMF05A
etc.
(being in SAPMF05A i need to know wich initial tcode F-43/F-02/FB05/etc. was executed)
In all exits, badis or enhancements executed wherever i access sy-tcode it contains 'FB01' ; but i need to get the initial tcode executed by the user (F-43 or others) and not FB01 , because i need execute the enhancement just for some of those tcodes not for all , so in need to filter the tcodes inside it.
I hope i give the explanation well.
Best Regards
Frank
2009 Jun 15 11:11 PM
>
> F-43 -> FB01 -> program SAPMF05A
> F-02 -> FB01 -> program SAPMF05A
> FB05 -> FB01 -> program SAPMF05A
> FB22 -> FB01 -> program SAPMF05A
> etc.
Frank,
i am not sure, but all these initial tcodes such as F-43, F-02, etc must be having different screen exits atleast as each of them must be having different screen numbers. in that case there must be having different PBO's atleast in the includes of SAPMF05A.
can these screen numbers and screen exits give any light on what u need?
Edited by: soumya prakash mishra on Jun 16, 2009 12:11 AM
2009 Jun 16 5:00 AM
Hi,
I guess you can determine this with the help of call stack. Use FM SYSTEM_CALLSTACK to get the current call stack and try to find the called tcode from this.
I hope this may be useful.
Regards
Karthik D
2012 Jul 03 4:48 AM
Please using as below
CALL 'GET_PARAM_TCOD' ID 'PTCOD' FIELD tcode.