2007 Mar 13 10:43 AM
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
2007 Mar 13 10:45 AM
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
2007 Mar 13 10:46 AM
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
2007 Mar 13 10:51 AM
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
2007 Mar 13 10:53 AM
OH SORRY TO ALL I MADE A BIG MISTAKE
I AM OT WRITEING AT FLOW LOGIC
SORRY GUYS
2007 Mar 13 10:47 AM
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
2007 Mar 13 11:02 AM
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.
2007 Mar 13 10:48 AM
Validation has to be done using FIELD statement in the PAI.
PAI
FIELD v_date MODULE Validate_data.
Module validata_date.
<perform Validation>
endmodule.
2007 Mar 13 10:55 AM
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.
2007 Mar 13 10:55 AM
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
2007 Mar 13 11:06 AM
IF I WRITE CODE IN MODULE USER_COMMAND_1000.
IN THIS MODULE IS TRIGGERING
2007 Mar 13 11:22 AM
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