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

Problem with Exit push button

Former Member
0 Likes
1,041

Hi All,

I have a required field in module pool programming. When i press Exit push button message displays "Fill in all required entry fields".

I want to exit from program without fill any field.

Is it possible. plz help me

5 REPLIES 5
Read only

Former Member
0 Likes
806

Hi Sweta,

Go to your status of the Screen assign Function Type as E." Double Click on your PF Status for this.
Expand Function Keys and Double Click on EXIT word (Which you Placed Earlier) and Assign E as the Functional Type

in PAI of your program.

At Screen Level maintainOK_CODE in element List and also declare OK_CODE in TOP include.


MODULE exit AT EXIT-COMMAND.

in program.

MODULE exit .
CASE OK_CODE.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.

Cheerz

Ram

Read only

Former Member
0 Likes
806

Hi,

Yes this is very well possible in SAP GUI. You have to define a Module in PAI processing block with the following notation:

MODULE <mod> AT EXIT-COMMAND.

Replace <mod> with you own module. Once you press the EXIT button this will be the module that will get executed without any other evaluation happening.

Have a look at this link for details:

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaa9535c111d1829f0000e829fbfe/content.htm

Hope this will help.

Thanks,

Samantak.

Read only

Former Member
0 Likes
806

You can achive the same , press F1 on MODULE <mod> AT EXIT-COMMAND.

You can also write LEAVE PROGRAM in the logic for function of the button using sy-ucomm.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
806

Hi,

In the PF-Status, keep the Functional Type for the EXIT button as E.

And code for the same button in the module:-


PROCESS AFTER INPUT.
  MODULE exit AT EXIT COMMAND.


MODULE exit.
  CASE sy-ucomm.
    WHEN 'EXIT'.
      LEAVE PROGRAM.  "<- to leave the transaction.
  ENDCASE.
ENDMODULE.

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
806

Thank to all