Skip to Content
author's profile photo Former Member
Former Member

skip validation at exit or cancel (module pool)

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2009 at 08:50 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2009 at 08:51 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2009 at 08:53 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2009 at 09:08 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2009 at 10:53 AM

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.