2006 Nov 29 4:23 AM
Hi Friends,
The standard toolbar items are not working in my screen painter program. The code I have written is as follows.
-
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
MODULE USER_COMMAND_0100 INPUT.
LOOP AT SCREEN.
IF SY-UCOMM EQ 'EXIT'(001).
LEAVE PROGRAM.
ENDIF.
ENDLOOP.
ENDMODULE. " USER_COMMAND_0100 INPUT
-
When I execute the program and click on the Exit icon, the program is not functioning.
Kindly guide me the solution.
TIA.
Regards,
Mark K
2006 Nov 29 4:44 AM
HI Mark,
Modify your code like this:-
************************************************************
PROCESS BEFORE OUPUT.
MODULE STATUS_0100 OUTPUT.
<b>MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN-100'.
SET TITLEBAR 'TITLE_100'.
ENDMODULE.</b>
************************************************************
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100 INPUT.
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
MODULE USER_COMMAND_0100 INPUT.
IF SY-UCOMM = 'EXIT'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE. " USER_COMMAND_0100 INPUT
-
After writing this code double click on 'MAIN-100'. This will take you to the toolbar screen. Select the option function keys from there and on top of the exit button write EXIT. Activate it and come back.
Now execute your program. Exit button will work.
Please reward points if this is what you required.
Regards,
Kirti.
Hi Friends,
I have tried all the suggestions given by u all, but still I am having the same problem.
Kindly guide me.
Regards,
2006 Nov 29 4:25 AM
chk this sample
PROGRAM demo_dynpro_gui_status.
DATA: ok_code TYPE sy-ucomm,
save_ok LIKE ok_code,
output LIKE ok_code.
CALL SCREEN 100.
MODULE init_screen_0100 OUTPUT.
SET PF-STATUS 'STATUS_100'.
SET TITLEBAR '100'.
ENDMODULE.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE PROGRAM.
WHEN OTHERS.
output = save_ok.
ENDCASE.
ENDMODULE.
.rgds
Anver
2006 Nov 29 4:26 AM
module USER_COMMAND_0300 input.
CASE ok_code.
WHEN 'EXIT'.
LEAVE PROGRAM.
endcase.
2006 Nov 29 4:26 AM
Hi,
You need to create GUI.In that,give the name for the exit icon as EXIT.
Then in PAI of the screen,
case sy-ucomm.
when 'EXIT'.
leave program.
..
endcase.
2006 Nov 29 4:27 AM
Hi,
Did u activated the PF-STATUS, where we specify the menu items,application tool bar items and function keys.First activate the same and the chk.
Regards,
Nagaraj
2006 Nov 29 4:36 AM
you will have to make this function as an EXIT Command, u can do this in the PF-Status. and make sure u activate it.
in the PF-Status
clk on the function key, u can see the attributes window, there u set the Functional Type as E ie Exit Command.
and now in PAI
module EXIT_COMMAND_0100 at exit-command.
case SY-UCOMM.
when 'EXIT'.
leave program.
endcase.
Thsi shold solve ur problem
and make sure the EXIT_command is the first module of ur PAI, next follows the remaining modules and the USER_COMMAND at the last
Regards
- Gopi
2006 Nov 29 4:44 AM
HI Mark,
Modify your code like this:-
************************************************************
PROCESS BEFORE OUPUT.
MODULE STATUS_0100 OUTPUT.
<b>MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'MAIN-100'.
SET TITLEBAR 'TITLE_100'.
ENDMODULE.</b>
************************************************************
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100 INPUT.
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
MODULE USER_COMMAND_0100 INPUT.
IF SY-UCOMM = 'EXIT'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE. " USER_COMMAND_0100 INPUT
-
After writing this code double click on 'MAIN-100'. This will take you to the toolbar screen. Select the option function keys from there and on top of the exit button write EXIT. Activate it and come back.
Now execute your program. Exit button will work.
Please reward points if this is what you required.
Regards,
Kirti.
2006 Nov 29 5:34 AM
Hi Friends,
I have tried all the suggestions given by u all, but still I am having the same problem.
Kindly guide me.
Regards,
2006 Nov 29 5:37 AM
hi,
pls post ur latest code.
before that pls check program and pf status are activated
rgds
Anver
2006 Nov 29 5:48 AM
Hi Anver,
I have given below the latest code used in my program.
-
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'GUI'.
SET TITLEBAR 'TITLE'.
MODULE USER_COMMAND_0100 INPUT.
*DATA: save_ok LIKE ok_code,
output LIKE ok_code.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE PROGRAM.
WHEN OTHERS.
output = save_ok.
ENDCASE.
LOOP AT SCREEN.
IF SY-UCOMM EQ 'EXIT'.
LEAVE PROGRAM.
*leave to screen 0.
ENDIF.
ENDLOOP.
ENDMODULE. " USER_COMMAND_0100 INPUT
-
Kindly look into this and guide me a solution.
Regards,
2006 Nov 29 5:55 AM
write the following code in PAI.
case sy-ucomm.
when 'EXIT'.
leave program.
endcase.
remove loop at screen and try it.
This will solve your problem.
I think the function code u assigned to Exit pushbutton and the command u r checking at 'when' are different.
Make sure that both are same.
sateesh.
2006 Nov 29 5:56 AM
hi,
juts use this.
u fgt to give <b>ok_code TYPE sy-ucomm</b>
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'GUI'.
SET TITLEBAR 'TITLE'.
MODULE USER_COMMAND_0100 INPUT.
DATA: ok_code TYPE sy-ucomm,
save_ok LIKE ok_code,
output LIKE ok_code.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE PROGRAM.
WHEN OTHERS.
output = save_ok.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUTrgds
Anver
2006 Nov 29 5:59 AM
Hi,
I observed the follg. things from your code.
1.Remove loop at screen in MODULE USER_COMMAND_0100 INPUT.
2.You are setting SET PF-STATUS 'GUI'.
Make sure by double clikcing GUI to check it exists.I hope GUI should be ZGUI.
3.Make sure that function code you assigned in GUI is EXIT for exit icon.
4.Activate the GUI.
2006 Nov 29 6:25 AM
Hi,
Even these solutions are not working.
I have used the standard toolbar avaliable in the Function Keys. Is there any difference for standard toolar under function kyes and Application toolbar.
Regards,
2006 Nov 29 5:53 AM
Hi,
Remove the LOOP AT SCREEN and ENDLOOP.
IF SY-UCOMM EQ 'EXIT'.
LEAVE PROGRAM.
*leave to screen 0.
ENDIF.
Thanks,
Naren
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |