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

in module pool programming

Former Member
0 Likes
507

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
Read only

Former Member
0 Likes
481

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

Read only

Former Member
0 Likes
481

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

Read only

Former Member
0 Likes
481

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.

Read only

Former Member
0 Likes
481

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^