Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Standard Toolbar

Former Member
0 Likes
2,111

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,068

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 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.

14 REPLIES 14
Read only

anversha_s
Active Contributor
0 Likes
2,068

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

Read only

0 Likes
2,068

module USER_COMMAND_0300 input.

CASE ok_code.

WHEN 'EXIT'.

LEAVE PROGRAM.

endcase.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
2,068

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.

Read only

former_member404244
Active Contributor
0 Likes
2,068

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

Read only

gopi_narendra
Active Contributor
0 Likes
2,068

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

Read only

Former Member
0 Likes
2,069

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.

Read only

0 Likes
2,068

Hi Friends,

I have tried all the suggestions given by u all, but still I am having the same problem.

Kindly guide me.

Regards,

Read only

0 Likes
2,068

hi,

pls post ur latest code.

before that pls check program and pf status are activated

rgds

Anver

Read only

0 Likes
2,068

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,

Read only

0 Likes
2,068

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.

Read only

0 Likes
2,068

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 INPUT

rgds

Anver

Read only

0 Likes
2,068

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.

Read only

0 Likes
2,068

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,

Read only

Former Member
0 Likes
2,068

Hi,

Remove the LOOP AT SCREEN and ENDLOOP.

IF SY-UCOMM EQ 'EXIT'.

LEAVE PROGRAM.

*leave to screen 0.

ENDIF.

Thanks,

Naren