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: 

skip validation at exit or cancel (module pool)

Former Member
0 Kudos

Hi Experts,

How can I skip validation while user select exit button.

i am validating the fiels by Module statment as given below.

please give your valuable suggestions if it is wrong logic.

Example

Flow logic

MODULE VALIDATE_VENDRNO_9001.

Program

&----


*& Module VALIDATE_VENDRNO_9001 INPUT

&----


  • text

----


MODULE VALIDATE_VENDRNO_9001 INPUT.

DATA : L_LIFNR TYPE LIFNR,

L_NAME TYPE NAME1.

SELECT SINGLE LIFNR NAME1 FROM LFA1 INTO (L_LIFNR, L_NAME)

WHERE LIFNR = W_GEH-VENDR.

IF SY-SUBRC NE 0.

CONCATENATE 'CHECK VENDOR NO' ZGEH-VENDR INTO G_TEXT SEPARATED BY SPACE.

MESSAGE G_TEXT TYPE 'E'.

CLEAR G_TEXT.

ELSE.

MOVE L_NAME TO W_GEH-VNAME.

ENDIF.

ENDMODULE. " VALIDATE_VENDRNO_9001 INPUT

Thanks & Regards,

Devalla T Kumar

5 REPLIES 5

Former Member
0 Kudos

HI,

Go to the screen and in that pf status and then double clik on EXIT button , there you can give the function code type as 'E', then the validations will be skipped and then you can use the code as Leave to screen 0.

i mean here validations wil be skipped .....

module validations.

case sy-ucomm.

when 'EXIT'.

leave to screen 0.

endcase.

Regards,

Venkatesh

Former Member
0 Kudos

Hi,

define another module in PAI, and write a case on sy-ucomm..

PAI.

MODULE name AT EIXT-COMMAND.

In PF-STATUS set the F-code as 'EXIT' for exit button.

MODULE name.

case sy-ucomm.

when 'EXIT'.

leave screen.

endcase.

endmodule.

Hope it helps ur requirement

Kindly let me know for any further help!!

Regards,

Pavan

Former Member
0 Kudos

Hi...

provide one module at the first of PAI

MODULE exit AT EXIT-COMMAND.

inside dat code for EXIT.

like...

case okcode.

when 'EXIT'.

LEAVE PROGRAM.

endcase.

also in pf-status provide the function type of exit as 'E'.

Former Member
0 Kudos

Hi,

Once you assign "Function type" as "E" in the Pf-Status of the screen and In PAI of that Screen write a separate module for it as

MODULE exit_screen AT EXIT-COMMAND.

MODULE exit_screen INPUT.

CASE sy-ucomm.

WHEN 'EXIT' OR 'CANC'.

LEAVE TO SCREEN 0.

WHEN 'OTHERS'.

ENDCASE.

ENDMODULE.

in this case your all validations will be skipped.

Regards,

Neha

Former Member
0 Kudos

Thanks