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: 

validating date in module pool

Former Member
0 Kudos
582

Hi

i have a screen that contains date filed , if the date is greater than present date i want to give message and if the user is giving the other than future date then only it will be processed .

in pai i write like this

if equi-MEASURED_DATE > sy-datum.

message E000(z01) with 'Date Cannot be the future date'.

endif.

but if i pressed save it is taking i dont want to take

Message was edited by:

kiran kumar

11 REPLIES 11

Former Member
0 Kudos
162

Hello Kiran,

In the PAI do this.

CHAIN FIELD DATE MODULE VALIDATE.

In report

MODULE VALIDATE.

if data > sy-datum.

error message.

endif.

ENDMODULE VALIDATE.

IF useful reward and close the thread.

Vasanht

Former Member
0 Kudos
162

Hi,

In PAI of the Screen write the Code:

Chain,

field <name>.

module <name> on chain-input.

endchain.

double click on module name and write the validation.

Regards,

Anji

0 Kudos
162

MODULE USER_COMMAND_1000 INPUT.

CHAIN

FIELD EQUI-MEASURED_DATE.

MODULE CHECK_input ON CHAIN-INPUT.

ENDCHAIN.

*if equi-MEASURED_DATE > sy-datum.

*message E000(z01) with 'Date Cannot be the future date'.

*endif.

ENDMODULE. " USER_COMMAND_1000 INPUT

IT IS GIVING MESSAGE CHAAIN IS NOT DEFINED,CHECK U R SPELLING

0 Kudos
162

OH SORRY TO ALL I MADE A BIG MISTAKE

I AM OT WRITEING AT FLOW LOGIC

SORRY GUYS

athavanraja
Active Contributor
0 Kudos
162

in PAI write the following code.

process after input.

field equi-MEASURED_DATE module fm3 .

double click on fm3 and it would create module where you write the following code.

module fm3 input.

if equi-MEASURED_DATE > sy-datum.

message E000(z01) with 'Date Cannot be the future date'.

endif.

endmodule.

Regards

Raja

0 Kudos
162

PAI IS NOT TRIGGERING

PROCESS BEFORE OUTPUT.

MODULE STATUS_1000.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1000.

CHAIN.

field EQUI-MEASURED_DATE module CHECK_DATE.

ENDCHAIN.

MODULE CHECK_DATE INPUT.

BREAK-POINT.

if EQUI-MEASURED_DATE > sy-datum.

message E000(z01) with 'Date Cannot be the future date'.

endif.

ENDMODULE.

Former Member
0 Kudos
162

Validation has to be done using FIELD statement in the PAI.

PAI

FIELD v_date MODULE Validate_data.

Module validata_date.

<perform Validation>

endmodule.

Former Member
0 Kudos
162

Hi Kiran,

For this you have to use module In PAI in your screen

write it in this way


CHAIN FIELD DATE MODULE CHECK_VALIDATION

Under your module you ccan validate it in this way



MODULE CHECK_VALIDATION.
IF DATE GT SY-DATUM.
Message E-001.  " Date can not be greater than the current date.
ENDIF.
ENDMODULE VALIDATE.

Former Member
0 Kudos
162

Hi Kiran

Try as follows it will be Work

Write following code in PAI.

PROCESS AFTER INPUT.

CHAIN.

FIELD p_datuv MODULE chain_module_1.

ENDCHAIN.

then Doble click and write following code with in module.

MODULE chain_module_1 INPUT.

if equi-MEASURED_DATE > sy-datum.

message E000(z01) with 'Date Cannot be the future date'.

endif.

ENDMODULE. " chain_module_1 INPUT

Thanks.

Jay

0 Kudos
162

IF I WRITE CODE IN MODULE USER_COMMAND_1000.

IN THIS MODULE IS TRIGGERING

0 Kudos
162

wirte the code in PAI.

see the following ex:

PROCESS AFTER INPUT.

CHAIN.

FIELD KONA-KNUMA.

MODULE MOD_CHECK_INPUT.

ENDCHAIN.

&----


*& Module m_comp INPUT

&----


  • text

----


MODULE MOD_CHECK_INPUT INPUT.

SELECT SINGLE * FROM KONA WHERE KNUMA = KONA-KNUMA.

IF SY-SUBRC <> 0.

MESSAGE E999 WITH 'Agreement No. ' KONA-KNUMA 'does not exists'.

ENDIF.

ENDMODULE. " m_comp INPUT