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: 

Calling the same Transaction from different places

Former Member
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

put the button in report then write the logic for that button in screen level .... then you can define the properties ...

Former Member
0 Kudos

hi,

Try using the option sy-tcode.

0 Kudos

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

huseyindereli
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

former_member212653
Active Contributor
0 Kudos

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.

0 Kudos

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