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: 

Differentiate the Function code of Menu Item

Former Member
0 Kudos

Hi Experts,

I have some function code of the Menu's created ,and some funtion created at the tool bar level.

How can i know that the Function code if triggered from the Menu.

Regards.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use system variable sy-ucomm.

Then put Case sy-ucomm and keep break-point where your function code triggers.

You will understand.

Regards and Best wishes.

6 REPLIES 6

Former Member
0 Kudos

Hi,

Use system variable sy-ucomm.

Then put Case sy-ucomm and keep break-point where your function code triggers.

You will understand.

Regards and Best wishes.

0 Kudos

Thnaks, In my case i have same SY-UCOMM for both, But i want to differentiat it,because i need to do some validation if it is triggered from Menu

0 Kudos

Hi,

Try maintain different function codes.

Example in your menu if you have menuitem has function code is '+FCO1'.

Then in the program write:

Case sy-ucomm.

when '+FCO1'

write your logic.

endcase.

Regards and Best wishes.

0 Kudos

If i understand correctly you want to check whether the UCOMM is triggered from the application tool bar or the menu bar. Correct ? I don't see any way of doing this.

BTW what exactly is your business requirement ?

BR,

Suhas

0 Kudos

OK i will try to explain it more clearly,

I have a tree,and the User can see the data of node of the tree from a button that is placed in its tool bar.

But if the user tries to see the data using the Menu I need to validate if some node is selected.

For this i would need to differentiate wheather it is clicked from Tool Bar or Menu Item

0 Kudos

Hi, Raz

I am agree with Saha i think there is no way with having Same F-Codes, for this you will have to assign different code to Menu and Toolbar.

Thanks and Best Regards,

Faisal