‎2009 Feb 11 9:39 PM
Hi,
I have a Dynpro in this Dynpro there's a Button ... I would like to assing a Function Key on that Button for example
If I create a Exit Button . When I press F3 (Function Key) the program should exit .
I hope your help please!!
‎2009 Feb 11 9:46 PM
Hello,
it is pretty easy....
on you screen PBO create an status and asignn the key you would like to your button....
then on your PAI....write exit program when sy.ucomm = 'your key'
on your screen process....
PROCESS BEFORE OUTPUT.
MODULE status_0100. -> write this and double click
*
PROCESS AFTER INPUT.
MODULE user_command_0100. -> write this and double click
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STAT'. ->write this and double click AND CREATE THE BUTTON
SET TITLEBAR 'CALC'.
ENDMODULE. " STATUS_0100 OUTPUT
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'SAVE'.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN OTHERS.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
CHEERS BYE!!
‎2009 Feb 11 9:46 PM
Hello,
it is pretty easy....
on you screen PBO create an status and asignn the key you would like to your button....
then on your PAI....write exit program when sy.ucomm = 'your key'
on your screen process....
PROCESS BEFORE OUTPUT.
MODULE status_0100. -> write this and double click
*
PROCESS AFTER INPUT.
MODULE user_command_0100. -> write this and double click
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STAT'. ->write this and double click AND CREATE THE BUTTON
SET TITLEBAR 'CALC'.
ENDMODULE. " STATUS_0100 OUTPUT
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'SAVE'.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN OTHERS.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
CHEERS BYE!!
‎2009 Feb 12 4:30 AM
Hi ,
You can try this code in Module user_command_<screen_no> of PAI -
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
LEAVE TO SCREEN 0 .
when 'F_code'
.............................
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUTRegards
Pinaki
‎2009 Feb 12 4:36 AM
Hi,
When you build a dialog program and set a pf-status (which take F3 for BACK functionality by defualt ).
So you can assign any other function key as the shortcut key.
We genrally use AT EXIT COMMAND for buttons with function type E coz if user wishes to exit the application without entering value for mandatory fields.
So suppose that you create a button 'EXIT' with finction code '&EXT' and function type 'E'.
Now use code:-
PROCESS AFTER INPUT.
MODULE zexit AT EXIT COMMAND.
In PAI:-
MODULE zexit.
CASE sy-ucomm.
WHEN '&EXT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.
Now when you press this shorcut, simply the above code will be executed and program will be terminated.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
Edited by: Tarun Gambhir on Feb 12, 2009 10:06 AM
‎2009 Feb 12 4:46 AM
Hi,
Try the following logic.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0500.
On double clicking you will get something like this.
module STATUS_0500 output.
SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
endmodule. " STATUS_0500 OUTPUT
On double clicking the 'xxxxx' , you will be taken to manu painter. There you can assign the toolbar of your choice. Save and activate it.
In your PAI,
case sy-ucomm.
when 'EXIT'. "name given by you
LEAVE PROGRAM.
endcase.Hope this helps.
Regards,
Deepthi.
Edited by: Deepthi S on Feb 12, 2009 10:16 AM
‎2009 Feb 13 5:49 PM
Thanks, But my problem is : i have to create a button inside the dynpro , NOT IN STATUS BAR, after that I can't use the mouse for that reasen I have to press a F-key to activate the button for example
My Dynpro
-
Status BAR
-
EXIT F3 | ||
-
Exit F3 is the button which It works when I press F3-key. so that i want to assign F3-key with my button
‎2009 Feb 13 5:59 PM
Another thing! When I Said Assign F3-key for exit button ... It was an example .... I want to know a general way to make a relation between a Function Key and A button which It was created inside the dynpro.
Thanks for all
‎2009 Feb 13 9:25 PM
In the button attributes, assign "EXIT" user command value (in the PAI, you'll test it with IF sy-ucomm = 'EXIT'). In the gui status, assign EXIT to keyboard function key F3.