02-16-2009 6:37 AM
Hi folks,
I have created a custom screen using module pool. Users can call this screen either directly using the Tcode or can call from a report. The problem is, If users calls the screen from the report, the screen should not perform some actions. How can i validate this. How can i know, whether a screen is called directly or from a report at runtime...Please suggest me..
Thanks in advance,
Shyam.
Edited by: shyam prasad on Feb 16, 2009 7:37 AM
Edited by: shyam prasad on Feb 16, 2009 7:39 AM
02-16-2009 6:39 AM
put the button in report then write the logic for that button in screen level .... then you can define the properties ...
02-16-2009 6:41 AM
02-16-2009 6:45 AM
Hi Hari,
I have already tried using the option of SY-TOCDE. But it shows the tcode of the screen but not the report. So there, its not possoble to distinguish that one.
Thanks,
Shyam.
Edited by: shyam prasad on Feb 16, 2009 7:45 AM
02-16-2009 6:51 AM
Use the export parameter actions just before you call the screens. Mark the value to specify your starting point then import parameter and see where the request come from.
02-16-2009 8:19 AM
Hi Shyam,
As mentioned in other reply u can try it with EXPORT/IMPORT parameters.
If particular logic has to work only when it has called using created T-code , then u can try placing IF condition befroe start of that code. U can pass the value of sy-tcode to some local variable and try.
l_tcode = sy-tcode.
if l_tcode NE 'transaction'.
process logic.
endif.
02-16-2009 8:26 AM
Call the FM: SYSTEM_CALLSTACK the PBO of the module pool and check the stack. If the Module Pool is called from the program you can find the custom report program in the stack and do the necessary processing in the PBO.
02-16-2009 1:00 PM
Hi,
if you are already using Sy-tcode,
the use in this way,
your custom screen is called from a TCODE, then if it is not that Tcode then disable functions.
if equal then enable.
loop at screens.
Thanks & Regards,
Dileep .C