Application Development 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: 

in module pool programming

Former Member
0 Kudos

hi

in module pool programming, there is a mandatory field , but the user should not enter the value in the mandatory field, how to come out of the screen.

4 REPLIES 4

Former Member
0 Kudos

Hi,

For this, you need to program what is called AT EXIT-COMMAND code.

In your flow logic, you create a module as so:

MODULE md_exit_command AT EXIT-COMMAND.

Then in PF-status, you configure the Cancel (red button on toolbar) as exit button by setting Type of button as 'E'. Put OKCODE as 'CANC'.

Then, in the module

MODULE md_xit_command INPUT.

CASE OKCODE.

WHEN 'CANC'. LEAVE TO SCREEN 0. ENDCASE.

ENDMODULE.

What this does is, if there is any error , the exit command overrides this error and allows you to exit.

Cheers,

Aditya

Former Member
0 Kudos

Hi,

You can use the feature:

MODULE XYZ AT EXIT-COMMAND.

Double-click on XYZ and this will create a Module....End Module in the PAI of the screen. Inside this, you can code your logic to leave the screen, even if there are mandatory fields.

MODULE BACK INPUT.

LEAVE TO SCREEN 100.

ENDMODULE.

The above coding is just a heads on. You may have to add few logics as desired by the reqt.

Regards,

JLN

Former Member
0 Kudos

Hi,

1. For your BACK or CANCEL button on menu bar, give Button

Ftype "E".

2. In PAI : Write below Modules.

PROCESS AFTER INPUT.

MODULE CANCEL AT EXIT-COMMAND.

MODULE BACK AT EXIT-COMMAND.

double click on it.Inside of modules write below code.

MODULE CANCEL INPUT.

IF OK_CODE = 'CANCEL'.

CLEAR OK_CODE.

LEAVE PROGRAM.

ENDIF.

ENDMODULE.

MODULE BACK INPUT.

IF OK_CODE = 'BACK'.

CLEAR: OK_CODE, INPUT1, INPUT2.

LEAVE TO SCREEN 100.

ENDIF.

ENDMODULE.

Former Member
0 Kudos

hi

good

if it is mandatoray field than you can come out of the report directly clicking on the red button on the sap screen but i dont know how it will fulfill your requiremnet.

thanks

mrutyun^