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

Status GUI and code

former_member204025
Participant
0 Likes
721

Hi all!

I have created an STATUS GUI for a simple report, I would like to know if i can show in a write statement via code and after pressing a button this:

1. Name of the button. and

2. The function asociated to this button ?

I'll appreciate any help.

Thanks,

Gaby

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
695

for funtion code


at user-command.
write sy-ucomm.

what do you mean by button name ?

6 REPLIES 6
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
696

for funtion code


at user-command.
write sy-ucomm.

what do you mean by button name ?

Read only

0 Likes
695

Hi,

What I mean is, when I created a new Status GUI, I added a button, I called '&SHOW', what I did is:

case sy-ucomm.

when '&SHOW'.

write: 'You pressed the SHOW button'.

and I gave it a function key f2, I would like to know if there is a way to show after the first write, it's function key and the name of the button.

It can be possible?

Gaby

Read only

0 Likes
695

at user-command.
case sy-ucomm.
when '&SHOW'.
write 'Button', sy-ucomm.
skip 1.
write 'Function Key',SY-PFKEY.
endcase.

this will do

Edited by: Keshu Thekkillam on Oct 6, 2009 10:39 PM

Read only

0 Likes
695

Hi Keshu!

it's a very helpful answer! But I can't see yer the Function Key, what I see with sy-pfkey is the status gui name, what I need to see is the function key for the button that I have selected

I'll be looking for that!

Read only

0 Likes
695

Breaking news guys...

The code as it, it's ok!

Thanks for your help!!

Gaby

Read only

venkat_o
Active Contributor
0 Likes
695

Hi, Try this way.


REPORT ZTEST.
START-OF-SELECTION.
SET PF-STATUS 'STATUS1'.

AT USER-COMMAND.
 CASE sy-ucomm.
  WHEN 'BUT1'.
     WRITE:/ 'Button1'. "We need write text for the button manually as we are writing code, we know what is that button. I do not think any system field is there which contains button text.
     WRITE:/ sy-ucomm. "Button function code
 ENDCASE.
Thanks Venkat.O