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

how to restrict bte for tcode?

Former Member
0 Likes
1,860

Hi abapers ,

                 I  have developed BTE For tcode : f.27 to trigger mail but this bte being called to another print programs also , how can i can restrict my BTE        for  Perticular Tcode : F.27. Please give some idea plzzzzzzzzz.

12 REPLIES 12
Read only

sabirshah1
Participant
0 Likes
1,720

Hi  Balaji,

In sample function module which gets created when u click on sample function module and put codition there like below .

If sy-tcode <> 'FB50' " Use the tcode which u want to restrict in place of FB50

   

* Your code .

Endif.

I hope it may help you.

Best Regards.

Read only

0 Likes
1,720

my tcode is F.27 so can we writer like below

If sy-tcode  =  'F.27'


code


endif.

Read only

0 Likes
1,720

Yes, If u want to restrict f.27 u can use

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,720

Look at F.27 definition with SE93, you will note that F.27 is a Parameter Transaction so actual value of SY-TCODE is SA39, so you cannot use this test.

There are other solutions thay you should try

  • Look for the report of the transaction (RFKORK00) in the call stack (use FM SYSTEM_CALLSTACK)
  • Identify the actual transaction code (use method CL_DYNPRO=>GET_CURRENT_TRANSACTION)

If that doesn't solve the problem, which BTE do you call, is it executed during transaction, during update task?

Regards,

Raymond

Read only

0 Likes
1,720

Hi Reymond,

     As you told  i gone thru program RFKORK00. how to find call stack and do the coding .please help ;me .

Read only

0 Likes
1,720

Hello Balaji

The call stack is visible in debugger. Put a break point in your BTE and when the program stops the below mentioned screen shot will highlight the call stack. Use the above mentioned functions module to get the call stack. This will be different for the call of same exit via different transaction. Code your logic based on this. else use the class and method as mentioned by Raymond.

thanks

Nabheet

Read only

0 Likes
1,720

Hi Nabheet ,

I am unable to find any call stack in that scree shot. Can you please elaborate .

Read only

0 Likes
1,720

As nabheet madan

Read only

0 Likes
1,720

Hi Raymond ,

Can we use code like below

if SY-CPROG = ZFKORD11

  bte code

endif.    to restrict bte for Particular program.

Read only

0 Likes
1,720

Just set a break-point in your FM and try

Read only

0 Likes
1,720

Put your glass on, and look for "Abap and Screen Stack"...

Read only

former_member182354
Contributor
0 Likes
1,720

Hi Balaji,

              Debug the BTE and check the values of syst variables and use them to restrict BTE code.

Regards,

Raghav