‎2009 Oct 06 5:54 PM
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
‎2009 Oct 06 6:00 PM
for funtion code
at user-command.
write sy-ucomm.
what do you mean by button name ?
‎2009 Oct 06 6:00 PM
for funtion code
at user-command.
write sy-ucomm.
what do you mean by button name ?
‎2009 Oct 06 6:05 PM
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
‎2009 Oct 06 6:08 PM
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
‎2009 Oct 06 6:53 PM
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!
‎2009 Oct 06 7:02 PM
Breaking news guys...
The code as it, it's ok!
Thanks for your help!!
Gaby
‎2009 Oct 06 6:03 PM
Hi,
Try this way.
Thanks
Venkat.O
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.