‎2006 Nov 15 6:51 AM
Hi there,
I had a requirement where there are two pushbuttons with same fcodes, and I want to know which push button is pressed .
for example, there are two input fields, and beside each input field, there is one pushbutton, which have same fcodes.(CHNG)
The functionality is same except the value to be assigned for a exporting parameter to call FM is different.I get the exporting parameters from the input fields.
So how can i differentiate between two pushbuttons pressed.
Regards,
Anil .
‎2006 Nov 15 7:01 AM
First of all is it compulsary to have same Fcode for 2 buttons?
If so can u Elabrate Little bit means What r the input values it differ means how do u Distinguish ......
Murthy
‎2006 Nov 15 7:33 AM
Yes I want same fcode for 2 buttons, since there are two such pair of buttons with same fcodes.
Actually, each input field contains different structure name, and upon clicking the pushbutton, the particular input field value must be assigned to exporting parameter of same FM.
So can u please find solution .
‎2006 Nov 15 8:24 AM
Hi Anil,
Ok then Do one thing... Means if the Input Values are known and limited then According to that u Fix.
MEans
case sy-ucomm.
when 'fcode'.
if p_data = 'XXXXXXX'.
Call Function AAAAAAAAAA.
elseif p_data = 'YYYYYYYY'.
Call Function BBBBBBBBBB.
endif.
endcase.
Just check this out and let me if know.
Bye
Murthy.
‎2006 Nov 15 8:27 AM
Hi
If you have defined the pushbutton on the screen you can use the statamente GET CURSOR:
MODULE USER_COMMAND.
CASE OK_CODE.
WHEN 'CHNG'.
GET CURSOR FIELD VA_FIELD.
IF VA_FIELD = 'BUTTON1'.
ELSE.
ENDIF.Max
‎2006 Nov 15 7:03 AM
Hi,
Use the different Function Codes and then based on clicking the button, u determine the function code and thenimplement ur logic,
As far i know it is not possible to know which button is clicked with the same function code.
Cheers,
Simha.
‎2006 Nov 15 7:20 AM
hi
good
declare a flag as 'x'.
use the case and end case statement and pass the value of sy-ucomm and check which pushbutton has been pressed and you can generate action accordingly.
thanks
mrutyun^