‎2008 Aug 20 10:07 AM
Hi all,
I've got a dynpro with normal input-fields and pushbuttons on it as well as a table-control, equally with input-fields and pushbuttons in it. Whenever a button is pressed I want to find out which button it was.
I need the name of the dynprofield, I cannot use only SY-FCODE to determine the button.
So I'm using GET CURSOR FIELD ... LINE ...
Now my problem:
Let's say the user sets the cursor in an input-field (no matter, whether inside or outside the table-control) and then pushes a button inside the table-control. The dynpro-cursor moves to the button - and GET CURSOR gets me the name of the button. Exactly what I want.
But when the user pushes a button outside the table-control, the dynpro-cursor does not move to the button but remains on the input-field and thats the name I get!
Why doesn't the dypro-cursor move to the button outside the TC? Is there any other way to get the name of the pressed button?
Thanks and regards,
Uwe Kaiser
‎2008 Aug 28 1:03 PM
About pushbutton in TC:
The function code, which is no more than four characters long, can end
with up to three '%' characters. These percentage characters act as
placeholders for pushbuttons used in step loops and table controls. When
the user presses a pushbutton in the course of a transaction, the
placeholders are replaced by the number of the loop repetition (or the
table control line) before the function code is made available.
Example: Suppose the function code of a pushbutton in a step loop
is 'F%%'. If the user presses the pushbutton during the
eighth loop repetition, the system retrieves the function
code 'F08'.
For pushbutton outside of TC, you should use the sy-tcode. I really don't see why you would not be able to do so...
‎2008 Aug 28 1:03 PM
About pushbutton in TC:
The function code, which is no more than four characters long, can end
with up to three '%' characters. These percentage characters act as
placeholders for pushbuttons used in step loops and table controls. When
the user presses a pushbutton in the course of a transaction, the
placeholders are replaced by the number of the loop repetition (or the
table control line) before the function code is made available.
Example: Suppose the function code of a pushbutton in a step loop
is 'F%%'. If the user presses the pushbutton during the
eighth loop repetition, the system retrieves the function
code 'F08'.
For pushbutton outside of TC, you should use the sy-tcode. I really don't see why you would not be able to do so...
‎2008 Aug 28 3:28 PM
Thank you for your answer, Francois. I didn't know about the automatic replacement of '%'-characters in the function code of pushbuttons in TC. Its going to be useful.
And I think eventually I will have to use the SY-TCODE for buttons outside the TC. Although I wouldn't have to, if GET CURSOR was working the same way outside like inside the TC.
‎2008 Aug 28 3:56 PM
GET CURSOR is intended to work with input fields (i.e. fields in which you can enter data)
Actually I am surprised that it works with a button inside a TC !